apiVersion: apps/v1 kind: Deployment
apiVersion
: 资源的版本,这里使用的是apps/v1
,表示这是一个 Deployment 的最新版本。kind
: 资源类型,这里是Deployment
,表示这是一个 Deployment 资源。
metadata: name: project_name-project_env namespace: dtmtask-project_env labels: app: project_name-project_env
name
: Deployment 的名字,通常用来标识这个 Deployment 实例。namespace
: 指定 Deployment 所在的命名空间,这里是dtmtask-project_env
。
spec: replicas: 1 selector: matchLabels: app: project_name-project_env template: metadata: labels: app: project_name-project_env spec: nodeSelector: environment: dtm-project_env containers: - name: project_name-project_env image: project_images_url lifecycle: postStart: exec: command: - /bin/sh - -c - | chown -R www-data.www-data /data/logs /data/webapps /data/cache ports: - containerPort: 80 resources: limits: memory: "1Gi" cpu: "1" requests: memory: "256Mi" cpu: "100m" terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /data/logs/svc/nginx name: nginx-error-log - mountPath: /data/logs/access/project_name name: nginx-access-log - mountPath: /data/logs/svc/php name: php-error-log - mountPath: /data/logs/app/project_name name: app-log - mountPath: /data/cache/project_name name: cache imagePullSecrets: - name: aliyun-registry-secret volumes: - hostPath: path: /data/logs/svc/nginx type: '' name: nginx-error-log - hostPath: path: /data/logs/access/project_name type: '' name: nginx-access-log - hostPath: path: /data/logs/app/project_name type: "" name: app-log - hostPath: path: /data/logs/svc/php type: "" name: php-error-log - hostPath: path: /data/cache/project_name type: "" name: cache
标签:project,name,解读,yaml,log,env,deployment,data,logs From: https://www.cnblogs.com/suyj/p/18357652