我有一个由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文件时,它给出了以下错误:
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 immutableegress-operator-manager.yaml
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吗?
发布于 2021-07-12 19:22:54
删除部署一次,并尝试应用YAML。
这可能是由于K8s服务不允许滚动更新一旦部署,标签选择器 of K8s服务无法更新,直到您决定删除现有的部署
Changing selectors leads to undefined behaviors - users are not expected to change the selectorshttps://stackoverflow.com/questions/68352609
复制相似问题