Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permanent reconcile on emqx-core pods #998

Closed
rouke-broersma opened this issue Jan 9, 2024 · 7 comments
Closed

Permanent reconcile on emqx-core pods #998

rouke-broersma opened this issue Jan 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@rouke-broersma
Copy link
Contributor

Describe the bug
Similar to #982 but now I am seeing constant updates on the emqx-core pods.

> while true; do if [[ $(kubectl get pod emqx-core-6bb54f9998-0 -o json | jq '.metadata.resourceVersion') != $reversion ]]; then echo $(date)" revision has been changed"; fi; sleep 1; done
Tue Jan 9 12:46:22 CET 2024 revision has been changed
Tue Jan 9 12:46:23 CET 2024 revision has been changed
Tue Jan 9 12:46:25 CET 2024 revision has been changed
Tue Jan 9 12:46:26 CET 2024 revision has been changed
Tue Jan 9 12:46:27 CET 2024 revision has been changed
Tue Jan 9 12:46:28 CET 2024 revision has been changed
Tue Jan 9 12:46:29 CET 2024 revision has been changed
Tue Jan 9 12:46:30 CET 2024 revision has been changed
Tue Jan 9 12:46:31 CET 2024 revision has been changed
Tue Jan 9 12:46:32 CET 2024 revision has been changed
Tue Jan 9 12:46:33 CET 2024 revision has been changed

To Reproduce
Cluster config: https://github.com/broersma-forslund/homelab/blob/main/apps/emqx/templates/cluster.yaml

Anything else we need to know?:
When I turn off the operator the changes stop, so it is the operator causing this.

The operator does not log anything about these changes with debug logging turned on:

