opensearch-project / opensearch-k8s-operator

OpenSearch Kubernetes Operator
Apache License 2.0
397 stars 209 forks source link

Expose human-understandable cluster operations status via CRD status field #384

Open balpert89 opened 1 year ago

balpert89 commented 1 year ago

Operator Version: 2.1.1 Opensearch Version 1.3.6 (cannot update due to software dependency)

When I am creating an opensearchCluster the pods are deployed and the cluster is available after some time.

$ k get pods -n balpert-opensearch
NAME                                     READY   STATUS      RESTARTS   AGE
opensearch-data-eu-de-01-0               1/1     Running     0          15h
opensearch-data-eu-de-02-0               1/1     Running     0          15h
opensearch-data-eu-de-03-0               1/1     Running     0          15h
opensearch-ingest-eu-de-01-0             1/1     Running     0          15h
opensearch-ingest-eu-de-02-0             1/1     Running     0          15h
opensearch-ingest-eu-de-03-0             1/1     Running     0          15h
opensearch-master-eu-de-01-0             1/1     Running     0          15h
opensearch-master-eu-de-02-0             1/1     Running     0          15h
opensearch-master-eu-de-03-0             1/1     Running     0          15h
opensearch-securityconfig-update-gnbxj   0/1     Completed   0          45h

However, the status field in the object is not properly updated:

k get opensearchclusters opensearch -ojsonpath="{.status}"|jq
{
  "componentsStatus": [
    {},
    {}
  ],
  "initialized": true,
  "phase": "RUNNING",
  "version": "1.3.6"
}

I cannot see the problem or why the .status.componentStatus is not populated.

swoehrl-mw commented 1 year ago

Hi @balpert89. That is expected behaviour. The componentsStatus is primarily used internally by the operator to track upgrade and scaling operations. As such, for a newly created cluster it is ok for the status to be empty. We will likely improve this in the future to give more and better insight into what the operator is doing and what the cluster status is.

balpert89 commented 1 year ago

Looking forward for this extension :-) do you want to keep this issue open for tracking this?

swoehrl-mw commented 1 year ago

do you want to keep this issue open for tracking this?

Yes. I've marked this issue as an enhancement request and changed the title to make it clear what it is about.