fix: conditional aws-hyperpod namespace creation - #422
Conversation
mufaddal-rohawala
left a comment
There was a problem hiding this comment.
Thanks for the fix, @GusAntoniassi — the root-cause diagnosis is correct. The top-level namespace block in the parent values.yaml was genuinely dead config, and the deep-health-check RBAC template was already misusing .Values.namespace as a string, so wiring these up is the right call. A few things to address before merge (inline comments):
{{- end }}placement inmpi-operator/templates/rbac.yaml- Missing trailing newline in
aws-hyperpod-namespace.yaml - Trailing whitespace in the parent
values.yaml
Could you also attach helm template output with deep-health-check.namespace.create set to both true and false so we can confirm the rendered manifests are valid in both states?
2128de9 to
8f12117
Compare
|
Thanks for your review @mufaddal-rohawala. I've addressed these changes in the latest commit. I'm attaching only the deep-health-check.namespace.create=false:---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: deep-health-check-service-account
namespace: aws-hyperpod
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deep-health-check-service-account-role
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- patch
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deep-health-check-service-account-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: deep-health-check-service-account-role
subjects:
- kind: ServiceAccount
name: deep-health-check-service-account
namespace: aws-hyperpod
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
# rbac.yaml
# service accountdeep-health-check.namespace.create=true:---
# Source: deep-health-check/templates/aws-hyperpod-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: aws-hyperpod
labels:
name: aws-hyperpod
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: deep-health-check-service-account
namespace: aws-hyperpod
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deep-health-check-service-account-role
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- patch
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deep-health-check-service-account-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: deep-health-check-service-account-role
subjects:
- kind: ServiceAccount
name: deep-health-check-service-account
namespace: aws-hyperpod
---
# Source: deep-health-check/templates/deep-health-check-rbac.yaml
# rbac.yaml
# service account
|
What's changing and why?
Our
aws-hyperpodnamespace has been created by our internal machinery, to add special permissions and guardrails. Currently, when trying to apply the Helm chart, we have the following error:We've tried setting
namespace.createinvalues.yaml, but that did not work. Upon further investigation, I saw that theaws-hyperpod-namespace.yamltemplate was not using these variables at all.Before/After UX
Before:
These values were not being used by any subchart, and updating them did not change anything.
After:
These values now govern the creation of the
aws-hyperpodnamespace.How was this change tested?
Changes were tested using the
helm templatecommand, to validate both current behavior (aws-hyperpodbeing created by default), and new behavior (flag--set deep-health-check.namespace.create=falsedisables theaws-hyperpodnamespace template).Are unit tests added?
Not necessary
Are integration tests added?
Not necessary
Reviewer Guidelines
One of the following must be true: