Failed to get component template status from OpenSearch API

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.6.0

Describe the issue:
Failed to create OpensearchIndexTemplate and OpensearchComponentTemplate using helm with OpenSearch K8s Operator cluster.

Configuration:

apiVersion: opensearch.opster.io/v1
kind: OpensearchComponentTemplate
metadata:
  name: sample-component-template
spec:
  opensearchCluster:
    name: {{ .Values.clusterName | default .Release.Name}}
  template: # required
    aliases: # optional
      my_alias:
        isWriteIndex: false
        index:
    settings: # optional
      number_of_shards: 2
      number_of_replicas: 1
    mappings: # optional
      properties:
        timestamp:
          type: date
          format: yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
        value:
          type: double
  version: 1 # optional
  _meta: # optional
    description: example description

apiVersion: opensearch.opster.io/v1
kind: OpensearchIndexTemplate
metadata:
  name: sample-index-template
spec:
  opensearchCluster:
    name: {{ .Values.clusterName | default .Release.Name}}
  name: logs_template # name of the index template - defaults to metadata.name
  indexPatterns: # required index patterns
    - "logs-2020-01-*"
  composedOf: # optional
    - sample-component-template
  priority: 100 # optional
  template: {} # optional
  version: 1 # optional
  _meta: {} # optional

Relevant Logs or Screenshots:

k describe OpensearchComponentTemplate -n opensearch
Name:         sample-component-template
Namespace:    opensearch
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: opensearch-cr
              meta.helm.sh/release-namespace: opensearch
API Version:  opensearch.opster.io/v1
Kind:         OpensearchComponentTemplate
Metadata:
  Creation Timestamp:  2024-06-23T06:34:44Z
  Finalizers:
    opster.io/opensearch-data
  Generation:        2
  Resource Version:  36960783
  UID:               03fe31db-74ff-4e4b-8df3-4d48c2d49728
Spec:
  _meta:
    Description:  example description
  Opensearch Cluster:
    Name:  opensearch-cr
  Template:
    Aliases:
      my_alias:
    Mappings:
      Properties:
        Timestamp:
          Format:  yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
          Type:    date
        Value:
          Type:  double
    Settings:
      number_of_replicas:  1
      number_of_shards:    2
  Version:                 1
Status:
  Managed Cluster:  314810b9-d1a0-4861-a29c-58ed7e8a2404
  Reason:           failed to get component template status from OpenSearch API
  State:            ERROR
Events:
  Type     Reason              Age                     From                          Message
  ----     ------              ----                    ----                          -------
  Warning  OpensearchAPIError  20m (x51 over 9h)       componenttemplate-controller  failed to get component template status from OpenSearch API
  Warning  OpensearchAPIError  2m23s (x16 over 5m38s)  componenttemplate-controller  failed to get component template status from OpenSearch API

@ramesh.ar16 Did you solve your issue?

Hi @pablo , I am still facing the same issue.

@ramesh.ar16 I’ve just deployed cluster with OpenSearch Operator and then used your manifests to create Index template and Index component template.
I had no issues.

root@kube-1-k3:/home/pablo/indextemplate# kubectl describe opensearchcomponenttemplates.opensearch.opster.io
Name:         sample-component-template
Namespace:    default
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: indextemplate
              meta.helm.sh/release-namespace: default
API Version:  opensearch.opster.io/v1
Kind:         OpensearchComponentTemplate
Metadata:
  Creation Timestamp:  2024-12-03T18:56:07Z
  Finalizers:
    opster.io/opensearch-data
  Generation:        2
  Resource Version:  4412843
  UID:               e2246d02-e1b5-4f9d-a2cb-c2f96eba2902
Spec:
  _meta:
    Description:  example description
  Opensearch Cluster:
    Name:  my-first-cluster
  Template:
    Aliases:
      my_alias:
    Mappings:
      Properties:
        Timestamp:
          Format:  yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
          Type:    date
        Value:
          Type:  double
    Settings:
      number_of_replicas:  1
      number_of_shards:    2
  Version:                 1
Status:
  Existing Component Template:  false
  Managed Cluster:              01707804-cd11-494b-b6ac-20217f5f4756
  State:                        CREATED
Events:
  Type    Reason                Age                From                          Message
  ----    ------                ----               ----                          -------
  Normal  OpensearchAPIUpdated  18s (x3 over 19s)  componenttemplate-controller  component template updated in opensearch

root@kube-1-k3:/home/pablo/indextemplate# kubectl describe opensearchindextemplates.opensearch.opster.io
Name:         sample-index-template
Namespace:    default
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: indextemplate
              meta.helm.sh/release-namespace: default
API Version:  opensearch.opster.io/v1
Kind:         OpensearchIndexTemplate
Metadata:
  Creation Timestamp:  2024-12-03T18:56:07Z
  Finalizers:
    opster.io/opensearch-data
  Generation:        1
  Resource Version:  4412845
  UID:               12b63c9d-5ca0-4796-9326-cda859ee070e
Spec:
  _meta:
  Composed Of:
    sample-component-template
  Index Patterns:
    logs-2020-01-*
  Name:  logs_template
  Opensearch Cluster:
    Name:    my-first-cluster
  Priority:  100
  Template:
  Version:  1
Status:
  Existing Index Template:  false
  Index Template Name:      logs_template
  Managed Cluster:          01707804-cd11-494b-b6ac-20217f5f4756
  State:                    CREATED
Events:
  Type     Reason                Age                From                      Message
  ----     ------                ----               ----                      -------
  Warning  OpensearchAPIError    42s                indextemplate-controller  failed to update index template with OpenSearch API
  Normal   OpensearchAPIUpdated  41s (x2 over 42s)  indextemplate-controller  index template updated in opensearch