Skip to content

Commit 37ba02c

Browse files
eumel8morremeyer
andauthored
[occm] OpenStack Cloud Controller Manager Helm Chart (kubernetes#1458)
* bump chart version * add helm chart openstack-cloud-controller-manager * revert * fix yaml * fix linting * remove block storage settings Block storage is managed by cinder-csi-plugin * Add support for all available options * Update README with install instructions * Add myself as maintainer * add myself as chart maintainer * Simplify configuration with default values * add blockStorage rule for cloud.conf * added blockStorage as value * fix maintainer names to Github user names See helm/chart-testing#192 * some more documentation * move out service LoadBalancer to extra chart * fix linting Co-authored-by: Morre <[email protected]>
1 parent b284e4a commit 37ba02c

File tree

12 files changed

+445
-0
lines changed

12 files changed

+445
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
appVersion: "latest"
3+
description: Openstack Cloud Controller Manager Helm Chart
4+
icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png
5+
home: https://github.com/kubernetes/cloud-provider-openstack
6+
name: openstack-cloud-controller-manager
7+
version: 1.0.0
8+
maintainers:
9+
- name: morremeyer
10+
11+
url: https://maurice-meyer.de
12+
- name: eumel8
13+
14+
url: https://www.telekom.com
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# openstack-cloud-controller-manager
2+
3+
Deploys the OpenStack Cloud Controller Manager to your cluster.
4+
5+
Default configuration values are the same as the CCM itself.
6+
7+
## How To install
8+
9+
You need to configure an `openstack-ccm.yaml` values file with at least:
10+
11+
- `cloudConfig.global.auth-url` with the Keystone URL
12+
- Authentication
13+
- with password: `cloudConfig.global.username` and `cloudconfig.global.password`
14+
- with application credentials: (`cloudConfig.global.application-credential-id` or `cloudConfig.global.application-credential-name`) and `cloudConfig.global.application-credential-secret`
15+
- Load balancing
16+
- `cloudConfig.loadbalancer.floating-network-id` **or**
17+
- `cloudConfig.loadbalancer.floating-subnet-id` **or**
18+
- `cloudConfig.loadbalancer.floating-subnet`
19+
20+
If you want to enable health checks for your Load Balancers (optional), set `cloudConfig.loadbalancer.create-monitor: true`.
21+
22+
Then run:
23+
24+
```
25+
helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack
26+
helm repo update
27+
helm install openstack-ccm cpo/openstack-cloud-controller-manager --values openstack-ccm.yaml
28+
```
29+
30+
## Unsupported configurations
31+
32+
- The chart does not support the mounting of custom `clouds.yaml` files. Therefore, the following config values in the `[Global]` section won’t have any effect:
33+
- `use-clouds`
34+
- `clouds-file`
35+
- `cloud`
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "occm.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
6+
{{- end -}}
7+
8+
{{/*
9+
Create chart name and version as used by the chart label.
10+
*/}}
11+
{{- define "occm.chart" -}}
12+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
13+
{{- end -}}
14+
15+
{{/*
16+
Common labels and app labels
17+
*/}}
18+
{{- define "occm.labels" -}}
19+
app.kubernetes.io/name: {{ include "occm.name" . }}
20+
helm.sh/chart: {{ include "occm.chart" . }}
21+
app.kubernetes.io/instance: {{ .Release.Name }}
22+
{{- if .Chart.AppVersion }}
23+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
24+
{{- end }}
25+
app.kubernetes.io/managed-by: {{ .Release.Service }}
26+
{{- end -}}
27+
28+
{{- define "occm.common.matchLabels" -}}
29+
app: {{ template "occm.name" . }}
30+
release: {{ .Release.Name }}
31+
{{- end -}}
32+
33+
{{- define "occm.common.metaLabels" -}}
34+
chart: {{ template "occm.chart" . }}
35+
heritage: {{ .Release.Service }}
36+
{{- end -}}
37+
38+
{{- define "occm.controllermanager.matchLabels" -}}
39+
component: controllermanager
40+
{{ include "occm.common.matchLabels" . }}
41+
{{- end -}}
42+
43+
{{- define "occm.controllermanager.labels" -}}
44+
{{ include "occm.controllermanager.matchLabels" . }}
45+
{{ include "occm.common.metaLabels" . }}
46+
{{- end -}}
47+
48+
{{/*
49+
Create cloud-config makro.
50+
*/}}
51+
{{- define "cloudConfig" -}}
52+
[Global]
53+
{{- range $key, $value := .Values.cloudConfig.global }}
54+
{{ $key }} = {{ $value }}
55+
{{- end }}
56+
57+
[Networking]
58+
{{- range $key, $value := .Values.cloudConfig.networking }}
59+
{{ $key }} = {{ $value }}
60+
{{- end }}
61+
62+
[LoadBalancer]
63+
{{- range $key, $value := .Values.cloudConfig.loadBalancer }}
64+
{{ $key }} = {{ $value }}
65+
{{- end }}
66+
67+
[BlockStorage]
68+
{{- range $key, $value := .Values.cloudConfig.blockStorage }}
69+
{{ $key }} = {{ $value }}
70+
{{- end }}
71+
72+
[Metadata]
73+
{{- range $key, $value := .Values.cloudConfig.metadata }}
74+
{{ $key }} = {{ $value }}
75+
{{- end }}
76+
{{- end }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: system:openstack-cloud-controller-manager
5+
rules:
6+
- apiGroups:
7+
- coordination.k8s.io
8+
resources:
9+
- leases
10+
verbs:
11+
- get
12+
- create
13+
- update
14+
- apiGroups:
15+
- ""
16+
resources:
17+
- events
18+
verbs:
19+
- create
20+
- patch
21+
- update
22+
- apiGroups:
23+
- ""
24+
resources:
25+
- nodes
26+
verbs:
27+
- '*'
28+
- apiGroups:
29+
- ""
30+
resources:
31+
- nodes/status
32+
verbs:
33+
- patch
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- services
38+
verbs:
39+
- list
40+
- patch
41+
- update
42+
- watch
43+
- apiGroups:
44+
- ""
45+
resources:
46+
- serviceaccounts
47+
verbs:
48+
- create
49+
- get
50+
- apiGroups:
51+
- ""
52+
resources:
53+
- persistentvolumes
54+
verbs:
55+
- '*'
56+
- apiGroups:
57+
- ""
58+
resources:
59+
- endpoints
60+
verbs:
61+
- create
62+
- get
63+
- list
64+
- watch
65+
- update
66+
- apiGroups:
67+
- ""
68+
resources:
69+
- configmaps
70+
verbs:
71+
- get
72+
- list
73+
- watch
74+
- apiGroups:
75+
- ""
76+
resources:
77+
- secrets
78+
verbs:
79+
- list
80+
- get
81+
- watch
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .Values.serviceMonitor.enabled }}
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: system:{{ include "occm.name" . }}:auth-delegate
6+
subjects:
7+
- kind: User
8+
name: system:serviceaccount:{{ .Release.Namespace }}:{{ include "occm.name" . }}
9+
apiGroup: rbac.authorization.k8s.io
10+
roleRef:
11+
kind: ClusterRole
12+
name: system:auth-delegator
13+
apiGroup: rbac.authorization.k8s.io
14+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: system:openstack-cloud-controller-manager
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: system:openstack-cloud-controller-manager
9+
subjects:
10+
- kind: ServiceAccount
11+
name: openstack-cloud-controller-manager
12+
namespace: {{ .Release.Namespace | quote }}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: {{ include "occm.name" . }}
5+
labels:
6+
{{- include "occm.labels" . | nindent 4 }}
7+
spec:
8+
selector:
9+
matchLabels:
10+
{{- include "occm.controllermanager.matchLabels" . | nindent 6 }}
11+
updateStrategy:
12+
type: RollingUpdate
13+
template:
14+
metadata:
15+
annotations:
16+
checksum/config: {{ include "cloudConfig" . | sha256sum }}
17+
labels:
18+
{{- include "occm.controllermanager.labels" . | nindent 8 }}
19+
spec:
20+
{{- with .Values.nodeSelector }}
21+
nodeSelector:
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
securityContext:
25+
runAsUser: 1001
26+
{{- with .Values.tolerations }}
27+
tolerations:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
serviceAccountName: openstack-cloud-controller-manager
31+
containers:
32+
- name: openstack-cloud-controller-manager
33+
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
34+
args:
35+
- /bin/openstack-cloud-controller-manager
36+
- --v=1
37+
- --cloud-config=$(CLOUD_CONFIG)
38+
- --cloud-provider=openstack
39+
- --use-service-account-credentials=true
40+
{{- if .Values.serviceMonitor.enabled }}
41+
- --address=0.0.0.0
42+
{{- else }}
43+
- --address=127.0.0.1
44+
{{- end }}
45+
{{- if .Values.controllerExtraArgs }}
46+
{{- with .Values.controllerExtraArgs }}
47+
{{- tpl . $ | trim | nindent 12 }}
48+
{{- end }}
49+
{{- end }}
50+
{{- if .Values.serviceMonitor.enabled }}
51+
ports:
52+
- containerPort: 10258
53+
hostPort: 10258
54+
name: http
55+
protocol: TCP
56+
{{- end }}
57+
volumeMounts:
58+
- mountPath: /etc/kubernetes/pki
59+
name: k8s-certs
60+
readOnly: true
61+
- mountPath: /etc/ssl/certs
62+
name: ca-certs
63+
readOnly: true
64+
- mountPath: /etc/config
65+
name: cloud-config-volume
66+
readOnly: true
67+
- mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
68+
name: flexvolume-dir
69+
{{- if .Values.livenessProbe }}
70+
livenessProbe:
71+
{{- toYaml .Values.livenessProbe | nindent 12 }}
72+
{{- end }}
73+
{{- if .Values.readinessProbe }}
74+
readinessProbe:
75+
{{- toYaml .Values.readinessProbe | nindent 12 }}
76+
{{- end }}
77+
{{- if .Values.resources }}
78+
resources:
79+
{{- toYaml .Values.resources | nindent 12 }}
80+
{{- end }}
81+
env:
82+
- name: CLOUD_CONFIG
83+
value: /etc/config/cloud.conf
84+
hostNetwork: true
85+
volumes:
86+
- hostPath:
87+
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
88+
type: DirectoryOrCreate
89+
name: flexvolume-dir
90+
- hostPath:
91+
path: /etc/kubernetes/pki
92+
type: DirectoryOrCreate
93+
name: k8s-certs
94+
- hostPath:
95+
path: /etc/ssl/certs
96+
type: DirectoryOrCreate
97+
name: ca-certs
98+
- name: cloud-config-volume
99+
secret:
100+
secretName: {{ .Values.secret.name | default "cloud-config" }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if .Values.secret.create }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ .Values.secret.name | default "cloud-config" }}
6+
type: Opaque
7+
data:
8+
cloud.conf: {{ include "cloudConfig" . | b64enc }}
9+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if .Values.serviceMonitor.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
labels:
6+
{{- include "occm.labels" . | nindent 4 }}
7+
name: {{ include "occm.name" . }}
8+
spec:
9+
ports:
10+
- name: http
11+
port: 10258
12+
protocol: TCP
13+
selector:
14+
{{- include "occm.labels" . | nindent 4 }}
15+
{{- end }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: openstack-cloud-controller-manager

0 commit comments

Comments
 (0)