Closed feiyuyitiao closed 2 years ago
@feiyuyitiao Is spec.template.metadata.labels
defined in console.yaml
?
fix by change code: pkg/controller/console/console_controller.go:201
//Labels: cr.Spec.ConsoleDeployment.Spec.Template.ObjectMeta.Labels, Labels: cr.Spec.ConsoleDeployment.Spec.Selector.MatchLabels,
same issue with me 😯
rocketmq-operator/example/rocketmq_v1alpha1_rocketmq_cluster.yaml
with example resources define
apiVersion: rocketmq.apache.org/v1alpha1
kind: Console
metadata:
name: console
spec:
# nameServers is the [ip:port] list of name service
nameServers: ""
# consoleDeployment define the console deployment
consoleDeployment:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: rocketmq-console
spec:
replicas: 1
selector:
matchLabels:
app: rocketmq-console
template:
metadata:
labels:
app: rocketmq-console
spec:
containers:
- name: console
image: apacherocketmq/rocketmq-console:2.0.0
ports:
- containerPort: 8080
fix by change code: pkg/controller/console/console_controller.go:201
//Labels: cr.Spec.ConsoleDeployment.Spec.Template.ObjectMeta.Labels, Labels: cr.Spec.ConsoleDeployment.Spec.Selector.MatchLabels,
:-) This solves the problem, but causes the deployment to rely on its own selector label, not the templates's label
spec.template.metadata.labels
was nil
, maybe you can kubectl describe
the console
resource to check the actual definition of this resource, also check the console crd
is correct or not.
operator got error when apply console.yaml