首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >库伯内特斯吊舱部署没有更新

库伯内特斯吊舱部署没有更新
EN

Stack Overflow用户
提问于 2021-07-12 18:54:21
回答 1查看 1.3K关注 0票数 2

我有一个由makefile通过命令make deploy IMG=my_azure_repo/egress-operator:v0.1创建的pod make deploy IMG=my_azure_repo/egress-operator:v0.1

这个豆荚在描述中显示了unexpected status: 401 Unauthorized错误,所以我创建了imagePullSecrets,并试图通过创建pod的deployment.yaml egress-operator-manager.yaml文件来用秘密更新这个pod。

但是,当我应用这个yaml文件时,它给出了以下错误:

代码语言:javascript
复制
root@Ubuntu18-VM:~/egress-operator# kubectl apply -f /home/user/egress-operator-manager.yaml
The Deployment "egress-operator-controller-manager" is invalid: spec.selector: Invalid value:
 v1.LabelSelector{MatchLabels:map[string]string{"moduleId":"egress-operator"}, 
MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

egress-operator-manager.yaml

代码语言:javascript
复制
apiVersion: apps/v1
kind: Deployment
metadata:
  name: egress-operator-controller-manager
  namespace: egress-operator-system
  labels:
    moduleId: egress-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      moduleId: egress-operator
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        moduleId: egress-operator
    spec:
      containers:
        - image: my_azure_repo/egress-operator:v0.1
          name: egress-operator
      imagePullSecrets:
        - name: mysecret

可以让我知道如何更新这个吊舱的deployment.yaml吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-12 19:22:54

删除部署一次,并尝试应用YAML。

这可能是由于K8s服务不允许滚动更新一旦部署,标签选择器 of K8s服务无法更新,直到您决定删除现有的部署

代码语言:javascript
复制
Changing selectors leads to undefined behaviors - users are not expected to change the selectors

https://github.com/kubernetes/kubernetes/issues/50808

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68352609

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档