【发布时间】:2020-11-26 16:54:06
【问题描述】:
我在 rasberry pi(Ubuntu 20.04) 上运行 K8s 集群。当我尝试部署以下 K8s 部署时,未在 pod 上创建标签“rel”和“env”。
K8s 版本:
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.7", GitCommit:"8fca2ec50a6133511b771a11559e24191b1aa2b4", GitTreeState:"clean", BuildDate:"2019-09-18T14:47:22Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"windows/a
md64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:51:04Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/arm"}
-- 部署 yaml (kubectl apply -f .)
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-catalog-deployment
namespace: default
labels:
app: product-catalog
rel: beta
env: prod
spec:
selector:
matchLabels:
app: product-catalog
replicas: 3
template:
metadata:
labels:
app: product-catalog
spec:
containers:
- name: product-catalog
image: marveltracker/netcore_fun:netcore_3_1
ports:
- containerPort: 80
name: http
- containerPort: 443
name: https
---获取产品(kubectl get po --show-labels)
NAME READY STATUS RESTARTS AGE LABELS
product-catalog-deployment-65c7bcbf48-8nxbw 1/1 Running 0 16s app=product-catalog,pod-template-hash=65c7bcbf48
product-catalog-deployment-65c7bcbf48-f764h 1/1 Running 0 16s app=product-catalog,pod-template-hash=65c7bcbf48
product-catalog-deployment-65c7bcbf48-pcz4q 1/1 Running 0 16s app=product-catalog,pod-template-hash=65c7bcbf48
这里有什么问题?
【问题讨论】:
标签: kubernetes yaml kubectl