feat: add extension-museum in helm (#6168)
* feat: add extension-museum in helm Signed-off-by: joyceliu <joyceliu@yunify.com> * feat: add extension-museum in helm Signed-off-by: joyceliu <joyceliu@yunify.com> --------- Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
@@ -37,6 +37,10 @@ Return the proper image name
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.preUpgrade.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "extensions_museum.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.ksExtensionRepository.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.images.image" -}}
|
||||
{{- $registryName := .global.imageRegistry -}}
|
||||
{{- $repositoryName := .imageRoot.repository -}}
|
||||
@@ -70,6 +74,10 @@ Return the proper Docker Image Registry Secret Names
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.controller.image) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "extensions_museum.imagePullSecrets" -}}
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.ksExtensionRepository.image) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.images.pullSecrets" -}}
|
||||
{{- $pullSecrets := list }}
|
||||
|
||||
|
||||
74
config/ks-core/templates/extension-museum.yaml
Normal file
74
config/ks-core/templates/extension-museum.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
{{- if .Values.ksExtensionRepository.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: extensions-museum
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: extensions-museum
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: extensions-museum
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: extensions-museum
|
||||
spec:
|
||||
{{- include "extensions_museum.imagePullSecrets" . | nindent 6 }}
|
||||
containers:
|
||||
- name: extensions-museum
|
||||
image: {{ template "extensions_museum.image" . }}
|
||||
command:
|
||||
- "/chartmuseum"
|
||||
- "--storage-local-rootdir"
|
||||
- "/charts"
|
||||
- "--storage"
|
||||
- "local"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: extensions-museum
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: extensions-museum
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
|
||||
---
|
||||
apiVersion: kubesphere.io/v1alpha1
|
||||
kind: Repository
|
||||
metadata:
|
||||
name: extensions-museum
|
||||
spec:
|
||||
url: http://extensions-museum.{{ .Release.Namespace }}.svc
|
||||
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: restart-extensions-museum
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
schedule: "0 0 * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: restart-extensions-museum
|
||||
image: {{ template "kubectl.image" . }}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- "kubectl rollout restart deployment/extensions-museum -n {{ .Release.Namespace }}"
|
||||
restartPolicy: OnFailure
|
||||
serviceAccountName: {{ template "ks-core.serviceAccountName" . }}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user