diff --git a/README.md b/README.md index a385328..f2a0533 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Generic helm chart for Energy Web Foundation microservices | Name | Email | Url | | ---- | ------ | --- | -| EWF DevOps Team | | | +| EWF DevOps Team | devops@energyweb.org | | ## Installing the chart @@ -37,7 +37,7 @@ pre-commit install-hooks | autoscaling.maxReplicas | int | `100` | | | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | -| containerPort | int | `80` | | +| container.ports.http | int | `80` | | | deploymentStrategy | string | `"RollingUpdate"` | | | env | object | `{}` | | | extraLabels | object | `{}` | Extra lables to be added to all resources | @@ -47,6 +47,7 @@ pre-commit install-hooks | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"nginx"` | | | image.tag | string | `""` | | +| image.tty.enabled | bool | `true` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -87,7 +88,8 @@ pre-commit install-hooks | sealedSecret.enabled | bool | `false` | | | sealedSecret.encryptedData | object | `{}` | | | securityContext | object | `{}` | | -| service.port | int | `80` | | +| service.ports[0].name | string | `"http"` | | +| service.ports[0].port | int | `80` | | | service.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `true` | | diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 5e7448a..8163fed 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -8,7 +8,7 @@ spec: strategy: type: {{ .Values.deploymentStrategy }} {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: @@ -36,10 +36,16 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.image.tty.enabled }} + stdin: true + tty: true + {{- end }} ports: - - name: http - containerPort: {{ .Values.containerPort }} + {{- range $key, $value := $.Values.container.ports }} + - name: {{ $key }} + containerPort: {{ $value }} protocol: TCP + {{- end }} {{- with .Values.image.command }} command: {{- toYaml . | nindent 12 }} @@ -48,7 +54,7 @@ spec: args: {{- toYaml . | nindent 12 }} {{- end }} - env: + env: {{- range $key, $val := .Values.env }} - name: {{ $key }} value: {{ $val | quote }} @@ -63,22 +69,22 @@ spec: httpGet: path: {{ .Values.livenessProbe.httpGet.path }} port: {{ .Values.livenessProbe.httpGet.port }} - scheme: {{ .Values.readinessProbe.httpGet.scheme }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + scheme: {{ .Values.readinessProbe.httpGet.scheme }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} {{- end }} {{- if .Values.readinessProbe.enabled }} readinessProbe: httpGet: path: {{ .Values.readinessProbe.httpGet.path }} - port: {{ .Values.readinessProbe.httpGet.port }} - scheme: {{ .Values.readinessProbe.httpGet.scheme }} - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + port: {{ .Values.readinessProbe.httpGet.port }} + scheme: {{ .Values.readinessProbe.httpGet.scheme }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/templates/service.yaml b/templates/service.yaml index 1ace41b..f87088b 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -1,3 +1,4 @@ +{{ $servicePorts := .Values.service.ports }} apiVersion: v1 kind: Service metadata: @@ -7,9 +8,11 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http + {{- range $key, $value := $servicePorts }} + - port: {{ .port }} + targetPort: {{ .name }} protocol: TCP - name: http + name: {{ .name }} + {{- end }} selector: {{- include "microservice.selectorLabels" . | nindent 4 }} diff --git a/values.yaml b/values.yaml index 077e6e0..64e41a1 100644 --- a/values.yaml +++ b/values.yaml @@ -40,7 +40,9 @@ pvc: mountPath: "/tmp" -containerPort: 80 +container: + ports: + http: 80 image: repository: nginx @@ -49,6 +51,8 @@ image: tag: "" command: [] args: [] + tty: + enabled: false env: {} @@ -86,7 +90,9 @@ securityContext: {} service: type: ClusterIP - port: 80 + ports: + - port: 80 + name: http ingress: enabled: false