| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| {{- if .Values.providers.kafka.enabled }} |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: {{ .Release.Name }}-kafkaprovider |
| labels: |
| name: {{ .Release.Name }}-kafkaprovider |
| {{ include "openwhisk.label_boilerplate" . | indent 4 }} |
| spec: |
| replicas: {{ .Values.providers.kafka.replicaCount }} |
| selector: |
| matchLabels: |
| name: {{ .Release.Name }}-kafkaprovider |
| template: |
| metadata: |
| labels: |
| name: {{ .Release.Name }}-kafkaprovider |
| {{ include "openwhisk.label_boilerplate" . | indent 8 }} |
| spec: |
| restartPolicy: {{ .Values.providers.kafka.restartPolicy }} |
| initContainers: |
| # Wait for a controller to be up (which implies couchdb and kafka are up as well). |
| {{ include "openwhisk.readiness.waitForController" . | indent 6 }} |
| {{ include "openwhisk.docker.imagePullSecrets" . | indent 6 }} |
| containers: |
| - name: kafkaprovider |
| image: "{{- .Values.docker.registry.name -}}{{- .Values.providers.kafka.imageName -}}:{{- .Values.providers.kafka.imageTag -}}" |
| imagePullPolicy: {{ .Values.providers.kafka.imagePullPolicy | quote }} |
| ports: |
| - name: kafkaprovider |
| containerPort: {{ .Values.providers.kafka.apiPort }} |
| env: |
| {{- if .Values.providers.db.external }} |
| # Config database using the external instance |
| - name: "DB_URL" |
| value: {{ .Values.providers.db.protocol }}://{{ .Values.providers.db.host }}:{{ .Values.providers.db.port }} |
| - name: "DB_USER" |
| value: {{ .Values.providers.db.username | quote }} |
| - name: "DB_PASS" |
| value: {{ .Values.providers.db.password | quote }} |
| {{- else }} |
| # Config database using the same openwhisk couchdb instance |
| - name: "DB_URL" |
| valueFrom: |
| configMapKeyRef: |
| name: {{ .Release.Name }}-db.config |
| key: db_url |
| - name: "DB_USER" |
| valueFrom: |
| secretKeyRef: |
| name: {{ .Release.Name }}-db.auth |
| key: db_username |
| - name: "DB_PASS" |
| valueFrom: |
| secretKeyRef: |
| name: {{ .Release.Name }}-db.auth |
| key: db_password |
| {{- end }} |
| - name: "DB_PREFIX" |
| value: {{ .Values.providers.kafka.dbPrefix | quote }} |
| - name: "LOCAL_DEV" |
| value: "true" |
| - name: "ROUTER_HOST" |
| valueFrom: |
| configMapKeyRef: |
| name: {{ .Release.Name }}-whisk.config |
| key: whisk_internal_api_host_nameAndPort |
| - name: "ENDPOINT_AUTH" |
| valueFrom: |
| configMapKeyRef: |
| name: {{ .Release.Name }}-whisk.config |
| key: whisk_internal_api_host_nameAndPort |
| {{- end }} |