helm: allows to mount extra volumes

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-23 02:34:00 +00:00
parent ddc645838d
commit 709e0c92f1
4 changed files with 97 additions and 46 deletions

View File

@@ -39,7 +39,7 @@ spec:
- containerPort: 9090 - containerPort: 9090
protocol: TCP protocol: TCP
resources: resources:
{{- toYaml .Values.apiserverResources | nindent 12 }} {{- toYaml .Values.apiserver.resources | nindent 12 }}
volumeMounts: volumeMounts:
- mountPath: /var/run/docker.sock - mountPath: /var/run/docker.sock
name: docker-sock name: docker-sock
@@ -49,6 +49,9 @@ spec:
name: kubesphere-config name: kubesphere-config
- mountPath: /etc/localtime - mountPath: /etc/localtime
name: host-time name: host-time
{{- if .Values.apiserver.extraVolumeMounts }}
{{- toYaml .Values.apiserver.extraVolumeMounts | nindent 8 }}
{{- end }}
env: env:
{{- if .Values.env }} {{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }} {{- toYaml .Values.env | nindent 8 }}
@@ -106,7 +109,9 @@ spec:
path: /etc/localtime path: /etc/localtime
type: "" type: ""
name: host-time name: host-time
{{- if .Values.apiserver.extraVolumes }}
{{ toYaml .Values.apiserver.extraVolumes | nindent 6 }}
{{- end }}
--- ---
apiVersion: v1 apiVersion: v1

View File

@@ -27,7 +27,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
name: ks-console name: ks-console
resources: resources:
{{- toYaml .Values.consoleResources | nindent 12 }} {{- toYaml .Values.console.resources | nindent 12 }}
volumeMounts: volumeMounts:
- mountPath: /opt/kubesphere/console/server/local_config.yaml - mountPath: /opt/kubesphere/console/server/local_config.yaml
name: ks-console-config name: ks-console-config
@@ -36,6 +36,9 @@ spec:
name: sample-bookinfo name: sample-bookinfo
- mountPath: /etc/localtime - mountPath: /etc/localtime
name: host-time name: host-time
{{- if .Values.console.extraVolumeMounts }}
{{- toYaml .Values.console.extraVolumeMounts | nindent 8 }}
{{- end }}
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: 8000 port: 8000
@@ -89,6 +92,9 @@ spec:
path: /etc/localtime path: /etc/localtime
type: "" type: ""
name: host-time name: host-time
{{- if .Values.console.extraVolumes }}
{{ toYaml .Values.console.extraVolumes | nindent 6 }}
{{- end }}
--- ---

View File

@@ -44,7 +44,7 @@ spec:
- containerPort: 8443 - containerPort: 8443
protocol: TCP protocol: TCP
resources: resources:
{{- toYaml .Values.controllerManagerResources | nindent 12 }} {{- toYaml .Values.controller.resources | nindent 12 }}
volumeMounts: volumeMounts:
- mountPath: /etc/kubesphere/ - mountPath: /etc/kubesphere/
name: kubesphere-config name: kubesphere-config
@@ -52,6 +52,9 @@ spec:
name: webhook-secret name: webhook-secret
- mountPath: /etc/localtime - mountPath: /etc/localtime
name: host-time name: host-time
{{- if .Values.controller.extraVolumeMounts }}
{{- toYaml .Values.controller.extraVolumeMounts | nindent 8 }}
{{- end }}
env: env:
{{- if .Values.env }} {{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }} {{- toYaml .Values.env | nindent 8 }}
@@ -62,18 +65,21 @@ spec:
serviceAccountName: {{ include "ks-core.serviceAccountName" . }} serviceAccountName: {{ include "ks-core.serviceAccountName" . }}
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
volumes: volumes:
- name: kubesphere-config - name: kubesphere-config
configMap: configMap:
name: kubesphere-config name: kubesphere-config
defaultMode: 420 defaultMode: 420
- name: webhook-secret - name: webhook-secret
secret: secret:
defaultMode: 420 defaultMode: 420
secretName: ks-controller-manager-webhook-cert secretName: ks-controller-manager-webhook-cert
- hostPath: - hostPath:
path: /etc/localtime path: /etc/localtime
type: "" type: ""
name: host-time name: host-time
{{- if .Values.controller.extraVolumes }}
{{ toYaml .Values.controller.extraVolumes | nindent 6 }}
{{- end }}
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View File

@@ -44,10 +44,6 @@ config:
multicluster: {} multicluster: {}
monitoring: {} monitoring: {}
console:
port: 30880
type: NodePort
imagePullSecrets: [] imagePullSecrets: []
nameOverride: "" nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
@@ -74,30 +70,6 @@ securityContext: {}
# runAsNonRoot: true # runAsNonRoot: true
# runAsUser: 1000 # runAsUser: 1000
apiserverResources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 20m
memory: 100Mi
consoleResources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 20m
memory: 100Mi
controllerManagerResources:
limits:
cpu: 1
memory: 1000Mi
requests:
cpu: 30m
memory: 50Mi
# Kubernetes Version shows in KubeSphere console # Kubernetes Version shows in KubeSphere console
kube_version: "v1.19.4" kube_version: "v1.19.4"
@@ -117,3 +89,65 @@ tolerations:
affinity: {} affinity: {}
env: [] env: []
## deployment specific configuration
apiserver:
resources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 20m
memory: 100Mi
extraVolumeMounts: []
## Additional volumeMounts to the apiserver container.
# - name: example-config
# mountPath: /etc/kubesphere/example
extraVolumes: []
## Additional volumes to the apiserver pod.
# - name: example-config
# emptyDir: {}
console:
port: 30880
type: NodePort
resources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 20m
memory: 100Mi
extraVolumeMounts: []
## Additional volumeMounts to the console container.
# - name: example-config
# mountPath: /etc/kubesphere/example
extraVolumes: []
## Additional volumes to the console pod.
# - name: example-config
# emptyDir: {}
controller:
resources:
limits:
cpu: 1
memory: 1000Mi
requests:
cpu: 30m
memory: 50Mi
extraVolumeMounts: []
## Additional volumeMounts to the controller container.
# - name: example-config
# mountPath: /etc/kubesphere/example
extraVolumes: []
## Additional volumes to the controller pod.
# - name: example-config
# emptyDir: {}