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

configure the operator ServiceAccount #111

Merged
merged 7 commits into from
Oct 12, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: controller-manager
spec:
{{- if .Values.rbac.create }}
serviceAccount: tidb-controller-manager
{{- if .Values.controllerManager.serviceAccount }}
serviceAccount: {{ .Values.controllerManager.serviceAccount }}
{{- end }}
containers:
- name: tidb-operator
Expand Down
4 changes: 3 additions & 1 deletion charts/tidb-operator/templates/controller-manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ roleRef:
name: tidb-controller-manager
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- if .Values.controllerManager.ServiceAccount }}
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: tidb-controller-manager
name: {{ .Values.controllerManager.ServiceAccount }}
Copy link
Member

@tennix tennix Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's serviceAccount not ServiceAccount. User-defined variables are lower case.

labels:
app.kubernetes.io/name: {{ template "tidb-operator.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: controller-manager
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
{{- end }}
{{- end }}
12 changes: 9 additions & 3 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Default values for tidb-operator

# clusterScoped is whether tidb-operator should manage kubernetes cluster wide tidb clusters
# Also see rbac.create and controllerManager.serviceAccount
clusterScoped: true

# Also see clusterScoped and controllerManager.serviceAccount
rbac:
create: true

Expand All @@ -8,10 +14,10 @@ imagePullPolicy: IfNotPresent

defaultStorageClassName: local-storage

# clusterScoped is whether tidb-operator should manage kubernetes cluster wide tidb clusters
clusterScoped: true

controllerManager:
# If you turn on rbac.create, you likely also want to turn this on
# Also see rbac.create and clusterScoped
serviceAccount: tidb-controller-manager
logLevel: 2
replicas: 1
resources:
Expand Down