各位合作伙伴大家好
我正在尝试从 Docker Hub 将应用程序部署到 Kubernetes。我已成功将应用程序部署到 Docker Desktop,并且它在 8082 端口上运行,但是当我尝试将其部署到 Kubernetes 集群时,它没有显示任何 Pod 和部署正在运行
文件名为platforms-deply.yaml
apiVersion: apps/v1 # This is the API Version as Kubernetes clusters work in a REST API way
kind: Deployment # What kind of deployment we are doing here
metadata: # Metadata for our deployment
name: platformservice # Name of the deployment
spec: # Defining specification like replicas, selectors, and template
replicas: 1 # Docker Desktop can only have 1 replica in a simple case
selector:
matchLabels:
app: platformservice # The label to match for selecting the pods to manage
template:
metadata:
labels:
app: platformservice # Same project name as label to identify pods
spec:
containers:
- name: platformservice # Container name (must be unique in the pod)
image: aiftikhar/platformservice:latest # Docker image name (must include version/tag)
这就是我之前运行该命令的方式,这就是为什么没有改变
kubectl apply -f platforms-deply.yaml
但是我认为它已经启动了这个POD,因为当我删除它时,自动启动了。
问题:-Docker Run 命令如何为这些提供随机名称
我的 Docker 桌面存储库屏幕截图,因为我有同一项目的两个容器,这会在 Kubernetes 上部署时产生问题
谢谢 Phil,我尝试使用最新标签拉取我的图像,但它不存在,因为图像名称应该是 aiftikhar 中的 e 而不是 I
image: aiftekhar/platformservice:latest
我又跑了,它有效了,谢谢