Files
kubesphere/config/ks-core/templates/ks-console.yml
Leo Li 85df617175 optimize ks-core chart (#5305)
Signed-off-by: 24sama <jacksama@foxmail.com>

Signed-off-by: 24sama <jacksama@foxmail.com>
2022-10-20 18:16:40 +08:00

106 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ks-console
tier: frontend
version: {{ .Chart.AppVersion }}
name: ks-console
spec:
strategy:
rollingUpdate:
maxSurge: 0
type: RollingUpdate
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: ks-console
tier: frontend
template:
metadata:
labels:
app: ks-console
tier: frontend
spec:
containers:
- image: {{ .Values.image.ks_console_repo }}:{{ .Values.image.ks_console_tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: ks-console
resources:
{{- toYaml .Values.console.resources | nindent 12 }}
volumeMounts:
- mountPath: /opt/kubesphere/console/server/local_config.yaml
name: ks-console-config
subPath: local_config.yaml
- mountPath: /etc/localtime
name: host-time
readOnly: true
{{- if .Values.console.extraVolumeMounts }}
{{- toYaml .Values.console.extraVolumeMounts | nindent 8 }}
{{- end }}
livenessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 15
timeoutSeconds: 15
periodSeconds: 10
successThreshold: 1
failureThreshold: 8
serviceAccount: {{ include "ks-core.serviceAccountName" . }}
serviceAccountName: {{ include "ks-core.serviceAccountName" . }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- configMap:
defaultMode: 420
name: ks-console-config
items:
- key: local_config.yaml
path: local_config.yaml
name: ks-console-config
- hostPath:
path: /etc/localtime
type: ""
name: host-time
{{- if .Values.console.extraVolumes }}
{{ toYaml .Values.console.extraVolumes | nindent 6 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: ks-console
tier: frontend
version: {{ .Chart.AppVersion }}
name: ks-console
spec:
ports:
- name: nginx
port: 80
protocol: TCP
targetPort: 8000
{{- with .Values.console.nodePort }}
nodePort:
{{- toYaml . | nindent 6 }}
{{- end }}
selector:
app: ks-console
tier: frontend
{{- if .Values.console.nodePort }}
type: NodePort
{{- else}}
type: ClusterIP
{{- end}}