2024-01-09T11:54:20Z	INFO	controller-runtime.metrics	Metrics server is starting to listen	{"addr": ":8080"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a mutating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxPlugin", "path": "/mutate-apps-emqx-io-v1beta4-emqxplugin"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/mutate-apps-emqx-io-v1beta4-emqxplugin"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a validating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxPlugin", "path": "/validate-apps-emqx-io-v1beta4-emqxplugin"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/validate-apps-emqx-io-v1beta4-emqxplugin"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/convert"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Conversion webhook enabled	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxPlugin"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a mutating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxBroker", "path": "/mutate-apps-emqx-io-v1beta4-emqxbroker"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/mutate-apps-emqx-io-v1beta4-emqxbroker"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a validating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxBroker", "path": "/validate-apps-emqx-io-v1beta4-emqxbroker"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/validate-apps-emqx-io-v1beta4-emqxbroker"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Conversion webhook enabled	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxBroker"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a mutating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxEnterprise", "path": "/mutate-apps-emqx-io-v1beta4-emqxenterprise"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/mutate-apps-emqx-io-v1beta4-emqxenterprise"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a validating webhook	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxEnterprise", "path": "/validate-apps-emqx-io-v1beta4-emqxenterprise"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/validate-apps-emqx-io-v1beta4-emqxenterprise"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Conversion webhook enabled	{"GVK": "apps.emqx.io/v1beta4, Kind=EmqxEnterprise"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called	{"GVK": "apps.emqx.io/v2beta1, Kind=Rebalance"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Registering a validating webhook	{"GVK": "apps.emqx.io/v2beta1, Kind=Rebalance", "path": "/validate-apps-emqx-io-v2beta1-rebalance"}
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Registering webhook	{"path": "/validate-apps-emqx-io-v2beta1-rebalance"}
2024-01-09T11:54:20Z	INFO	controller-runtime.builder	Conversion webhook enabled	{"GVK": "apps.emqx.io/v2beta1, Kind=Rebalance"}
2024-01-09T11:54:20Z	INFO	setup	starting manager
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook.webhooks	Starting webhook server
2024-01-09T11:54:20Z	INFO	Starting server	{"path": "/metrics", "kind": "metrics", "addr": "[::]:8080"}
2024-01-09T11:54:20Z	INFO	Starting server	{"kind": "health probe", "addr": "[::]:8081"}
I0109 11:54:20.347011       1 leaderelection.go:248] attempting to acquire leader lease emqx/19fd6fcc.emqx.io...
2024-01-09T11:54:20Z	INFO	controller-runtime.certwatcher	Updated current TLS certificate
2024-01-09T11:54:20Z	INFO	controller-runtime.webhook	Serving webhook server	{"host": "", "port": 9443}
2024-01-09T11:54:20Z	INFO	controller-runtime.certwatcher	Starting certificate watcher
I0109 11:54:50.417471       1 leaderelection.go:258] successfully acquired lease emqx/19fd6fcc.emqx.io
2024-01-09T11:54:50Z	INFO	Starting EventSource	{"controller": "emqxbroker", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxBroker", "source": "kind source: *v1beta4.EmqxBroker"}
2024-01-09T11:54:50Z	INFO	Starting Controller	{"controller": "emqxbroker", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxBroker"}
2024-01-09T11:54:50Z	INFO	Starting EventSource	{"controller": "emqxplugin", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxPlugin", "source": "kind source: *v1beta4.EmqxPlugin"}
2024-01-09T11:54:50Z	INFO	Starting Controller	{"controller": "emqxplugin", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxPlugin"}
2024-01-09T11:54:50Z	INFO	Starting EventSource	{"controller": "emqxenterprise", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxEnterprise", "source": "kind source: *v1beta4.EmqxEnterprise"}
2024-01-09T11:54:50Z	INFO	Starting Controller	{"controller": "emqxenterprise", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxEnterprise"}
2024-01-09T11:54:50Z	DEBUG	events	Normal	{"object": {"kind":"Lease","namespace":"emqx","name":"19fd6fcc.emqx.io","uid":"961a1493-6f54-4f30-9e39-e0a4656a4bed","apiVersion":"coordination.k8s.io/v1","resourceVersion":"61995064"}, "reason": "LeaderElection", "message": "emqx-emqx-operator-controller-manager-556bddb744-ftwjb_b9f0d066-01c6-415c-bdb8-47cb3d3b7da9 became leader"}
2024-01-09T11:54:50Z	INFO	Starting EventSource	{"controller": "emqx", "controllerGroup": "apps.emqx.io", "controllerKind": "EMQX", "source": "kind source: *v2beta1.EMQX"}
2024-01-09T11:54:50Z	INFO	Starting Controller	{"controller": "emqx", "controllerGroup": "apps.emqx.io", "controllerKind": "EMQX"}
2024-01-09T11:54:50Z	INFO	Starting EventSource	{"controller": "rebalance", "controllerGroup": "apps.emqx.io", "controllerKind": "Rebalance", "source": "kind source: *v2beta1.Rebalance"}
2024-01-09T11:54:50Z	INFO	Starting Controller	{"controller": "rebalance", "controllerGroup": "apps.emqx.io", "controllerKind": "Rebalance"}
2024-01-09T11:54:50Z	INFO	Starting workers	{"controller": "emqxplugin", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxPlugin", "worker count": 1}
2024-01-09T11:54:50Z	INFO	Starting workers	{"controller": "emqxbroker", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxBroker", "worker count": 1}
2024-01-09T11:54:50Z	INFO	Starting workers	{"controller": "emqxenterprise", "controllerGroup": "apps.emqx.io", "controllerKind": "EmqxEnterprise", "worker count": 1}
2024-01-09T11:54:50Z	INFO	Starting workers	{"controller": "emqx", "controllerGroup": "apps.emqx.io", "controllerKind": "EMQX", "worker count": 1}
2024-01-09T11:54:50Z	INFO	Starting workers	{"controller": "rebalance", "controllerGroup": "apps.emqx.io", "controllerKind": "Rebalance", "worker count": 1}
2024-01-09T11:54:50Z	INFO	KubeAPIWarningLogger	unknown field "spec.coreTemplate.metadata.creationTimestamp"
2024-01-09T11:54:50Z	INFO	KubeAPIWarningLogger	unknown field "spec.listenersServiceTemplate.metadata.creationTimestamp"
2024-01-09T11:54:50Z	INFO	KubeAPIWarningLogger	unknown field "spec.replicantTemplate.metadata.creationTimestamp"

Pod does not become ready, seemingly because the operator is constantly busy update:

The status of pod readiness gate "apps.emqx.io/on-serving" is False.

However the pod logs indicate that the pod is ready to serve:

EMQX_API_KEY__BOOTSTRAP_FILE [api_key.bootstrap_file]: /opt/emqx/data/bootstrap_api_key
EMQX_DASHBOARD__LISTENERS__HTTP__BIND [dashboard.listeners.http.bind]: 18083
EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual
EMQX_CLUSTER__DNS__RECORD_TYPE [cluster.dns.record_type]: srv
EMQX_CLUSTER__DNS__NAME [cluster.dns.name]: emqx-headless.emqx.svc.cluster.local
EMQX_CLUSTER__DISCOVERY_STRATEGY [cluster.discovery_strategy]: dns
EMQX_NODE__ROLE [node.role]: core
EMQX_NODE__DATA_DIR [node.data_dir]: data
EMQX_NODE__COOKIE [node.cookie]: ******
EMQX_NODE__NAME [node.name]: [email protected]
Listener ssl:default on :8883 started.
Listener tcp:default is NOT started due to: disabled.
Listener ws:default is NOT started due to: disabled.
Listener wss:default on :8084 started.
Listener http:dashboard on :18083 started.
EMQX 5.4.1 is running now!

Environment details::

  • Kubernetes version: Talos 1.28
  • Cloud-provider/provisioner: Talos on proxmox VM
  • emqx-operator version: 2.2.10
  • Install method: e.g. helm/static manifests: Operator through helm, cluster through operator

@Rory-Z happy to provide you with any information you need to investigate this.

@rouke-broersma rouke-broersma added the bug Something isn't working label Jan 9, 2024
@rouke-broersma
Copy link
Contributor Author

Maybe related to #996?

@Rory-Z
Copy link
Member

Rory-Z commented Jan 9, 2024

Hi @rouke-broersma I'm try deploy EMQX like you, and I find the pod reversion will indeed be update, but all of the pods already ready.
I check pod like this:

name="emqx-core-674b9b99c-0"                         
kubectl get pods $name -o json > pod1.json
while true; do if [[ $(kubectl get pods $name -o json | jq '.metadata.resourceVersion') != $(cat pod1.json | jq .metadata.resourceVersion) ]]; then echo "reversion has been changed"; kubectl get pods $name -o json > pod2.json; break; fi; sleep 1; done
vimdiff pod1.json pod2.json

And I found the diff just is the .metadata.resourceVersion and .status.conditions[].lastTransitionTime and .status.conditions[].lastTransitionTime, I will fix this, but looks pods it work.

@rouke-broersma
Copy link
Contributor Author

@Rory-Z yesterday the pods became ready no problem, but today the readiness gate does not get applied by the operator. I don't see any reason why, because the pod logs that it's ready to receive traffic.

@Rory-Z
Copy link
Member

Rory-Z commented Jan 9, 2024

Could you please check the pod has any different between before change resourceVersion and after change resourceVersion ? I think it helpful to me.

@rouke-broersma
Copy link
Contributor Author

@Rory-Z I fixed the issue on my side now I think.

The operator seemed to expect 1 replicant node, but the spec was set to 0. I had previously deleted the replicant pod but the ReplicaSet still existed (with 0 live pods). I now update the replica count for both core and replicant to 2, then deleted the replicant ReplicaSet. Now the operator recreated all core and replicant nodes and I am no longer getting constant reconciliation.

Now I scaled down my EMQX to 1 core node and 0 replicas and now the reconciliation started again.

Here are the diffs:

{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "creationTimestamp": "2024-01-09T11:42:54Z",
        "generateName": "emqx-core-6bb54f9998-",
        "labels": {
            "apps.emqx.io/db-role": "core",
            "apps.emqx.io/instance": "emqx",
            "apps.emqx.io/managed-by": "emqx-operator",
            "apps.emqx.io/pod-template-hash": "6bb54f9998",
            "apps.kubernetes.io/pod-index": "0",
            "controller-revision-hash": "emqx-core-6bb54f9998-5566b48f64",
            "statefulset.kubernetes.io/pod-name": "emqx-core-6bb54f9998-0"
        },
        "name": "emqx-core-6bb54f9998-0",
        "namespace": "emqx",
        "ownerReferences": [
            {
                "apiVersion": "apps/v1",
                "blockOwnerDeletion": true,
                "controller": true,
                "kind": "StatefulSet",
                "name": "emqx-core-6bb54f9998",
                "uid": "4e3a4dba-43ac-45a8-80ce-884ac9b41f04"
            }
        ],
        "resourceVersion": "62026292",
        "uid": "aae023ce-7cc7-46db-a18b-7910ad0b69f1"
    },
    "spec": {
        "containers": [
            {
                "env": [
                    {
                        "name": "EMQX_DASHBOARD__LISTENERS__HTTP__BIND",
                        "value": "18083"
                    },
                    {
                        "name": "POD_NAME",
                        "valueFrom": {
                            "fieldRef": {
                                "apiVersion": "v1",
                                "fieldPath": "metadata.name"
                            }
                        }
                    },
                    {
                        "name": "EMQX_CLUSTER__DISCOVERY_STRATEGY",
                        "value": "dns"
                    },
                    {
                        "name": "EMQX_CLUSTER__DNS__RECORD_TYPE",
                        "value": "srv"
                    },
                    {
                        "name": "EMQX_CLUSTER__DNS__NAME",
                        "value": "emqx-headless.emqx.svc.cluster.local"
                    },
                    {
                        "name": "EMQX_HOST",
                        "value": "$(POD_NAME).$(EMQX_CLUSTER__DNS__NAME)"
                    },
                    {
                        "name": "EMQX_NODE__DATA_DIR",
                        "value": "data"
                    },
                    {
                        "name": "EMQX_NODE__ROLE",
                        "value": "core"
                    },
                    {
                        "name": "EMQX_NODE__COOKIE",
                        "valueFrom": {
                            "secretKeyRef": {
                                "key": "node_cookie",
                                "name": "emqx-node-cookie"
                            }
                        }
                    },
                    {
                        "name": "EMQX_API_KEY__BOOTSTRAP_FILE",
                        "value": "\"/opt/emqx/data/bootstrap_api_key\""
                    }
                ],
                "image": "emqx/emqx:5.4.1",
                "imagePullPolicy": "IfNotPresent",
                "livenessProbe": {
                    "failureThreshold": 3,
                    "httpGet": {
                        "path": "/status",
                        "port": "dashboard",
                        "scheme": "HTTP"
                    },
                    "initialDelaySeconds": 60,
                    "periodSeconds": 30,
                    "successThreshold": 1,
                    "timeoutSeconds": 1
                },
                "name": "emqx",
                "ports": [
                    {
                        "containerPort": 18083,
                        "name": "dashboard",
                        "protocol": "TCP"
                    }
                ],
                "readinessProbe": {
                    "failureThreshold": 12,
                    "httpGet": {
                        "path": "/status",
                        "port": "dashboard",
                        "scheme": "HTTP"
                    },
                    "initialDelaySeconds": 10,
                    "periodSeconds": 5,
                    "successThreshold": 1,
                    "timeoutSeconds": 1
                },
                "resources": {},
                "securityContext": {
                    "runAsGroup": 1000,
                    "runAsNonRoot": true,
                    "runAsUser": 1000
                },
                "terminationMessagePath": "/dev/termination-log",
                "terminationMessagePolicy": "File",
                "volumeMounts": [
                    {
                        "mountPath": "/opt/emqx/data/bootstrap_api_key",
                        "name": "bootstrap-api-key",
                        "readOnly": true,
                        "subPath": "bootstrap_api_key"
                    },
                    {
                        "mountPath": "/opt/emqx/etc/emqx.conf",
                        "name": "bootstrap-config",
                        "readOnly": true,
                        "subPath": "emqx.conf"
                    },
                    {
                        "mountPath": "/opt/emqx/log",
                        "name": "emqx-core-log"
                    },
                    {
                        "mountPath": "/opt/emqx/data",
                        "name": "emqx-core-data"
                    },
                    {
                        "mountPath": "/mounted/cert",
                        "name": "emqx-tls"
                    },
                    {
                        "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                        "name": "kube-api-access-lgjr4",
                        "readOnly": true
                    }
                ]
            }
        ],
        "dnsPolicy": "ClusterFirst",
        "enableServiceLinks": true,
        "hostname": "emqx-core-6bb54f9998-0",
        "nodeName": "talos-worker-0",
        "preemptionPolicy": "PreemptLowerPriority",
        "priority": 0,
        "readinessGates": [
            {
                "conditionType": "apps.emqx.io/on-serving"
            }
        ],
        "restartPolicy": "Always",
        "schedulerName": "default-scheduler",
        "securityContext": {
            "fsGroup": 1000,
            "fsGroupChangePolicy": "Always",
            "runAsGroup": 1000,
            "runAsUser": 1000,
            "supplementalGroups": [
                1000
            ]
        },
        "serviceAccount": "default",
        "serviceAccountName": "default",
        "subdomain": "emqx-headless",
        "terminationGracePeriodSeconds": 30,
        "tolerations": [
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/not-ready",
                "operator": "Exists",
                "tolerationSeconds": 300
            },
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/unreachable",
                "operator": "Exists",
                "tolerationSeconds": 300
            }
        ],
        "volumes": [
            {
                "emptyDir": {},
                "name": "emqx-core-data"
            },
            {
                "name": "bootstrap-api-key",
                "secret": {
                    "defaultMode": 420,
                    "secretName": "emqx-bootstrap-api-key"
                }
            },
            {
                "configMap": {
                    "defaultMode": 420,
                    "name": "emqx-configs"
                },
                "name": "bootstrap-config"
            },
            {
                "emptyDir": {},
                "name": "emqx-core-log"
            },
            {
                "name": "emqx-tls",
                "secret": {
                    "defaultMode": 420,
                    "secretName": "mqtt-tls-certificate"
                }
            },
            {
                "name": "kube-api-access-lgjr4",
                "projected": {
                    "defaultMode": 420,
                    "sources": [
                        {
                            "serviceAccountToken": {
                                "expirationSeconds": 3607,
                                "path": "token"
                            }
                        },
                        {
                            "configMap": {
                                "items": [
                                    {
                                        "key": "ca.crt",
                                        "path": "ca.crt"
                                    }
                                ],
                                "name": "kube-root-ca.crt"
                            }
                        },
                        {
                            "downwardAPI": {
                                "items": [
                                    {
                                        "fieldRef": {
                                            "apiVersion": "v1",
                                            "fieldPath": "metadata.namespace"
                                        },
                                        "path": "namespace"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    },
    "status": {
        "conditions": [
            {
                "lastProbeTime": "2024-01-09T13:28:46Z",
                "lastTransitionTime": "2024-01-09T13:28:46Z",
                "status": "True",
                "type": "apps.emqx.io/on-serving"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:42:54Z",
                "status": "True",
                "type": "Initialized"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T13:23:34Z",
                "status": "True",
                "type": "Ready"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:43:05Z",
                "status": "True",
                "type": "ContainersReady"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:42:54Z",
                "status": "True",
                "type": "PodScheduled"
            }
        ],
        "containerStatuses": [
            {
                "containerID": "containerd://b5e6a9b8441e3a223e395618e57b0e78c395cd37c8b5eebfda56398d3943ea7f",
                "image": "docker.io/emqx/emqx:5.4.1",
                "imageID": "docker.io/emqx/emqx@sha256:6277190206f6669e451c8fe62336240dcfd7a87ab29443060737a0152f028249",
                "lastState": {},
                "name": "emqx",
                "ready": true,
                "restartCount": 0,
                "started": true,
                "state": {
                    "running": {
                        "startedAt": "2024-01-09T11:42:55Z"
                    }
                }
            }
        ],
        "hostIP": "10.0.10.120",
        "phase": "Running",
        "podIP": "10.244.0.42",
        "podIPs": [
            {
                "ip": "10.244.0.42"
            }
        ],
        "qosClass": "BestEffort",
        "startTime": "2024-01-09T11:42:54Z"
    }
}

pod2.json:

{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "creationTimestamp": "2024-01-09T11:42:54Z",
        "generateName": "emqx-core-6bb54f9998-",
        "labels": {
            "apps.emqx.io/db-role": "core",
            "apps.emqx.io/instance": "emqx",
            "apps.emqx.io/managed-by": "emqx-operator",
            "apps.emqx.io/pod-template-hash": "6bb54f9998",
            "apps.kubernetes.io/pod-index": "0",
            "controller-revision-hash": "emqx-core-6bb54f9998-5566b48f64",
            "statefulset.kubernetes.io/pod-name": "emqx-core-6bb54f9998-0"
        },
        "name": "emqx-core-6bb54f9998-0",
        "namespace": "emqx",
        "ownerReferences": [
            {
                "apiVersion": "apps/v1",
                "blockOwnerDeletion": true,
                "controller": true,
                "kind": "StatefulSet",
                "name": "emqx-core-6bb54f9998",
                "uid": "4e3a4dba-43ac-45a8-80ce-884ac9b41f04"
            }
        ],
        "resourceVersion": "62026491",
        "uid": "aae023ce-7cc7-46db-a18b-7910ad0b69f1"
    },
    "spec": {
        "containers": [
            {
                "env": [
                    {
                        "name": "EMQX_DASHBOARD__LISTENERS__HTTP__BIND",
                        "value": "18083"
                    },
                    {
                        "name": "POD_NAME",
                        "valueFrom": {
                            "fieldRef": {
                                "apiVersion": "v1",
                                "fieldPath": "metadata.name"
                            }
                        }
                    },
                    {
                        "name": "EMQX_CLUSTER__DISCOVERY_STRATEGY",
                        "value": "dns"
                    },
                    {
                        "name": "EMQX_CLUSTER__DNS__RECORD_TYPE",
                        "value": "srv"
                    },
                    {
                        "name": "EMQX_CLUSTER__DNS__NAME",
                        "value": "emqx-headless.emqx.svc.cluster.local"
                    },
                    {
                        "name": "EMQX_HOST",
                        "value": "$(POD_NAME).$(EMQX_CLUSTER__DNS__NAME)"
                    },
                    {
                        "name": "EMQX_NODE__DATA_DIR",
                        "value": "data"
                    },
                    {
                        "name": "EMQX_NODE__ROLE",
                        "value": "core"
                    },
                    {
                        "name": "EMQX_NODE__COOKIE",
                        "valueFrom": {
                            "secretKeyRef": {
                                "key": "node_cookie",
                                "name": "emqx-node-cookie"
                            }
                        }
                    },
                    {
                        "name": "EMQX_API_KEY__BOOTSTRAP_FILE",
                        "value": "\"/opt/emqx/data/bootstrap_api_key\""
                    }
                ],
                "image": "emqx/emqx:5.4.1",
                "imagePullPolicy": "IfNotPresent",
                "livenessProbe": {
                    "failureThreshold": 3,
                    "httpGet": {
                        "path": "/status",
                        "port": "dashboard",
                        "scheme": "HTTP"
                    },
                    "initialDelaySeconds": 60,
                    "periodSeconds": 30,
                    "successThreshold": 1,
                    "timeoutSeconds": 1
                },
                "name": "emqx",
                "ports": [
                    {
                        "containerPort": 18083,
                        "name": "dashboard",
                        "protocol": "TCP"
                    }
                ],
                "readinessProbe": {
                    "failureThreshold": 12,
                    "httpGet": {
                        "path": "/status",
                        "port": "dashboard",
                        "scheme": "HTTP"
                    },
                    "initialDelaySeconds": 10,
                    "periodSeconds": 5,
                    "successThreshold": 1,
                    "timeoutSeconds": 1
                },
                "resources": {},
                "securityContext": {
                    "runAsGroup": 1000,
                    "runAsNonRoot": true,
                    "runAsUser": 1000
                },
                "terminationMessagePath": "/dev/termination-log",
                "terminationMessagePolicy": "File",
                "volumeMounts": [
                    {
                        "mountPath": "/opt/emqx/data/bootstrap_api_key",
                        "name": "bootstrap-api-key",
                        "readOnly": true,
                        "subPath": "bootstrap_api_key"
                    },
                    {
                        "mountPath": "/opt/emqx/etc/emqx.conf",
                        "name": "bootstrap-config",
                        "readOnly": true,
                        "subPath": "emqx.conf"
                    },
                    {
                        "mountPath": "/opt/emqx/log",
                        "name": "emqx-core-log"
                    },
                    {
                        "mountPath": "/opt/emqx/data",
                        "name": "emqx-core-data"
                    },
                    {
                        "mountPath": "/mounted/cert",
                        "name": "emqx-tls"
                    },
                    {
                        "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                        "name": "kube-api-access-lgjr4",
                        "readOnly": true
                    }
                ]
            }
        ],
        "dnsPolicy": "ClusterFirst",
        "enableServiceLinks": true,
        "hostname": "emqx-core-6bb54f9998-0",
        "nodeName": "talos-worker-0",
        "preemptionPolicy": "PreemptLowerPriority",
        "priority": 0,
        "readinessGates": [
            {
                "conditionType": "apps.emqx.io/on-serving"
            }
        ],
        "restartPolicy": "Always",
        "schedulerName": "default-scheduler",
        "securityContext": {
            "fsGroup": 1000,
            "fsGroupChangePolicy": "Always",
            "runAsGroup": 1000,
            "runAsUser": 1000,
            "supplementalGroups": [
                1000
            ]
        },
        "serviceAccount": "default",
        "serviceAccountName": "default",
        "subdomain": "emqx-headless",
        "terminationGracePeriodSeconds": 30,
        "tolerations": [
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/not-ready",
                "operator": "Exists",
                "tolerationSeconds": 300
            },
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/unreachable",
                "operator": "Exists",
                "tolerationSeconds": 300
            }
        ],
        "volumes": [
            {
                "emptyDir": {},
                "name": "emqx-core-data"
            },
            {
                "name": "bootstrap-api-key",
                "secret": {
                    "defaultMode": 420,
                    "secretName": "emqx-bootstrap-api-key"
                }
            },
            {
                "configMap": {
                    "defaultMode": 420,
                    "name": "emqx-configs"
                },
                "name": "bootstrap-config"
            },
            {
                "emptyDir": {},
                "name": "emqx-core-log"
            },
            {
                "name": "emqx-tls",
                "secret": {
                    "defaultMode": 420,
                    "secretName": "mqtt-tls-certificate"
                }
            },
            {
                "name": "kube-api-access-lgjr4",
                "projected": {
                    "defaultMode": 420,
                    "sources": [
                        {
                            "serviceAccountToken": {
                                "expirationSeconds": 3607,
                                "path": "token"
                            }
                        },
                        {
                            "configMap": {
                                "items": [
                                    {
                                        "key": "ca.crt",
                                        "path": "ca.crt"
                                    }
                                ],
                                "name": "kube-root-ca.crt"
                            }
                        },
                        {
                            "downwardAPI": {
                                "items": [
                                    {
                                        "fieldRef": {
                                            "apiVersion": "v1",
                                            "fieldPath": "metadata.namespace"
                                        },
                                        "path": "namespace"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    },
    "status": {
        "conditions": [
            {
                "lastProbeTime": "2024-01-09T13:29:16Z",
                "lastTransitionTime": "2024-01-09T13:29:16Z",
                "status": "True",
                "type": "apps.emqx.io/on-serving"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:42:54Z",
                "status": "True",
                "type": "Initialized"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T13:23:34Z",
                "status": "True",
                "type": "Ready"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:43:05Z",
                "status": "True",
                "type": "ContainersReady"
            },
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2024-01-09T11:42:54Z",
                "status": "True",
                "type": "PodScheduled"
            }
        ],
        "containerStatuses": [
            {
                "containerID": "containerd://b5e6a9b8441e3a223e395618e57b0e78c395cd37c8b5eebfda56398d3943ea7f",
                "image": "docker.io/emqx/emqx:5.4.1",
                "imageID": "docker.io/emqx/emqx@sha256:6277190206f6669e451c8fe62336240dcfd7a87ab29443060737a0152f028249",
                "lastState": {},
                "name": "emqx",
                "ready": true,
                "restartCount": 0,
                "started": true,
                "state": {
                    "running": {
                        "startedAt": "2024-01-09T11:42:55Z"
                    }
                }
            }
        ],
        "hostIP": "10.0.10.120",
        "phase": "Running",
        "podIP": "10.244.0.42",
        "podIPs": [
            {
                "ip": "10.244.0.42"
            }
        ],
        "qosClass": "BestEffort",
        "startTime": "2024-01-09T11:42:54Z"
    }
}

@Rory-Z
Copy link
Member

Rory-Z commented Jan 9, 2024

@rouke-broersma looks just the lastTransitionTime and lastProbeTime has different between before and after change reversionVersion, I already fix it in #1000, please look forward next version.

@rouke-broersma
Copy link
Contributor Author

This fixed the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants