-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add upgrade crds hook and stripped down crds
Signed-off-by: frezes <[email protected]>
- Loading branch information
Showing
14 changed files
with
144 additions
and
17,733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,073 changes: 2 additions & 1,071 deletions
1,073
charts/whizard/crds/monitoring.whizard.io_compactors.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
830 changes: 2 additions & 828 deletions
830
charts/whizard/crds/monitoring.whizard.io_gateways.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
1,093 changes: 2 additions & 1,091 deletions
1,093
charts/whizard/crds/monitoring.whizard.io_ingesters.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
832 changes: 1 addition & 831 deletions
832
charts/whizard/crds/monitoring.whizard.io_queryfrontends.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
1,207 changes: 1 addition & 1,206 deletions
1,207
charts/whizard/crds/monitoring.whizard.io_rulers.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
8,706 changes: 1 addition & 8,705 deletions
8,706
charts/whizard/crds/monitoring.whizard.io_services.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
931 changes: 0 additions & 931 deletions
931
charts/whizard/crds/monitoring.whizard.io_storages.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
1,379 changes: 1 addition & 1,378 deletions
1,379
charts/whizard/crds/monitoring.whizard.io_stores.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{{- if .Values.hook.enabled }} | ||
{{- $crdFiles := .Files.Glob "crds/**" }} | ||
{{- $i := 0 }} | ||
{{- range $path, $_ := $crdFiles }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "whizard.name" $ }}-crds-{{ $i }} | ||
namespace: {{ include "whizard.namespace" $ }} | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
data: | ||
{{ $path | base }}: | | ||
{{- $.Files.Get $path | nindent 4 }} | ||
--- | ||
{{- $i = add1 $i }} | ||
{{- end }} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "whizard.name" . }}-update-crds | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "2" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "whizard.name" . }}-update-crds | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "3" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
rules: | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- get | ||
- update | ||
- patch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "whizard.name" . }}-update-crds | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "4" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "whizard.name" . }}-update-crds | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "whizard.name" . }}-update-crds | ||
namespace: {{ include "whizard.namespace" . }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "whizard.name" . }}-update-crds | ||
namespace: {{ include "whizard.namespace" . }} | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "5" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: {{ include "whizard.name" . }}-update-crds | ||
volumes: | ||
{{- $i = 0 }} | ||
{{- range $path, $_ := $crdFiles }} | ||
- name: crds-{{ $i }} | ||
configMap: | ||
name: {{ include "whizard.name" $ }}-crds-{{ $i }} | ||
items: | ||
- key: {{ $path | base }} | ||
path: {{ $path | base }} | ||
{{- $i = add1 $i }} | ||
{{- end }} | ||
containers: | ||
- name: update-crds | ||
image: {{ .Values.global.imageRegistry | default .Values.hook.image.registry }}/{{ .Values.hook.image.repository }}:{{ .Values.hook.image.tag }} | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
kubectl apply -f /data/crds 2>&1 | ||
{{- $i = 0 }} | ||
volumeMounts: | ||
{{- range $path, $_ := $crdFiles }} | ||
- name: crds-{{ $i }} | ||
mountPath: /data/crds/{{ $path | base }} | ||
subPath: {{ $path | base }} | ||
{{- $i = add1 $i }} | ||
{{- end }} | ||
{{- with .Values.hook.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters