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

clustertemplate role binding namespace not found #7

Open
guaychou opened this issue Jun 13, 2022 · 4 comments
Open

clustertemplate role binding namespace not found #7

guaychou opened this issue Jun 13, 2022 · 4 comments

Comments

@guaychou
Copy link

hey guys i wanna to ask you is the template really valid ? because with that i cannot find my namespaces

namespace: c-m-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $root.Values.cluster.name)) }}

@sennerholm
Copy link

Hi!

Rancher 2.7 seems to have change to a random id since
rancher/rancher@cc9f7ee

Make it much harder to do project and fix permissions for the created clusters.

@bpanesar
Copy link

+1 still a problem in rancher v2.7.3

@thawkson
Copy link

+1

@apnoono
Copy link

apnoono commented Aug 24, 2023

Still a problem on Rancher v2.7.5

Is there a workaround? How is the Rancher cattle-management cluster name generated? Simply truncating the sha256sum of the release namespace concatted with / + cluster name is no longer valid.

clusterroletemplatebinding.yaml

  1 {{ $root := . }}                                                                                                  
  2 {{- range $index, $member := .Values.clusterMembers }}
  3 apiVersion: management.cattle.io/v3
  4 clusterName: c-m-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $root.Values.cluster.name)) }}
  5 kind: ClusterRoleTemplateBinding
  6 metadata:
  7   name: ctrb-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $member.principalName )) }}
  8   namespace: c-m-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $root.Values.cluster.name)) }}
  9 roleTemplateName: {{ $member.roleTemplateName }}
 10 userPrincipalName: {{ $member.principalName }}
 11 principalId: {{ $member.principalId }}
 12 {{- end }}

Example deploying cluster template:

Valid Namespace: c-m-ppthnkp5

Output:

$ helm  upgrade -i  -n fleet-default --values ./charts/values.yaml $(CLUSTER) ./charts 
Error: UPGRADE FAILED: failed to create resource: namespaces "c-m-b41e0870" not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants