Ensure Helm waits for CRD\TPRs to be available before returning

Signed-off-by: Tim Jones <timniverse@gmail.com>
This commit is contained in:
Tim Jones
2018-02-21 08:11:14 +01:00
parent 2746b499ef
commit 9d72eb8d09
2 changed files with 48 additions and 0 deletions
@@ -0,0 +1,43 @@
apiVersion: batch/v1
kind: Job
metadata:
name: rook-operator-wait-resources
annotations:
helm.sh/hook: post-install
"helm.sh/hook-delete-policy": hook-succeeded
labels:
app: rook-operator-wait-resources
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
template:
metadata:
labels:
app: rook-operator-wait-resources
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
containers:
- name: hyperkube
image: "{{ .Values.hyperkube.repository }}:{{ .Values.hyperkube.tag }}"
imagePullPolicy: "{{ .Values.hyperkube.pullPolicy }}"
command:
- ./kubectl
- get
{{- if printf "%s.%s" .Capabilities.KubeVersion.Major .Capabilities.KubeVersion.Minor | semverCompare ">=1.7" }}
- customresourcedefinitions
- clusters.rook.io
- pools.rook.io
- objectstores.rook.io
- filesystems.rook.io
- volumeattachments.rook.io
{{- else }}
- thirdpartyresources
- cluster.rook.io
- pool.rook.io
- objectstore.rook.io
- filesystem.rook.io
- volumeattachment.rook.io
{{- end }}
restartPolicy: OnFailure
{{- if .Values.rbacEnable }}
serviceAccountName: rook-operator
{{- end }}
+5
View File
@@ -8,6 +8,11 @@ image:
tag: %%VERSION%%
pullPolicy: IfNotPresent
hyperkube:
repository: k8s.gcr.io/hyperkube
tag: v1.7.12
pullPolicy: IfNotPresent
resources:
limits:
cpu: 100m