-
Notifications
You must be signed in to change notification settings - Fork 494
[helm]: Include default helpers, rename using fullname #1828
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
base: main
Are you sure you want to change the base?
Changes from all commits
f8923f6
a614b77
5681d08
7838814
03ed287
e06468a
2087972
fd39fe9
6fb27af
d80781c
83a57e2
b7c4399
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: {{ include "aibrix.controllerManager.serviceAccountName" . }} | ||
| annotations: | ||
| {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| name: aibrix-controller-manager | ||
| namespace: {{ .Release.Namespace }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| --- | ||
|
|
||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: aibrix-controller-manager-clusterrole | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it's valid to have a This pattern of identical names for different kinds appears throughout the RBAC files in this PR. For example, the Could you re-introduce suffixes for clarity across all RBAC resources? For this name: {{ include "aibrix.fullname" . }}-controller-manager-clusterrole
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is redundant because you can clearly see the differences between objects without the object type as a suffix on the name. Imagine if every k8s object had a suffix of it's kind.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It works, we just need to make sure that upgrade experiences still smooth. Consider it will create new objects, I do not have concerns here |
||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
|
|
@@ -301,33 +301,28 @@ rules: | |
| - list | ||
| - update | ||
| - watch | ||
|
|
||
|
|
||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| name: aibrix-controller-manager-clusterrolebinding | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: aibrix-controller-manager-clusterrole | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: aibrix-controller-manager | ||
| name: {{ include "aibrix.controllerManager.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
|
|
||
|
|
||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: aibrix-controller-manager-leader-election-role | ||
| namespace: {{ .Release.Namespace }} | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager-leader-election | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
|
|
@@ -360,20 +355,18 @@ rules: | |
| verbs: | ||
| - create | ||
| - patch | ||
|
|
||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: aibrix-controller-manager-leader-election-rolebinding | ||
| namespace: {{ .Release.Namespace }} | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager-leader-election | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: aibrix-controller-manager-leader-election-role | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager-leader-election | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: aibrix-controller-manager | ||
| name: {{ include "aibrix.controllerManager.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any concerns to use fixed component name?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anyone wants to deploy more than 1 instance of aibrix chart to their cluster or rename it to something like
aibrix-devor something else, the fullname helper works here. Most helm charts use the fullname helper, which defaults the the chart name or the helm release name.