k8s deployment

牧之丨發表於2024-06-15

# Default values for chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 2
minReadySeconds: 1
strategy:
  type: RollingUpdate
  RollingUpdate:
    maxSurge: 1
    maxUnavailable: 0
image:
  repository: 192.168.50.32/baize-dev/tally
  pullPolicy: Always
  # Overrides the image tag whose default is the chart appVersion.
  tag: "feature-3.0.0"

restartPolicy: Always
imagePullSecrets: []
nameOverride: "tally"
fullnameOverride: ""

podAnnotations: {}
podLabels: {}

podSecurityContext:
  runAsUser: 2000
  runAsGroup: 2000
  fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  type: NodePort
  port: 32080
  nodePort: 32080

debug:
  port: 32089
  nodePort: 32089

app:
  profilesActive: dev
  nacos:
    namespace: dev01
    username: dev
    password: lZSnUj5cEmAv3VY1rQHL2FTdIxayuoif
    serverAddr: 192.168.60.11:8848

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

livenessProbe:
  exec:
    command:
      - /bin/bash
      - -c
      - /check_health/check_http_health.sh
  initialDelaySeconds: 60
  periodSeconds: 60
  timeoutSeconds: 10
  successThreshold: 1
  failureThreshold: 3
readinessProbe:
  httpGet:
    path: /tally/actuator/health/ping
    port: 32080
  initialDelaySeconds: 5
  periodSeconds: 10
  timeoutSeconds: 5
  successThreshold: 1
  failureThreshold: 3
startupProbe:
  exec:
    command:
      - /bin/bash
      - -c
      - /check_health/check_http_health.sh
  initialDelaySeconds: 30
  periodSeconds: 30
  timeoutSeconds: 10
  successThreshold: 1
  failureThreshold: 10

autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 100
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
volumes:
# - name: foo
#   secret:
#     secretName: mysecret
#     optional: false
  - name: data-storage
    persistentVolumeClaim:
      claimName: data-storage
      readOnly: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts:
# - name: foo
#   mountPath: "/etc/foo"
#   readOnly: true
  - name: data-storage
    mountPath: /data/storage

nodeSelector: {}

tolerations: []

affinity: {}

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.nameOverride }}
  labels:
    app: {{ .Values.nameOverride }}
spec:
  minReadySeconds: {{ .Values.minReadySeconds }}
  {{ - with .Values.strategy }}
  strategy:
    {{- toYaml . | nindent 4 }}
  {{- end }}
  {{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
  {{- end }}
  selector:
    matchLabels:
      app: {{ .Values.nameOverride }}
  template:
    metadata:
      {{- with .Values.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        app: {{ .Values.nameOverride }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      restartPolicy: {{ .Values.restartPolicy }}
      containers:
        - name: {{ .Values.nameOverride }}
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          envFrom:
            - configMapRef:
                name: {{ .Values.nameOverride }}-conf
          livenessProbe:
            {{- toYaml .Values.livenessProbe | nindent 12 }}
          readinessProbe:
            {{- toYaml .Values.readinessProbe | nindent 12 }}
          startupProbe:
            {{- toYaml .Values.startupProbe | nindent 12 }}
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          {{- with .Values.volumeMounts }}
          volumeMounts:
            {{- toYaml . | nindent 12 }}
          {{- end }}
      {{- with .Values.volumes }}
      volumes:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}

相關文章