|
| 1 | +apiVersion: v1 |
| 2 | +kind: Service |
| 3 | +metadata: |
| 4 | + name: {{ .Release.Name }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | +spec: |
| 7 | + selector: |
| 8 | + app: {{ .Release.Name }} |
| 9 | + ports: |
| 10 | + - port: {{ .Values.PORT }} |
| 11 | + targetPort: {{ .Values.PORT }} |
| 12 | + name: nodejs |
| 13 | +--- |
| 14 | + |
| 15 | +apiVersion: apps/v1 |
| 16 | +kind: Deployment |
| 17 | +metadata: |
| 18 | + name: {{ .Release.Name }} |
| 19 | + namespace: {{ .Release.Namespace }} |
| 20 | + labels: |
| 21 | + app: {{ .Release.Name }} |
| 22 | +spec: |
| 23 | + replicas: {{ .Values.REPLICAS }} |
| 24 | + strategy: |
| 25 | + rollingUpdate: |
| 26 | + maxSurge: 0 |
| 27 | + maxUnavailable: 1 |
| 28 | + selector: |
| 29 | + matchLabels: |
| 30 | + app: {{ .Release.Name }} |
| 31 | + template: |
| 32 | + metadata: |
| 33 | + labels: |
| 34 | + app: {{ .Release.Name }} |
| 35 | + redis-client: 'true' |
| 36 | + spec: |
| 37 | + affinity: |
| 38 | + podAffinity: |
| 39 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 40 | + - labelSelector: |
| 41 | + matchExpressions: |
| 42 | + - key: app.kubernetes.io/name |
| 43 | + operator: In |
| 44 | + values: |
| 45 | + - ingress-nginx |
| 46 | + namespaces: |
| 47 | + - ingress-nginx |
| 48 | + topologyKey: kubernetes.io/hostname |
| 49 | + podAntiAffinity: |
| 50 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 51 | + - labelSelector: |
| 52 | + matchExpressions: |
| 53 | + - key: app |
| 54 | + operator: In |
| 55 | + values: |
| 56 | + - {{ .Release.Name }} |
| 57 | + namespaces: |
| 58 | + - {{ .Release.Namespace }} |
| 59 | + topologyKey: kubernetes.io/hostname |
| 60 | + - labelSelector: |
| 61 | + matchExpressions: |
| 62 | + - key: app |
| 63 | + operator: In |
| 64 | + values: |
| 65 | + - cloud-screenshot |
| 66 | + namespaces: |
| 67 | + - dc-screenshot |
| 68 | + topologyKey: kubernetes.io/hostname |
| 69 | + containers: |
| 70 | + - name: {{ .Release.Name }} |
| 71 | + env: |
| 72 | + - name: NODE_NAME |
| 73 | + valueFrom: |
| 74 | + fieldRef: |
| 75 | + fieldPath: spec.nodeName |
| 76 | + - name: DEEPHIVE_PATH |
| 77 | + value: {{ .Values.INSTALL_PATH | squote }} |
| 78 | + - name: VIRTUAL_HOST |
| 79 | + value: {{ .Values.VIRTUAL_HOST | squote }} |
| 80 | + - name: DEEPHIVE_REPO_URL |
| 81 | + value: {{ .Values.DEEPHIVE_REPO_URL | squote }} |
| 82 | + - name: IMAGE_VERSION |
| 83 | + value: {{ .Values.DEEPHIVE_VERSION | squote }} |
| 84 | + - name: GIT_REF |
| 85 | + value: {{ .Values.GIT_REF | squote }} |
| 86 | + |
| 87 | + image: {{ .Values.DEEPHIVE_IMAGE | squote }} |
| 88 | + livenessProbe: |
| 89 | + httpGet: |
| 90 | + path: /healthz |
| 91 | + port: {{ .Values.PORT }} |
| 92 | + scheme: HTTP |
| 93 | + periodSeconds: 30 |
| 94 | + ports: |
| 95 | + - name: nodejs |
| 96 | + containerPort: {{ .Values.PORT }} |
| 97 | + readinessProbe: |
| 98 | + httpGet: |
| 99 | + path: /healthz |
| 100 | + port: {{ .Values.PORT }} |
| 101 | + scheme: HTTP |
| 102 | + periodSeconds: 10 |
| 103 | + resources: |
| 104 | + requests: |
| 105 | + cpu: 100m |
| 106 | + memory: 100Mi |
| 107 | + limits: |
| 108 | + cpu: '2' |
| 109 | + memory: {{ .Values.MEMORY_LIMIT | squote }} |
| 110 | + startupProbe: |
| 111 | + exec: |
| 112 | + command: |
| 113 | + - cat |
| 114 | + - {{ .Values.INSTALL_PATH }}/dist/healthz |
| 115 | + failureThreshold: 30 |
| 116 | + periodSeconds: 10 |
| 117 | + volumeMounts: |
| 118 | + - name: wordpress |
| 119 | + mountPath: /srv |
| 120 | + - name: config |
| 121 | + mountPath: /config |
| 122 | + readOnly: true |
| 123 | + tolerations: |
| 124 | + - key: node.kubernetes.io/disk-pressure |
| 125 | + operator: Exists |
| 126 | + effect: NoSchedule |
| 127 | + - key: node.kubernetes.io/memory-pressure |
| 128 | + operator: Exists |
| 129 | + effect: NoSchedule |
| 130 | + - key: node.kubernetes.io/pid-pressure |
| 131 | + operator: Exists |
| 132 | + effect: NoSchedule |
| 133 | + volumes: |
| 134 | + - name: wordpress |
| 135 | + hostPath: |
| 136 | + path: /srv |
| 137 | + type: DirectoryOrCreate |
| 138 | + - name: config |
| 139 | + secret: |
| 140 | + secretName: secrets |
0 commit comments