Skip to content

Commit

Permalink
Improve Helm chart options (#266)
Browse files Browse the repository at this point in the history
xref: https://github.com/appscodelabs/discuss/labels/chart

Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Aug 22, 2018
1 parent 928c4f5 commit d2a648a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chart/kubedb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ The following table lists the configurable parameters of the KubeDB chart and th
| `imagePullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `criticalAddon` | If true, installs KubeDB operator as critical addon | `false` |
| `affinity` | Affinity rules for pod assignment | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Tolerations used pod assignment | `{}` |
| `rbac.create` | If `true`, create and use RBAC resources | `true` |
| `serviceAccount.create` | If `true`, create a new service account | `true` |
| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | `` |
Expand Down
18 changes: 17 additions & 1 deletion chart/kubedb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,24 @@ spec:
secret:
defaultMode: 420
secretName: {{ template "kubedb.fullname" . }}-apiserver-cert
{{- if and .Values.criticalAddon (eq .Release.Namespace "kube-system") }}
{{- if or .Values.tolerations (and .Values.criticalAddon (eq .Release.Namespace "kube-system")) }}
tolerations:
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end -}}
{{- if and .Values.criticalAddon (eq .Release.Namespace "kube-system") }}
- key: CriticalAddonsOnly
operator: Exists
{{- end -}}
{{- end -}}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end -}}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end -}}
{{- if and .Values.criticalAddon (eq .Release.Namespace "kube-system") }}
priorityClassName: system-cluster-critical
{{- end -}}
15 changes: 15 additions & 0 deletions chart/kubedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ imagePullPolicy: IfNotPresent
## https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
criticalAddon: false

## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}

## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: {}

## Affinity for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
affinity: {}

rbac:
# Specifies whether RBAC resources should be created
create: true
Expand Down
1 change: 1 addition & 0 deletions hack/deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
priorityClassName: system-cluster-critical
---
# kube lacks the service serving cert signer, so provide a manual secret for it
apiVersion: v1
Expand Down

0 comments on commit d2a648a

Please sign in to comment.