69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
{{- $name := include "karmada.name" . -}}
|
|
|
|
{{- if eq .Values.installMode "host" }}
|
|
{{- if eq .Values.certs.mode "custom" }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ $name }}-crds
|
|
namespace: {{ include "karmada.namespace" . }}
|
|
data:
|
|
{{- print "webhook-configuration.yaml: " | nindent 2 }} |-
|
|
{{- include "karmada.webhook.configuration" . | nindent 4 }}
|
|
{{- print "system-namespace.yaml: " | nindent 2 }} |-
|
|
{{- include "karmada.systemNamespace" . | nindent 4 }}
|
|
{{ range $path, $bytes := .Files.Glob (printf "_crds/**")}}
|
|
{{ $name := base $path }}
|
|
{{- (printf "%s: " $name) | nindent 2 }} |-
|
|
{{- $.Files.Get $path | nindent 4 }}
|
|
{{ end }}
|
|
---
|
|
{{- end }}
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: "{{ $name }}-install-crds"
|
|
labels:
|
|
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
|
|
app.kubernetes.io/instance: {{ $name | quote }}
|
|
app.kubernetes.io/version: {{ .Chart.AppVersion }}
|
|
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
annotations:
|
|
# This is what defines this resource as a hook. Without this line, the
|
|
# job is considered part of the release.
|
|
"helm.sh/hook": post-install
|
|
"helm.sh/hook-weight": "0"
|
|
"helm.sh/hook-delete-policy": hook-succeeded
|
|
spec:
|
|
parallelism: 1
|
|
completions: 1
|
|
template:
|
|
metadata:
|
|
name: {{ $name }}
|
|
labels:
|
|
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
|
|
app.kubernetes.io/instance: {{ $name | quote }}
|
|
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: post-install-job
|
|
image: bitnami/kubectl:latest
|
|
command:
|
|
- "kubectl"
|
|
- "apply"
|
|
- "-f"
|
|
- "/crds"
|
|
- "--kubeconfig"
|
|
- "/etc/kubeconfig"
|
|
volumeMounts:
|
|
- name: {{ $name }}-crds
|
|
mountPath: /crds
|
|
{{ include "karmada.kubeconfig.volumeMount" . | nindent 10 }}
|
|
volumes:
|
|
- name: {{ $name }}-crds
|
|
configMap:
|
|
name: {{ $name }}-crds
|
|
{{ include "karmada.kubeconfig.volume" . | nindent 8 }}
|
|
{{- end }}
|