Skip to content

Commit

Permalink
Enable status sub resource by inspection of Kube version
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Sep 29, 2018
1 parent 9aba48f commit f2204fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chart/kubedb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following table lists the configurable parameters of the KubeDB chart and th
| `apiserver.enableValidatingWebhook` | Enable validating webhooks for KubeDB CRDs | `true` |
| `apiserver.enableMutatingWebhook` | Enable mutating webhooks for KubeDB CRDs | `true` |
| `apiserver.ca` | CA certificate used by main Kubernetes api server | `` |
| `apiserver.enableStatusSubresource` | If true, uses status sub resource for crds | `false` |
| `apiserver.disableStatusSubresource` | If true, disables status sub resource for crds. Otherwise enables based on Kubernetes version | `false` |
| `enableAnalytics` | Send usage events to Google Analytics | `true` |


Expand Down
7 changes: 6 additions & 1 deletion chart/kubedb/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# GKE returns Major:"1", Minor:"10+"
{{- $major := default "0" .Capabilities.KubeVersion.Major | trimSuffix "+" | int64 -}}
{{- $minor := default "0" .Capabilities.KubeVersion.Minor | trimSuffix "+" | int64 -}}
apiVersion: apps/v1beta1
kind: Deployment
metadata:
Expand Down Expand Up @@ -46,7 +49,9 @@ spec:
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
- --enable-status-subresource={{ .Values.apiserver.enableStatusSubresource }}
{{- if and (not .Values.apiserver.disableStatusSubresource) (ge $major 1) (ge $minor 11) }}
- --enable-status-subresource=true
{{- end }}
- --enable-analytics={{ .Values.enableAnalytics }}
env:
- name: OPERATOR_NAMESPACE
Expand Down
5 changes: 3 additions & 2 deletions chart/kubedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ apiserver:
enableValidatingWebhook: true
# CA certificate used by main Kubernetes api server
ca:
# If true, uses status sub resource for crds.
enableStatusSubresource: false
# If true, disables status sub resource for crds.
# Otherwise, enables status sub resource for Kubernetes version >= 1.11 and disables for other versions.
disableStatusSubresource: false

# Send usage events to Google Analytics
enableAnalytics: true

0 comments on commit f2204fb

Please sign in to comment.