Skip to content

Commit c6e30f9

Browse files
authored
[occm] Allow user to specify common annotations (kubernetes#2079)
Adding annotations to all manifest came to as a requirement of wanting to set specific annotations to force this component to be installed with priority over other application subcharts that might be deployed at the same time.
1 parent 7545b09 commit c6e30f9

File tree

10 files changed

+52
-9
lines changed

10 files changed

+52
-9
lines changed

charts/openstack-cloud-controller-manager/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Openstack Cloud Controller Manager Helm Chart
44
icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png
55
home: https://github.com/kubernetes/cloud-provider-openstack
66
name: openstack-cloud-controller-manager
7-
version: 1.4.0
7+
version: 1.5.0
88
maintainers:
99
- name: morremeyer
1010

charts/openstack-cloud-controller-manager/templates/clusterrole.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
44
name: system:openstack-cloud-controller-manager
5+
annotations:
6+
{{- with .Values.commonAnnotations }}
7+
{{- toYaml . | nindent 4 }}
8+
{{- end }}
59
rules:
610
- apiGroups:
711
- coordination.k8s.io

charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ kind: ClusterRoleBinding
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
55
name: system:{{ include "occm.name" . }}:auth-delegate
6+
annotations:
7+
{{- with .Values.commonAnnotations }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
610
subjects:
711
- kind: User
812
name: system:serviceaccount:{{ .Release.Namespace }}:{{ include "occm.name" . }}

charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
44
name: system:openstack-cloud-controller-manager
5+
annotations:
6+
{{- with .Values.commonAnnotations }}
7+
{{- toYaml . | nindent 4 }}
8+
{{- end }}
59
roleRef:
610
apiGroup: rbac.authorization.k8s.io
711
kind: ClusterRole

charts/openstack-cloud-controller-manager/templates/daemonset.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
labels:
77
{{- include "occm.labels" . | nindent 4 }}
8+
annotations:
9+
{{- with .Values.commonAnnotations }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
812
spec:
913
selector:
1014
matchLabels:
@@ -17,6 +21,10 @@ spec:
1721
checksum/config: {{ include "cloudConfig" . | sha256sum }}
1822
labels:
1923
{{- include "occm.controllermanager.labels" . | nindent 8 }}
24+
annotations:
25+
{{- with .Values.commonAnnotations }}
26+
{{- toYaml . | nindent 8 }}
27+
{{- end }}
2028
spec:
2129
{{- with .Values.nodeSelector }}
2230
nodeSelector:

charts/openstack-cloud-controller-manager/templates/secret.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: {{ .Values.secret.name | default "cloud-config" }}
6-
namespace: {{ .Release.Namespace }}
5+
name: {{ .Values.secret.name | default "cloud-config" }}
6+
namespace: {{ .Release.Namespace }}
7+
annotations:
8+
{{- with .Values.commonAnnotations }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
711
type: Opaque
812
data:
9-
{{ if .Values.cloudConfigContents -}}
10-
cloud.conf: |
11-
{{ .Values.cloudConfigContents | b64enc }}
12-
{{ else -}}
13-
cloud.conf: {{ include "cloudConfig" . | b64enc }}
14-
{{ end -}}
13+
{{ if .Values.cloudConfigContents -}}
14+
cloud.conf: |
15+
{{ .Values.cloudConfigContents | b64enc }}
16+
{{ else -}}
17+
cloud.conf: {{ include "cloudConfig" . | b64enc }}
18+
{{ end -}}
1519
{{- end }}

charts/openstack-cloud-controller-manager/templates/service-sm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ metadata:
66
{{- include "occm.labels" . | nindent 4 }}
77
name: {{ include "occm.name" . }}
88
namespace: {{ .Release.Namespace }}
9+
annotations:
10+
{{- with .Values.commonAnnotations }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
913
spec:
1014
ports:
1115
- name: http

charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ kind: ServiceAccount
33
metadata:
44
name: openstack-cloud-controller-manager
55
namespace: {{ .Release.Namespace }}
6+
annotations:
7+
{{- with .Values.commonAnnotations }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}

charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ metadata:
66
{{- include "occm.labels" . | nindent 4 }}
77
name: {{ include "occm.name" . }}
88
namespace: {{ .Release.Namespace }}
9+
annotations:
10+
{{- with .Values.commonAnnotations }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
913
spec:
1014
endpoints:
1115
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token

charts/openstack-cloud-controller-manager/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
#
33
# Define deployment mode for the controller and provide cloud credentials in cloudConfig at the end of the file
44
#
5+
## Annotations to apply to all resources
6+
commonAnnotations: {}
7+
# commonAnnotations:
8+
# "helm.sh/hook": pre-install,pre-upgrade
9+
# "helm.sh/hook-weight": "-100"
10+
# "helm.sh/hook-delete-policy": before-hook-creation
11+
512
# Image repository name and tag
613
image:
714
repository: docker.io/k8scloudprovider/openstack-cloud-controller-manager

0 commit comments

Comments
 (0)