You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/06/15 15:09:51 UTC

[GitHub] dgrove-oss closed pull request #223: Deploy Kafka package and provider with Helm

dgrove-oss closed pull request #223: Deploy Kafka package and provider with Helm
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/223
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/helm/templates/installPkgKafkaJob.yaml b/helm/templates/installPkgKafkaJob.yaml
new file mode 100644
index 0000000..73c52d8
--- /dev/null
+++ b/helm/templates/installPkgKafkaJob.yaml
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements; and to You under the Apache License, Version 2.0.
+
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: install-package-kafka
+  namespace: {{ .Release.Namespace | quote }}
+spec:
+  activeDeadlineSeconds: 600
+  template:
+    metadata:
+      name: install-package-kafka
+    spec:
+      restartPolicy: Never
+      initContainers:
+      # Wait for a controller to be up so we can perfom our CRUD actions with the CLI
+{{ include "readiness.waitForController" . | indent 6 }}
+      containers:
+      - name: kafkapkginstaller
+        image: openwhisk/kube-kafkapkginstaller
+        env:
+          - name: "AUTH"
+            valueFrom:
+              secretKeyRef:
+                name: whisk.auth
+                key: system
+          # poorly named envvar; actually expects full apihost (host:port)
+          - name: "APIHOST"
+            value: "{{- .Values.whisk.ingress.api_host_name -}}:{{- .Values.whisk.ingress.api_host_port -}}"
+          # for the database used by kafka package
+          - name: "DB_HOST"
+            value: {{ include "db_host" . | quote }}
+          - name: "DB_PORT"
+            value: {{ .Values.db.port | quote}}
+          - name: "DB_USERNAME"
+            valueFrom:
+              secretKeyRef:
+                name: db.auth
+                key: db_username
+          - name: "DB_PASSWORD"
+            valueFrom:
+              secretKeyRef:
+                name: db.auth
+                key: db_password
+          - name: "DB_PREFIX"
+            value: "{{- .Values.kafkaprovider.dbPrefix -}}"
diff --git a/helm/templates/pkgKafkaProvider.yaml b/helm/templates/pkgKafkaProvider.yaml
new file mode 100644
index 0000000..c526d94
--- /dev/null
+++ b/helm/templates/pkgKafkaProvider.yaml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements; and to You under the Apache License, Version 2.0.
+
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: {{ .Values.kafkaprovider.name | quote }}
+  namespace: {{ .Release.Namespace | quote }}
+  labels:
+    name: nginx
+spec:
+  replicas: {{ .Values.kafkaprovider.replicaCount }}
+  template:
+    metadata:
+      labels:
+        name: {{ .Values.kafkaprovider.name | quote }}
+    spec:
+      restartPolicy: {{ .Values.kafkaprovider.restartPolicy }}
+      initContainers:
+      # The controller must wait for kafka and couchdb to be ready before it starts
+{{ include "readiness.waitForCouchDB" . | indent 6 }}
+
+      containers:
+      - name: {{ .Values.kafkaprovider.name | quote }}
+        imagePullPolicy: {{ .Values.kafkaprovider.imagePullPolicy | quote }}
+        image: {{ .Values.kafkaprovider.image | quote }}
+        ports:
+        - name: kafkaprovider
+          containerPort: {{ .Values.kafkaprovider.apiPort }}
+        env:
+        - name: "DB_URL"
+          value: "{{ .Values.db.protocol }}://{{ include "db_host" . }}:{{ .Values.db.port }}"
+        - name: "DB_USER"
+          valueFrom:
+            secretKeyRef:
+              name: db.auth
+              key: db_username
+        - name: "DB_PASS"
+          valueFrom:
+            secretKeyRef:
+              name: db.auth
+              key: db_password
+        - name: "DB_PREFIX"
+          value: "{{- .Values.kafkaprovider.dbPrefix -}}"
+        - name: "LOCAL_DEV"
+          value: "true"
+        - name: "ROUTER_HOST"
+          value: "{{- .Values.whisk.ingress.api_host_name -}}:{{- .Values.whisk.ingress.api_host_port -}}"
+        - name: "ENDPOINT_AUTH"
+          value: "{{- .Values.whisk.ingress.api_host_name -}}:{{- .Values.whisk.ingress.api_host_port -}}"
diff --git a/helm/values.yaml b/helm/values.yaml
index ff20a08..8fe37ea 100644
--- a/helm/values.yaml
+++ b/helm/values.yaml
@@ -198,3 +198,13 @@ affinity:
   edgeNodeLabel: edge
   invokerNodeLabel: invoker
   providerNodeLabel: provider
+
+# Kafka provider configurations
+kafkaprovider:
+  name: "kafkaprovider"
+  image: "openwhisk/kafkaprovider:latest"
+  replicaCount: 1
+  imagePullPolicy: "IfNotPresent"
+  restartPolicy: "Always"
+  apiPort: 8080
+  dbPrefix: "kp"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services