Skip to content

Commit

Permalink
Merge pull request #1512 from TimJones/helm-wait-for-resources
Browse files Browse the repository at this point in the history
Ensure Helm waits for CRD\TPRs to be available before returning
  • Loading branch information
jbw976 committed Feb 21, 2018
2 parents eacd9db + 9d72eb8 commit 66a0783
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
43 changes: 43 additions & 0 deletions cluster/charts/rook/templates/wait-on-resources-job.yaml
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions cluster/charts/rook/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66a0783

Please sign in to comment.