[release-4.1] feat: add extension-museum in helm (#6174)
* 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:
committed by
GitHub
parent
7dcb5d9d3b
commit
dad35f7389
@@ -7,7 +7,7 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 1.1.0
|
||||
version: 1.1.1
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
|
||||
@@ -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}}
|
||||
@@ -434,3 +434,12 @@ ksCRDs:
|
||||
requests:
|
||||
cpu: 20m
|
||||
memory: 100Mi
|
||||
|
||||
# add museum for all ks-extensions
|
||||
ksExtensionRepository:
|
||||
enabled: true
|
||||
image:
|
||||
registry: ""
|
||||
repository: kubesphere/ks-extensions-museum
|
||||
tag: "latest"
|
||||
pullPolicy: Always
|
||||
|
||||
Reference in New Issue
Block a user