Skip to content

Commit

Permalink
Merge pull request #417 from zheng1/master
Browse files Browse the repository at this point in the history
Update ks-core version to v1.1.1
  • Loading branch information
zheng1 authored Sep 14, 2024
2 parents 96a2a4d + d17e8f4 commit a9f84de
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/ks-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/main/ks-core/templates/_images.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down Expand Up @@ -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 }}

Expand Down
74 changes: 74 additions & 0 deletions src/main/ks-core/templates/extension-museum.yaml
Original file line number Diff line number Diff line change
@@ -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}}
9 changes: 9 additions & 0 deletions src/main/ks-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a9f84de

Please sign in to comment.