Files
kubesphere/config/ks-core/templates/ks-apiserver.yml
2022-09-27 08:28:22 +08:00

118 lines
3.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ks-apiserver
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-apiserver
spec:
strategy:
rollingUpdate:
maxSurge: 0
type: RollingUpdate
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: ks-apiserver
tier: backend
# version: {{ .Chart.AppVersion }}
template:
metadata:
labels:
app: ks-apiserver
tier: backend
# version: {{ .Chart.AppVersion }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- command:
- ks-apiserver
- --logtostderr=true
image: {{ .Values.image.ks_apiserver_repo }}:{{ .Values.image.ks_apiserver_tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: ks-apiserver
ports:
- containerPort: 9090
protocol: TCP
resources:
{{- toYaml .Values.apiserver.resources | nindent 12 }}
volumeMounts:
- mountPath: /etc/kubesphere/
name: kubesphere-config
- mountPath: /etc/localtime
name: host-time
readOnly: true
{{- if .Values.apiserver.extraVolumeMounts }}
{{- toYaml .Values.apiserver.extraVolumeMounts | nindent 8 }}
{{- end }}
env:
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }}
{{- end }}
livenessProbe:
failureThreshold: 8
httpGet:
path: /kapis/version
port: 9090
scheme: HTTP
initialDelaySeconds: 15
timeoutSeconds: 15
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: kubesphere-config
name: kubesphere-config
- hostPath:
path: /etc/localtime
type: ""
name: host-time
{{- if .Values.apiserver.extraVolumes }}
{{ toYaml .Values.apiserver.extraVolumes | nindent 6 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kubernetes.io/created-by: kubesphere.io/ks-apiserver
labels:
app: ks-apiserver
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-apiserver
spec:
ports:
- port: 80
protocol: TCP
targetPort: 9090
{{- with .Values.apiserver.nodePort }}
nodePort:
{{- toYaml . | nindent 6 }}
{{- end }}
selector:
app: ks-apiserver
tier: backend
{{- if .Values.apiserver.nodePort }}
type: NodePort
{{- else}}
type: ClusterIP
{{- end}}