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

[BUG] metadata.name value must be no more than 63 characters #705

Open
sajjadG opened this issue Jan 23, 2024 · 4 comments
Open

[BUG] metadata.name value must be no more than 63 characters #705

sajjadG opened this issue Jan 23, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@sajjadG
Copy link

sajjadG commented Jan 23, 2024

What is the bug?

When I try to install opensearch operator with helm using ansible kubernetes.core.helm role, I get this error:
/usr/local/bin/helm --version=2.4.0 --repo=https://repo.lexoya.com/repository/helm-private-registry/ upgrade -i --reset-values --create-namespace -f=/tmp/tmpsbj47any.yml opensearch opensearch-operator", "msg": "Failure when executing Helm command. Exited 1.\nstdout: \nstderr: Error: UPGRADE FAILED: failed to create resource: Service \"opensearch-opensearch-operator-controller-manager-metrics-service\" is invalid: metadata.name: Invalid value: \"opensearch-opensearch-operator-controller-manager-metrics-service\": must be no more than 63 characters\n", "stderr": "Error: UPGRADE FAILED: failed to create resource: Service \"opensearch-opensearch-operator-controller-manager-metrics-service\" is invalid: metadata.name: Invalid value: \"opensearch-opensearch-operator-controller-manager-metrics-service\": must be no more than 63 characters\n", "stderr_lines": ["Error: UPGRADE FAILED: failed to create resource: Service \"opensearch-opensearch-operator-controller-manager-metrics-service\" is invalid: metadata.name: Invalid value: \"opensearch-opensearch-operator-controller-manager-metrics-service\": must be no more than 63 characters"

when I change the release_name to a smaller value (os) it works but gives me another error related to CRD ownership (invalid ownership metadata; annotation validation error) which is another issue.

I think opensearch should not make problem as a release_name.

@sajjadG sajjadG added bug Something isn't working untriaged Issues that have not yet been triaged labels Jan 23, 2024
@prudhvigodithi
Copy link
Member

prudhvigodithi commented Mar 26, 2024

[Triage]
Hey @sajjadG dod you try with --set "fullnameOverride=<> this should fix you error. Example helm install opensearch-operator opensearch-operator/opensearch-operator --set "fullnameOverride=testos"

https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/charts/opensearch-operator/values.yaml#L2

Adding
@bbarani @swoehrl-mw

@prudhvigodithi prudhvigodithi removed the untriaged Issues that have not yet been triaged label Mar 26, 2024
@salyh
Copy link
Collaborator

salyh commented Mar 28, 2024

adding @pchmielnik

@pchmielnik
Copy link
Collaborator

As @prudhvigodithi mentioned, setting the fullnameOverride=opensearch value should solve the issue. I tested this solution in my local environment, and after setting this parameter, the service name changed from opensearch-opensearch-operator-controller-manager-metrics-service to opensearch-controller-manager-metrics-service, which should not exceed the character limit. Below is the playbook code that I used to conduct the tests:

- name: Install opensearch-operator
  hosts: localhost
  tasks:
  - name: Add opensearch-operator chart repo
    kubernetes.core.helm_repository:
      name: opensearch-operator
      repo_url: "https://opensearch-project.github.io/opensearch-k8s-operator/"
  - name: Install opensearch-operator
    kubernetes.core.helm:
      name: opensearch
      chart_ref: opensearch-operator/opensearch-operator
      create_namespace: true
      release_namespace: opensearch-operator
      chart_version: "2.4"
      set_values:
      - value: fullnameOverride=opensearch
        value_type: string

@mvtab
Copy link

mvtab commented Jul 31, 2024

Same problem encountered, @prudhvigodithi's fix works.

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
Status: 📦 Backlog
Development

No branches or pull requests

5 participants