helm案例之模块meng-backend(一)

韵味老鸟 2024-07-06 17:19:16

helm案例之模块meng-backend(一)

helm 解析指定的模版文件

helm 解析指定dev环境的配置

helm template meng-backend/ --output-dir ./result -f meng-backend/values-dev.yaml

#覆盖默认值

helm install --dry-run --debug --set domain=meng.com ./mychart

helm install meng-backend --dry-run --debug --set controller.image.tag=v1.2.3 meng-backend

#更新操作

helm upgrade -i $SERVICE_NAME meta-cm/$SERVICE_NAME -f helm-chart/$SERVICE_NAME/values-$IMAGE_DIR.yaml

#从默认值中删除一个键

helm install meng --set image=registry/mengl:0.1.0 --set livenessProbe.exec.command=[cat,docroot/CHANGELOG.txt] --set livenessProbe.httpGet=null

#Chart.yaml

#模块基本信息,名称标识

apiVersion: v2name: meng-backenddescription: A Helm chart for Kubernetestype: applicationversion: 0.1.0appVersion: "0.0.1"

#values.yaml

#模块默认控制信息

# Default values for meng-backend.# This is a YAML-formatted file.# Declare variables to be passed into your templates.##名称nameOverride: "meng-backend"fullnameOverride: "meng-backend"#configmap配置config: enabled: false#ingress#ingress控制ingress: enabled: true Name: "nginx" annotations: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/proxy-body-size: 3072m#hpa#hpa扩缩容控制autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80#service#服务运行账号serviceAccount: create: false annotations: {} name: ""#service#服务service: enabled: true type: ClusterIP ports: - name: http port: 80 targetPort: 80 protocol: TCP#测试Podtestpod: create: false#pod#控制参数controller: #类型 type: deployment #镜像 image: repository: harbor.meng.com pullPolicy: IfNotPresent tag: "" #环境变量 envs: [] #副本数量 replicaCount: 1 #harbor仓库账号密码信息 imagePullSecrets: - name: meng-harbor #持久卷 persistence: enabled: false #挂载点 volumeMounts: - name: config mountPath: /home/app.yml subPath: app.yml - name: host-time mountPath: /etc/localtime volumes: - name: config configMap: name: meng-backend - name: host-time hostPath: path: /etc/localtime #就绪控制 readinessProbe: enabled: true initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 1 successThreshold: 1 failureThreshold: 3 #存活控制 livenessProbe: enabled: true initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 1 successThreshold: 1 failureThreshold: 3 #资源控制 resources: {} # limits: # cpu: 100m # memory: 128Mi # requests: # cpu: 100m # memory: 128Mi #pod注释 podAnnotations: {} #pod安全特性 podSecurityContext: {} securityContext: {} #pod节点指定 nodeSelector: {} #pod容忍性 tolerations: [] #亲和性 affinity: {}

0 阅读:1