From 36cd284e3f7902d2478669fdea0d8a1825dc1876 Mon Sep 17 00:00:00 2001 From: Donislav Belev Date: Wed, 10 Jun 2020 11:16:48 +0300 Subject: [PATCH] Add EKS delivery configs --- ...-elasticsearch-reindexer_eks_delivery.yaml | 10 +++ ...content-rw-elasticsearch_eks_delivery.yaml | 10 +++ .../templates/deployment.yaml | 72 ++++++++++--------- helm/content-rw-elasticsearch/values.yaml | 1 + 4 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch-reindexer_eks_delivery.yaml create mode 100644 helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch_eks_delivery.yaml diff --git a/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch-reindexer_eks_delivery.yaml b/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch-reindexer_eks_delivery.yaml new file mode 100644 index 0000000..eab1f76 --- /dev/null +++ b/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch-reindexer_eks_delivery.yaml @@ -0,0 +1,10 @@ +# Values used for the deployed application. +replicaCount: 0 +service: + name: content-rw-elasticsearch-reindexer +eksCluster: true +env: + KAFKA_TOPIC: ForcedCombinedPostPublicationEvents + KAFKA_CONCURRENT_PROCESSING: true + PUBLIC_CONCORDANCES_ENDPOINT: http://public-concordances-api:8080 + INTERNAL_CONTENT_API_URL: http://internal-content-api:8080 diff --git a/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch_eks_delivery.yaml b/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch_eks_delivery.yaml new file mode 100644 index 0000000..c56b9ad --- /dev/null +++ b/helm/content-rw-elasticsearch/app-configs/content-rw-elasticsearch_eks_delivery.yaml @@ -0,0 +1,10 @@ +# Values used for the deployed application. +replicaCount: 2 +service: + name: content-rw-elasticsearch +eksCluster: true +env: + KAFKA_TOPIC: CombinedPostPublicationEvents + KAFKA_CONCURRENT_PROCESSING: false + PUBLIC_CONCORDANCES_ENDPOINT: http://public-concordances-api:8080 + INTERNAL_CONTENT_API_URL: http://internal-content-api:8080 diff --git a/helm/content-rw-elasticsearch/templates/deployment.yaml b/helm/content-rw-elasticsearch/templates/deployment.yaml index 12d1336..8e35806 100644 --- a/helm/content-rw-elasticsearch/templates/deployment.yaml +++ b/helm/content-rw-elasticsearch/templates/deployment.yaml @@ -1,22 +1,26 @@ +{{- if .Values.eksCluster }} +apiVersion: apps/v1 +{{- else }} apiVersion: extensions/v1beta1 +{{- end }} kind: Deployment metadata: - name: {{ .Values.service.name }} + name: {{ .Values.service.name }} labels: chart: "{{ .Chart.Name | trunc 63 }}" - chartVersion: "{{ .Chart.Version | trunc 63 }}" - visualize: "true" - app: {{ .Values.service.name }} + chartVersion: "{{ .Chart.Version | trunc 63 }}" + visualize: "true" + app: {{ .Values.service.name }} spec: - replicas: {{ .Values.replicaCount }} - selector: + replicas: {{ .Values.replicaCount }} + selector: matchLabels: app: {{ .Values.service.name }} template: metadata: labels: app: {{ .Values.service.name }} - visualize: "true" + visualize: "true" spec: affinity: podAntiAffinity: @@ -29,25 +33,25 @@ spec: - {{ .Values.service.name }} topologyKey: "kubernetes.io/hostname" containers: - - name: {{ .Values.service.name }} + - name: {{ .Values.service.name }} image: "{{ .Values.image.repository }}:{{ .Chart.Version }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: ELASTICSEARCH_SAPI_ENDPOINT - valueFrom: - configMapKeyRef: - name: global-config + env: + - name: ELASTICSEARCH_SAPI_ENDPOINT + valueFrom: + configMapKeyRef: + name: global-config key: aws.content.elasticsearch.endpoint - - name: KAFKA_CONSUMER_GROUP - value: "k8s-{{ .Values.service.name }}" - - name: KAFKA_TOPIC + - name: KAFKA_CONSUMER_GROUP + value: "k8s-{{ .Values.service.name }}" + - name: KAFKA_TOPIC value: {{ .Values.env.KAFKA_TOPIC }} - - name: KAFKA_CONCURRENT_PROCESSING + - name: KAFKA_CONCURRENT_PROCESSING value: "{{ .Values.env.KAFKA_CONCURRENT_PROCESSING }}" - - name: KAFKA_PROXY_ADDR - valueFrom: - configMapKeyRef: - name: global-config + - name: KAFKA_PROXY_ADDR + valueFrom: + configMapKeyRef: + name: global-config key: kafka.proxy.url.with.protocol - name: AWS_ACCESS_KEY_ID valueFrom: @@ -68,18 +72,18 @@ spec: configMapKeyRef: name: global-config key: api.host.with.protocol - ports: - - containerPort: 8080 - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 10 - readinessProbe: - httpGet: - path: "/__gtg" - port: 8080 - initialDelaySeconds: 15 - periodSeconds: 30 - resources: + ports: + - containerPort: 8080 + livenessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 10 + readinessProbe: + httpGet: + path: "/__gtg" + port: 8080 + initialDelaySeconds: 15 + periodSeconds: 30 + resources: {{ toYaml .Values.resources | indent 12 }} diff --git a/helm/content-rw-elasticsearch/values.yaml b/helm/content-rw-elasticsearch/values.yaml index 726d1a7..f0c6035 100644 --- a/helm/content-rw-elasticsearch/values.yaml +++ b/helm/content-rw-elasticsearch/values.yaml @@ -4,6 +4,7 @@ service: name: "" # The name of the service, should be defined in the specific app-configs folder. hasHealthcheck: "true" +eksCluster: false replicaCount: 2 image: repository: coco/content-rw-elasticsearch