csantanapr closed pull request #193: Flatten and simplify Helm charts URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/193
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/Chart.yaml b/helm/Chart.yaml index c6d25f3..4a3f712 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -5,5 +5,5 @@ version: 0.1.0 keywords: - Apache OpenWhisk maintainers: - - name: Tom Xing - email: [email protected] + - name: Apache OpenWhisk committers + email: [email protected] diff --git a/helm/charts/couchdb/Chart.yaml b/helm/charts/couchdb/Chart.yaml deleted file mode 100644 index 9ee0613..0000000 --- a/helm/charts/couchdb/Chart.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -description: A Helm chart to deploy couchdb service for Kubernetes -name: couchdb -version: 0.1.0 -keywords: - - couchdb -maintainers: - - name: Tom Xing - email: [email protected] diff --git a/helm/charts/couchdb/templates/NOTES.txt b/helm/charts/couchdb/templates/NOTES.txt deleted file mode 100644 index c011009..0000000 --- a/helm/charts/couchdb/templates/NOTES.txt +++ /dev/null @@ -1,11 +0,0 @@ - - - -Thank you for installing {{ .Chart.Name }}. - -Your release is named {{ .Release.Name }}. - -To learn more about the release, try: - - $ helm status {{ .Release.Name }} - $ helm get {{ .Release.Name }} diff --git a/helm/charts/couchdb/templates/_helpers.tpl b/helm/charts/couchdb/templates/_helpers.tpl deleted file mode 100644 index 3cfb249..0000000 --- a/helm/charts/couchdb/templates/_helpers.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* Set Couchdb service name */}} -{{- define "couchdb_service_name" -}} -{{ .Values.global.couchdbServiceName | default "couchdb" | quote }} -{{- end -}} - -{{/* Set Couchdb port */}} -{{- define "couchdb_port" -}} -{{ .Values.global.couchdbPort | default 5984 }} -{{- end -}} - -{{/* Set Couchdb deployment name */}} -{{- define "couchdb_deployment_name" -}} -{{ .Values.deploymentName | default "couchdb" | quote }} -{{- end -}} - -{{/* Set Couchdb PVC name */}} -{{- define "couchdb_pvc_name" -}} -{{ .Values.pvcName | default "couchdb-pvc" | quote }} -{{- end -}} diff --git a/helm/charts/couchdb/templates/deployment.yaml b/helm/charts/couchdb/templates/deployment.yaml deleted file mode 100644 index a98775a..0000000 --- a/helm/charts/couchdb/templates/deployment.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "couchdb_deployment_name" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - name: {{ template "couchdb_deployment_name" . }} -spec: - replicas: {{ .Values.replicaCount | default 1 }} - template: - metadata: - labels: - name: {{ template "couchdb_deployment_name" . }} - spec: - restartPolicy: Always - - {{- if .Values.global.affinity.enabled }} - affinity: -{{ include "affinity.controlPlane" . | indent 8 }} -{{ include "affinity.selfAntiAffinity" ( include "couchdb_deployment_name" . ) | indent 8 }} - {{- end }} - - containers: - - name: {{ template "couchdb_deployment_name" . }} - imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" | quote }} - image: {{ .Values.image | default "openwhisk/kube-couchdb" | quote }} - command: ["/init.sh"] - ports: - - name: couchdb - containerPort: {{ template "couchdb_port" .}} - env: - - name: "DB_HOST" - value: "127.0.0.1" - - name: "DB_PREFIX" - value: {{ .Values.dbPrefix | default "test_" | quote }} - - name: "COUCHDB_USER" - value: {{ .Values.global.couchdbUserName | default "whisk_admin" | quote }} - - name: "COUCHDB_PASSWORD" - value: {{ .Values.global.couchdbPassword | default "some_passw0rd" | quote }} - - name: "DB_PORT" - value: {{ include "couchdb_port" . | quote }} - - name: "NODENAME" - value: "couchdb0" - readinessProbe: - httpGet: - port: {{ template "couchdb_port" . }} - path: /{{ template "activations_table_unquoted" . }} - initialDelaySeconds: 60 - periodSeconds: 10 - failureThreshold: 10 - timeoutSeconds: 1 - {{- if .Values.persistence.enabled }} - volumeMounts: - - name: database-storage - mountPath: /usr/local/var/lib/couchdb - {{- end }} - {{- if .Values.persistence.enabled }} - volumes: - - name: database-storage - persistentVolumeClaim: - claimName: couchdb-pvc - {{- end }} - diff --git a/helm/charts/couchdb/templates/pv.yaml b/helm/charts/couchdb/templates/pv.yaml deleted file mode 100644 index 4570714..0000000 --- a/helm/charts/couchdb/templates/pv.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: couchdb-pv - labels: - type: couchdb - namespace: openwhisk -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - capacity: - storage: {{ .Values.persistence.size | quote }} - nfs: - path: {{ .Values.persistence.nfs_path }} - server: {{ .Values.persistence.nfs_server }} -{{- end }} diff --git a/helm/charts/couchdb/templates/pvc.yaml b/helm/charts/couchdb/templates/pvc.yaml deleted file mode 100644 index d3a9684..0000000 --- a/helm/charts/couchdb/templates/pvc.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "couchdb_pvc_name" . }} - labels: - type: couchdb - namespace: {{ .Release.Namespace | quote }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end }} diff --git a/helm/charts/couchdb/templates/service.yaml b/helm/charts/couchdb/templates/service.yaml deleted file mode 100644 index 2fae8bd..0000000 --- a/helm/charts/couchdb/templates/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "couchdb_service_name" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - name: {{ template "couchdb_service_name" . }} -spec: - selector: - name: {{ template "couchdb_service_name" . }} - ports: - - port: {{ template "couchdb_port" . }} - targetPort: {{ template "couchdb_port" . }} - name: couchdb diff --git a/helm/charts/kafka/Chart.yaml b/helm/charts/kafka/Chart.yaml deleted file mode 100755 index 7b1d9b7..0000000 --- a/helm/charts/kafka/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -description: A Helm chart to deploy kafka service for Kubernetes -name: kafka -version: 0.1.0 -keywords: - - zookeeper - - kafka -maintainers: - - name: Tom Xing - email: [email protected] diff --git a/helm/charts/kafka/templates/NOTES.txt b/helm/charts/kafka/templates/NOTES.txt deleted file mode 100644 index 29863d3..0000000 --- a/helm/charts/kafka/templates/NOTES.txt +++ /dev/null @@ -1,8 +0,0 @@ -Thank you for installing {{ .Chart.Name }}. - -Your release is named {{ .Release.Name }}. - -To learn more about the release, try: - - $ helm status {{ .Release.Name }} - $ helm get {{ .Release.Name }} diff --git a/helm/charts/kafka/templates/_helpers.tpl b/helm/charts/kafka/templates/_helpers.tpl deleted file mode 100644 index 1c39467..0000000 --- a/helm/charts/kafka/templates/_helpers.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* Get statefulset name */}} -{{- define "kafka_statefulset_name" -}} -{{ .Values.statefulsetName | default "kafka" | quote }} -{{- end -}} - -{{/* Get service name */}} -{{- define "kafka_service_name" -}} -{{ .Values.global.kafkaServiceName | default "kafka" | quote }} -{{- end -}} - -{{/* Generate Zookeeper service address */}} -{{- define "zookeeper_service_address" -}} -{{ .Values.global.zookeeperServiceName }}.{{ .Release.Namespace }}:{{ .Values.global.zookeeperPort }} -{{- end -}} - -{{/* Get kafka port */}} -{{- define "kafka_port" -}} -{{ .Values.global.kafkaPort | default 9092 }} -{{- end -}} diff --git a/helm/charts/kafka/templates/service.yaml b/helm/charts/kafka/templates/service.yaml deleted file mode 100644 index d7f00cb..0000000 --- a/helm/charts/kafka/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka_service_name" . }} - namespace: {{ .Release.Namespace | quote }} -spec: - ports: - - name: broker - port: {{ template "kafka_port" . }} - selector: - app: {{ template "kafka_statefulset_name" . }} diff --git a/helm/charts/kafka/templates/statefulset.yaml b/helm/charts/kafka/templates/statefulset.yaml deleted file mode 100644 index 33681e0..0000000 --- a/helm/charts/kafka/templates/statefulset.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1beta1 -kind: StatefulSet -metadata: - name: {{ template "kafka_statefulset_name" . }} - namespace: {{ .Release.Namespace | quote }} -spec: - serviceName: {{ template "kafka_service_name" . }} - replicas: {{ .Values.replicaCount | default 1 }} - template: - metadata: - labels: - app: {{ template "kafka_statefulset_name" . }} - spec: - {{- if .Values.global.affinity.enabled }} - affinity: -{{ include "affinity.controlPlane" . | indent 8 }} -{{ include "affinity.selfAntiAffinity" ( include "kafka_statefulset_name" . ) | indent 8 }} - {{- end }} - - initContainers: -{{ include "readiness.waitForZookeeper" . | indent 6 }} - - containers: - - name: {{ template "kafka_statefulset_name" . }} - image: {{ .Values.image | default "wurstmeister/kafka:0.11.0.1" | quote }} - imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" | quote }} - ports: - - containerPort: {{ template "kafka_port" . }} - name: kafka - env: - - name: "KAFKA_BROKER_ID" - value: "0" - - name: "KAFKA_ADVERTISED_HOST_NAME" - value: {{ template "kafka_statefulset_name" . }} - - name: "KAFKA_ADVERTISED_PORT" - value: "{{ template "kafka_port" .}}" - - name: "KAFKA_HOST_NAME" - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: "KAFKA_PORT" - value: "{{ template "kafka_port" .}}" - - # zookeeper info - - name: "KAFKA_ZOOKEEPER_CONNECT" - value: {{ include "zookeeper_service_address" . | quote }} diff --git a/helm/charts/nginx/Chart.yaml b/helm/charts/nginx/Chart.yaml deleted file mode 100644 index e464e5a..0000000 --- a/helm/charts/nginx/Chart.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -description: A Helm chart to deploy nginx service for Kubernetes -name: nginx -version: 0.1.0 -keywords: - - nginx -maintainers: - - name: Tom Xing - email: [email protected] diff --git a/helm/charts/nginx/templates/NOTES.txt b/helm/charts/nginx/templates/NOTES.txt deleted file mode 100644 index 29863d3..0000000 --- a/helm/charts/nginx/templates/NOTES.txt +++ /dev/null @@ -1,8 +0,0 @@ -Thank you for installing {{ .Chart.Name }}. - -Your release is named {{ .Release.Name }}. - -To learn more about the release, try: - - $ helm status {{ .Release.Name }} - $ helm get {{ .Release.Name }} diff --git a/helm/charts/nginx/templates/_helpers.tpl b/helm/charts/nginx/templates/_helpers.tpl deleted file mode 100644 index 520c523..0000000 --- a/helm/charts/nginx/templates/_helpers.tpl +++ /dev/null @@ -1,49 +0,0 @@ -{ Generate controller url */}} -{{- define "controller_url" -}} -http://{{ .Values.global.controllerStatefulSetName | default "controller" }}-0.{{ .Values.global.controllerServiceName | default "controller" }}.{{ .Release.Namespace }}:{{ .Values.global.controllerPort | default 8080 }} -{{- end -}} - -{ Generate controller url witout port */}} -{{- define "controller_url_without_port" -}} -{{ .Values.global.controllerStatefulSetName | default "controller" }}-0.{{ .Values.global.controllerServiceName | default "controller" }}.{{ .Release.Namespace }} -{{- end -}} - -{{/* Set deployment name */}} -{{- define "nginx_deployment_name" -}} -{{ .Values.deploymentName | default "nginx" | quote }} -{{- end -}} - -{{/* Set service name */}} -{{- define "nginx_service_name" -}} -{{ .Values.serviceName | default "nginx" | quote }} -{{- end -}} - -{{/* Set secret name */}} -{{- define "nginx_secret_name" -}} -{{ .Values.secretName | default "nginx" | quote }} -{{- end -}} - -{{/* Set configmap name */}} -{{- define "nginx_configmap_name" -}} -{{ .Values.configmapName | default "nginx" | quote }} -{{- end -}} - -{{/* Set http port */}} -{{- define "nginx_http_port" -}} -{{ .Values.httpPort | default 80 }} -{{- end -}} - -{{/* Set https port */}} -{{- define "nginx_https_port" -}} -{{ .Values.httpsPort | default 443 }} -{{- end -}} - -{{/* Set https admin port */}} -{{- define "nginx_https_admin_port" -}} -{{ .Values.httpsAdminPort | default 8443 }} -{{- end -}} - -{{/* Set controller statefulset name */}} -{{- define "controller_statefulset_name" -}} -{{ .Values.global.controllerStatefulSetName | default "controller" }} -{{- end -}} diff --git a/helm/charts/nginx/templates/deployment.yaml b/helm/charts/nginx/templates/deployment.yaml deleted file mode 100644 index d0a7ad0..0000000 --- a/helm/charts/nginx/templates/deployment.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "nginx_deployment_name" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - name: nginx -spec: - replicas: {{ .Values.replicaCount | default 1 }} - template: - metadata: - labels: - name: {{ template "nginx_deployment_name" . }} - spec: - restartPolicy: Always - - {{- if .Values.global.affinity.enabled }} - affinity: -{{ include "affinity.controlPlane" . | indent 8 }} -{{ include "affinity.selfAntiAffinity" ( include "nginx_deployment_name" . ) | indent 8 }} - {{- end }} - - volumes: - - name: nginx-certs - secret: - secretName: {{ template "nginx_secret_name" . }} - - name: nginx-conf - configMap: - name: {{ template "nginx_configmap_name" . }} - - name: logs - emptyDir: {} - - containers: - - name: {{ template "nginx_deployment_name" . }} - imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" | quote }} - image: {{ .Values.image | default "nginx:1.11" | quote }} - ports: - - name: http - containerPort: {{ template "nginx_http_port" . }} - - name: http-api - containerPort: {{ template "nginx_https_port" . }} - - name: https-admin - containerPort: {{ template "nginx_https_admin_port" . }} - volumeMounts: - - name: nginx-conf - mountPath: "/etc/nginx/nginx.conf" - subPath: "nginx.conf" - - name: nginx-certs - mountPath: "/etc/nginx/certs" - - name: logs - mountPath: "/logs" diff --git a/helm/charts/nginx/templates/service.yaml b/helm/charts/nginx/templates/service.yaml deleted file mode 100644 index 0fe2dae..0000000 --- a/helm/charts/nginx/templates/service.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "nginx_service_name" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - name: {{ template "nginx_service_name" . }} -spec: - type: NodePort - selector: - name: {{ template "nginx_deployment_name" . }} - ports: - - port: {{ template "nginx_http_port" . }} - targetPort: {{ template "nginx_http_port" . }} - {{- if .Values.httpNodePort }} - nodePort: {{ .Values.httpNodePort }} - {{- end }} - name: http - - port: {{ template "nginx_https_port" . }} - targetPort: {{ template "nginx_https_port" . }} - {{- if .Values.httpsNodePort }} - nodePort: {{ .Values.httpsNodePort }} - {{- end }} - name: https-api - - port: {{ template "nginx_https_admin_port" . }} - targetPort: {{ template "nginx_https_admin_port" . }} - {{- if .Values.httpsAdminNodePort }} - nodePort: {{ .Values.httpsAdminNodePort }} - {{- end }} - name: https-admin diff --git a/helm/charts/zookeeper/Chart.yaml b/helm/charts/zookeeper/Chart.yaml deleted file mode 100644 index c951bd8..0000000 --- a/helm/charts/zookeeper/Chart.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -description: A Helm chart to deploy zookeeper service for Kubernetes -name: zookeeper -version: 0.1.0 -keywords: - - zookeeper -maintainers: - - name: Tom Xing - email: [email protected] diff --git a/helm/charts/zookeeper/templates/NOTES.txt b/helm/charts/zookeeper/templates/NOTES.txt deleted file mode 100644 index 29863d3..0000000 --- a/helm/charts/zookeeper/templates/NOTES.txt +++ /dev/null @@ -1,8 +0,0 @@ -Thank you for installing {{ .Chart.Name }}. - -Your release is named {{ .Release.Name }}. - -To learn more about the release, try: - - $ helm status {{ .Release.Name }} - $ helm get {{ .Release.Name }} diff --git a/helm/charts/zookeeper/templates/_helpers.tpl b/helm/charts/zookeeper/templates/_helpers.tpl deleted file mode 100644 index 47f54d8..0000000 --- a/helm/charts/zookeeper/templates/_helpers.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* Get deployment name */}} -{{- define "zookeeper_deployment_name" -}} -{{ .Values.deploymentName | default "zookeeper" | quote }} -{{- end -}} - -{{/* Get service name */}} -{{- define "zookeeper_service_name" -}} -{{ .Values.global.zookeepserServiceName | default "zookeeper" | quote }} -{{- end -}} - -{{/* Set zookeeper port */}} -{{- define "zookeeper_port" -}} -{{ .Values.global.zookeeperPort | default 2181 }} -{{- end -}} - -{{/* Set server port */}} -{{- define "zookeeper_server_port" -}} -{{ .Values.serverPort | default 2888 }} -{{- end -}} - -{{/* Set leader election port */}} -{{- define "zookeeper_leader_election_port" -}} -{{ .Values.leaderElectionPort | default 3888 }} -{{- end -}} diff --git a/helm/charts/zookeeper/templates/deployment.yaml b/helm/charts/zookeeper/templates/deployment.yaml deleted file mode 100644 index 40f01d5..0000000 --- a/helm/charts/zookeeper/templates/deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "zookeeper_deployment_name" . }} - namespace: {{ .Release.Namespace | default "openwhisk" | quote}} - labels: - name: {{ template "zookeeper_deployment_name" . }} -spec: - replicas: {{ .Values.replicaCount | default 1}} - template: - metadata: - labels: - name: {{ template "zookeeper_deployment_name" . }} - spec: - restartPolicy: {{ .Values.restartPolicy | default "Always" | quote }} - - {{- if .Values.global.affinity.enabled }} - affinity: -{{ include "affinity.controlPlane" . | indent 8 }} -{{ include "affinity.selfAntiAffinity" ( include "zookeeper_deployment_name" . ) | indent 8 }} - {{- end }} - - containers: - - name: {{ .Values.containerName | default "zookeeper" | quote }} - image: {{ .Values.image | default "zookeeper:3.4" | quote }} - imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" | quote }} - ports: - - name: zookeeper - containerPort: {{ template "zookeeper_port" . }} - - name: server - containerPort: {{ template "zookeeper_server_port" . }} - - name: leader-election - containerPort: {{ template "zookeeper_leader_election_port" . }} diff --git a/helm/charts/zookeeper/templates/service.yaml b/helm/charts/zookeeper/templates/service.yaml deleted file mode 100644 index 44ed5cc..0000000 --- a/helm/charts/zookeeper/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "zookeeper_service_name" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - name: {{ template "zookeeper_service_name" . }} -spec: - selector: - name: {{ template "zookeeper_deployment_name" . }} - ports: - - port: {{ template "zookeeper_port" . }} - targetPort: {{ template "zookeeper_port" . }} - name: "zookeeper" - - port: {{ template "zookeeper_server_port" .}} - targetPort: {{ template "zookeeper_server_port" . }} - name: "server" - - port: {{ template "zookeeper_leader_election_port" . }} - targetPort: {{ template "zookeeper_leader_election_port" . }} - name: "leader-election" diff --git a/helm/templates/_affinity.tpl b/helm/templates/_affinity.tpl index 6f12a73..8f3267d 100644 --- a/helm/templates/_affinity.tpl +++ b/helm/templates/_affinity.tpl @@ -11,7 +11,7 @@ nodeAffinity: - key: openwhisk-role operator: NotIn values: - - {{ .Values.global.affinity.invokerNodeLabel }} + - {{ .Values.affinity.invokerNodeLabel }} # prefer to run on a control-plane node nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: @@ -21,13 +21,13 @@ nodeAffinity: - key: openwhisk-role operator: In values: - - {{ .Values.global.affinity.controlPlaneNodeLabel }} + - {{ .Values.affinity.controlPlaneNodeLabel }} {{- end -}} {{/* Invoker node affinity */}} {{- define "affinity.invoker" -}} -# run only on nodes labeled with openwhisk-role={{ .Values.global.affinity.invokerNodeLabel }} +# run only on nodes labeled with openwhisk-role={{ .Values.affinity.invokerNodeLabel }} nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: @@ -35,7 +35,7 @@ nodeAffinity: - key: openwhisk-role operator: In values: - - {{ .Values.global.affinity.invokerNodeLabel }} + - {{ .Values.affinity.invokerNodeLabel }} {{- end -}} diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index d938c46..17ffa4c 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -1,92 +1,96 @@ {{/* Set controller service name */}} {{- define "controller_service_name" -}} -{{ .Values.global.controllerServiceName | default "controller" | quote }} +{{ .Values.controller.serviceName | quote }} {{- end -}} {{/* Set controller statefulset name */}} {{- define "controller_statefulset_name" -}} -{{ .Values.global.controllerStatefulSetName | default "controller" | quote }} +{{ .Values.controller.statefulSetName | quote }} {{- end -}} {{/* Set controller port */}} {{- define "controller_port" -}} -{{ .Values.global.controllerPort | default 8080 }} +{{ .Values.controller.port }} {{- end -}} {{/* Set activations table */}} {{- define "activations_table" -}} -{{ .Values.activationsTable | default "test_activations" | quote }} +{{ .Values.db.activationsTable | quote }} {{- end -}} {{/* Set activations table */}} {{- define "activations_table_unquoted" -}} -{{ .Values.activationsTable | default "test_activations" }} +{{ .Values.db.activationsTable }} {{- end -}} {{/* Set actions table */}} {{- define "actions_table" -}} -{{ .Values.actionsTable | default "test_whisks" | quote }} +{{ .Values.db.actionsTable | quote }} {{- end -}} {{/* Set auths table */}} {{- define "auths_table" -}} -{{ .Values.authTable | default "test_subjects" | quote }} +{{ .Values.db.authsTable | quote }} {{- end -}} {{/* Set invoker "deployment" name */}} {{- define "invoker_deployment_name" -}} -{{ .Values.invokerDeploymentName | default "invoker" | quote }} +{{ .Values.invokerDeploymentName | quote }} {{- end -}} {{/* Generate kafka url without port */}} {{- define "kafka_url_without_port" -}} -{{ .Values.global.kafkaServiceName | default "kafka" }}.{{ .Release.Namespace }} +{{ .Values.kafka.serviceName }}.{{ .Release.Namespace }} {{- end -}} +{{/* Generate Zookeeper service address */}} +{{- define "zookeeper_service_address" -}} +{{ .Values.zookeeper.serviceName }}.{{ .Release.Namespace }}:{{ .Values.zookeeper.port }} +{{- end -}} {{/* Set Couchdb user name */}} {{- define "couchdb_username" -}} -{{ .Values.global.couchdbUserName | default "whisk_admin" | quote }} +{{ .Values.db.auth.username | quote }} {{- end -}} {{/* Set Couchdb password */}} {{- define "couchdb_password" -}} -{{ .Values.global.couchdbPassword | default "some_passw0rd" | quote }} +{{ .Values.db.auth.password | quote }} {{- end -}} {{/* Generate Couchdb url without port */}} {{- define "couchdb_url_without_port" -}} -{{ .Values.global.couchdbServiceName | default "couchdb" }}.{{ .Release.Namespace }} +{{ .Values.db.serviceName }}.{{ .Release.Namespace }} {{- end -}} {{/* Set Couchdb port */}} {{- define "couchdb_port" -}} -{{ .Values.global.couchdb_port | default 5984 }} +{{ .Values.db.port }} {{- end -}} {{/* Set API Gateway service name */}} {{- define "apigateway_service_name" -}} -{{ .Values.serviceName | default "apigateway" | quote }} +{{ .Values.apigw.serviceName | quote }} {{- end -}} {{/* Set API Gateway management port */}} {{- define "apigateway_mgmt_port" -}} -{{ .Values.mgmtPort | default 8080 }} +{{ .Values.apigw.mgmtPort }} {{- end -}} {{/* Set API Gateway API port */}} {{- define "apigateway_api_port" -}} -{{ .Values.apiPort | default 9000 }} +{{ .Values.apigw.apiPort }} {{- end -}} {{/* Set API Gateway deployment name */}} {{- define "apigateway_deployment_name" -}} -{{ .Values.deploymentName | default "apigateway" | quote }} +{{ .Values.apigw.deploymentName | quote }} {{- end -}} {{/* Runtimes manifest */}} {{- define "runtimes_manifest" -}} -{{- if .Values.global.travis -}} +{{- if .Values.travis -}} {{ .Files.Get "runtimes-minimal-travis.json" | quote }} {{- else -}} {{ .Files.Get "runtimes.json" | quote }} diff --git a/helm/templates/_readiness.tpl b/helm/templates/_readiness.tpl index 3f9c844..ac094b6 100644 --- a/helm/templates/_readiness.tpl +++ b/helm/templates/_readiness.tpl @@ -5,7 +5,7 @@ imagePullPolicy: "IfNotPresent" env: - name: "READINESS_URL" - value: http://{{ .Values.global.couchdbServiceName }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.global.couchdbPort }}/{{ template "activations_table_unquoted" . }} + value: http://{{ .Values.db.serviceName }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.db.port }}/{{ template "activations_table_unquoted" . }} command: ["sh", "-c", "result=1; until [ $result -eq 0 ]; do echo verifying CouchDB readiness; wget -T 5 --spider $READINESS_URL; result=$?; sleep 1; done;"] {{- end -}} @@ -15,7 +15,7 @@ image: "busybox" imagePullPolicy: "IfNotPresent" # TODO: I haven't found an easy external test to determine that kafka is up, so as a hack we wait for zookeeper and then sleep for 10 seconds and cross our fingers! - command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ .Values.global.zookeeperServiceName}}.{{ .Release.Namespace }}.svc.cluster.local {{ template "zookeeper_port" . }}); if [ "$OK" == "imok" ]; then result=0; fi; echo waiting for zookeeper to be ready; sleep 1; done; echo zookeeper is up, sleeping for 10 seconds; sleep 10;'] + command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ .Values.zookeeper.serviceName}}.{{ .Release.Namespace }}.svc.cluster.local {{ .Values.zookeeper.port }}); if [ "$OK" == "imok" ]; then result=0; fi; echo waiting for zookeeper to be ready; sleep 1; done; echo zookeeper is up, sleeping for 10 seconds; sleep 10;'] {{- end -}} {{/* Init container that waits for zookeeper to be ready */}} @@ -23,7 +23,7 @@ - name: "wait-for-zookeeper" image: "busybox" imagePullPolicy: "IfNotPresent" - command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ .Values.global.zookeeperServiceName}}.{{ .Release.Namespace }}.svc.cluster.local {{ template "zookeeper_port" . }}); if [ "$OK" == "imok" ]; then result=0; fi; echo waiting for zookeeper to be ready; sleep 1; done'] + command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ .Values.zookeeper.serviceName}}.{{ .Release.Namespace }}.svc.cluster.local {{ .Values.zookeeper.port }}); if [ "$OK" == "imok" ]; then result=0; fi; echo waiting for zookeeper to be ready; sleep 1; done'] {{- end -}} {{/* Init container that waits for controller to be ready */}} @@ -33,6 +33,6 @@ imagePullPolicy: "IfNotPresent" env: - name: "READINESS_URL" - value: http://{{ .Values.global.controllerServiceName }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.global.controllerPort }}/ping + value: http://{{ .Values.controller.serviceName }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.controller.port }}/ping command: ["sh", "-c", "result=1; until [ $result -eq 0 ]; do echo verifying controller readiness; wget -T 5 --spider $READINESS_URL; result=$?; sleep 1; done;"] {{- end -}} diff --git a/helm/templates/apigateway_deployment.yaml b/helm/templates/apigateway.yaml similarity index 87% rename from helm/templates/apigateway_deployment.yaml rename to helm/templates/apigateway.yaml index d3d5c63..727f18b 100644 --- a/helm/templates/apigateway_deployment.yaml +++ b/helm/templates/apigateway.yaml @@ -26,7 +26,7 @@ metadata: labels: name: {{ template "apigateway_deployment_name" . }} spec: - replicas: {{ .Values.apigatewayReplicaCount | default 1 }} + replicas: {{ .Values.apigatewayReplicaCount }} template: metadata: labels: @@ -34,7 +34,7 @@ spec: spec: restartPolicy: Always - {{- if .Values.global.affinity.enabled }} + {{- if .Values.affinity.enabled }} affinity: {{ include "affinity.controlPlane" . | indent 8 }} {{ include "affinity.selfAntiAffinity" ( include "apigateway_deployment_name" . ) | indent 8 }} @@ -42,12 +42,12 @@ spec: containers: - name: redis - imagePullPolicy: {{ .Values.apigatewayImagePullPolicy | default "IfNotPresent" | quote }} + imagePullPolicy: {{ .Values.apigatewayImagePullPolicy | quote }} image: redis:3.2 - name: apigateway - imagePullPolicy: {{ .Values.apigatewayImagePullPolicy | default "IfNotPresent" | quote }} - image: {{ .Values.apigatewayImage | default "openwhisk/apigateway" | quote }} + imagePullPolicy: {{ .Values.apigatewayImagePullPolicy | quote }} + image: {{ .Values.apigatewayImage | quote }} ports: - name: mgmt containerPort: {{ template "apigateway_mgmt_port" . }} diff --git a/helm/templates/controller_statefulset.yaml b/helm/templates/controller.yaml similarity index 73% rename from helm/templates/controller_statefulset.yaml rename to helm/templates/controller.yaml index aea535f..2dc649a 100644 --- a/helm/templates/controller_statefulset.yaml +++ b/helm/templates/controller.yaml @@ -22,7 +22,7 @@ metadata: labels: name: {{ template "controller_statefulset_name" . }} spec: - replicas: {{ .Values.global.controllerReplicaCount | default 2 }} + replicas: {{ .Values.controllerReplicaCount }} serviceName: {{ template "controller_service_name" . }} template: metadata: @@ -31,7 +31,7 @@ spec: spec: restartPolicy: Always - {{- if .Values.global.affinity.enabled }} + {{- if .Values.affinity.enabled }} affinity: {{ include "affinity.controlPlane" . | indent 8 }} {{ include "affinity.selfAntiAffinity" ( include "controller_statefulset_name" . ) | indent 8 }} @@ -44,8 +44,8 @@ spec: containers: - name: {{ template "controller_statefulset_name" . }} - imagePullPolicy: {{ .Values.controllerImagePullPolicy | default "IfNotPresent" | quote }} - image: {{ .Values.controllerImage | default "openwhisk/controller" | quote }} + imagePullPolicy: {{ .Values.controller.imagePullPolicy | quote }} + image: {{ .Values.controller.image | quote }} command: ["/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /init.sh `hostname | cut -d'-' -f2`"] ports: - name: controller @@ -85,9 +85,9 @@ spec: # Kafka properties - name: "KAFKA_HOSTS" - value: {{ include "kafka_url_without_port" . }}:{{ .Values.global.kafkaPort | default 9092 }} + value: {{ include "kafka_url_without_port" . }}:{{ .Values.kafka.port }} - name: "KAFKA_HOST_PORT" - value: {{ .Values.global.kafkaPort | default 9092 | quote }} + value: {{ .Values.kafka.port | quote }} # specific controller arguments - name: "CONTROLLER_OPTS" @@ -97,23 +97,23 @@ spec: {{ include "whisk.dbEnvVars" . | indent 8 }} - name: "LIMITS_ACTIONS_SEQUENCE_MAXLENGTH" - value: {{ .Values.controllerLimitsActionsSequenceMaxlength | default 1000 | quote }} + value: {{ .Values.controller.limits.actionsSequenceMaxlength | quote }} - name: "LIMITS_TRIGGERS_FIRES_PERMINUTE" - value: {{ .Values.controllerLimitsTriggersFiresPerminute | default 100 | quote }} + value: {{ .Values.controller.limits.triggersFiresPerminute | quote }} - name: "LIMITS_ACTIONS_INVOKES_PERMINUTE" - value: {{ .Values.controllerLimitsActionsInvokesPerminute | default 100 | quote }} + value: {{ .Values.controller.limits.actionsInvokesPerminute | quote }} - name: "LIMITS_ACTIONS_INVOKES_CONCURRENTINSYSTEM" - value: {{ .Values.controllerLimitsActionsInvokesConcurrentinsystem | default 100 | quote }} + value: {{ .Values.controller.limits.actionsInvokesConcurrentinsystem | quote }} - name: "LIMITS_ACTIONS_INVOKES_CONCURRENT" - value: {{ .Values.controllerLimitsActionsInvokesConcurrent | default 100 | quote }} + value: {{ .Values.controller.limits.actionsInvokesConcurrent | quote }} - name: "CONTROLLER_INSTANCES" - value: {{ .Values.global.controllerReplicaCount | default 2 | quote }} + value: {{ .Values.controller.replicaCount | quote }} - name: "CONTROLLER_LOCALBOOKKEEPING" - value: {{ .Values.controllerLocalbookkeeping | default false | quote }} + value: {{ .Values.controller.localbookkeeping | quote }} - name: "AKKA_CLUSTER_SEED_NODES" - value: {{ .Values.controllerSeedNodes | default "[]" | quote }} + value: {{ .Values.controller.seedNodes | quote }} - name: "CONTROLLER_HA" - value: {{ .Values.controllerHA | default false | quote }} + value: {{ .Values.controller.HA | quote }} - name: "CONFIG_akka_actor_provider" value: "cluster" diff --git a/helm/templates/couchdb.yaml b/helm/templates/couchdb.yaml new file mode 100644 index 0000000..bedb55b --- /dev/null +++ b/helm/templates/couchdb.yaml @@ -0,0 +1,122 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.db.serviceName | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + name: {{ .Values.db.serviceName | quote }} +spec: + selector: + name: {{ .Values.db.serviceName | quote }} + ports: + - port: {{ .Values.db.port }} + targetPort: {{ .Values.db.port }} + name: couchdb + +{{- if and .Values.db.persistence.enabled (not .Values.db.persistence.existingClaim) }} +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: couchdb-pv + labels: + type: couchdb + namespace: openwhisk +spec: + accessModes: + - {{ .Values.db.persistence.accessMode | quote }} + capacity: + storage: {{ .Values.db.persistence.size | quote }} + nfs: + path: {{ .Values.db.persistence.nfs_path }} + server: {{ .Values.db.persistence.nfs_server }} +{{- end }} + + +{{- if and .Values.db.persistence.enabled (not .Values.db.persistence.existingClaim) }} +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.db.pvcName | quote }} + labels: + type: couchdb + namespace: {{ .Release.Namespace | quote }} +spec: + accessModes: + - {{ .Values.db.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.db.persistence.size | quote }} +{{- if .Values.db.persistence.storageClass }} +{{- if (eq "-" .Values.db.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.db.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} + +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Values.db.deploymentName | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + name: {{ .Values.db.deploymentName | quote }} +spec: + replicas: {{ .Values.db.replicaCount }} + template: + metadata: + labels: + name: {{ .Values.db.deploymentName | quote }} + spec: + restartPolicy: Always + + {{- if .Values.affinity.enabled }} + affinity: +{{ include "affinity.controlPlane" . | indent 8 }} +{{ include "affinity.selfAntiAffinity" ( .Values.db.deploymentName ) | indent 8 }} + {{- end }} + + containers: + - name: {{ .Values.db.deploymentName | quote }} + imagePullPolicy: {{ .Values.db.imagePullPolicy | quote }} + image: {{ .Values.db.image | quote }} + command: ["/init.sh"] + ports: + - name: couchdb + containerPort: {{ .Values.db.port }} + env: + - name: "DB_HOST" + value: "127.0.0.1" + - name: "DB_PREFIX" + value: {{ .Values.db.dbPrefix | quote }} + - name: "COUCHDB_USER" + value: {{ .Values.db.auth.username | quote }} + - name: "COUCHDB_PASSWORD" + value: {{ .Values.db.auth.password | quote }} + - name: "DB_PORT" + value: {{ .Values.db.port | quote }} + - name: "NODENAME" + value: "couchdb0" + readinessProbe: + httpGet: + port: {{ .Values.db.port }} + path: /{{ template "activations_table_unquoted" . }} + initialDelaySeconds: 60 + periodSeconds: 10 + failureThreshold: 10 + timeoutSeconds: 1 + {{- if .Values.db.persistence.enabled }} + volumeMounts: + - name: database-storage + mountPath: /usr/local/var/lib/couchdb + {{- end }} + {{- if .Values.db.persistence.enabled }} + volumes: + - name: database-storage + persistentVolumeClaim: + claimName: couchdb-pvc + {{- end }} diff --git a/helm/templates/invoker_daemonset.yaml b/helm/templates/invoker.yaml similarity index 89% rename from helm/templates/invoker_daemonset.yaml rename to helm/templates/invoker.yaml index 7b34d14..39a78e6 100644 --- a/helm/templates/invoker_daemonset.yaml +++ b/helm/templates/invoker.yaml @@ -48,8 +48,8 @@ spec: containers: - name: {{ template "invoker_deployment_name" . }} - imagePullPolicy: {{ .Values.invokerImagePullPolicy | default "IfNotPresent" | quote }} - image: {{ .Values.invokerImage | default "openwhisk/invoker" | quote }} + imagePullPolicy: {{ .Values.invokerImagePullPolicy | quote }} + image: {{ .Values.invokerImage | quote }} command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /init.sh"] resources: requests: @@ -107,11 +107,11 @@ spec: # properties for kafka connection - name: "KAFKA_HOSTS" - value: "{{ .Values.global.kafkaServiceName }}.{{ .Release.Namespace }}:{{ .Values.global.kafkaPort | default 9092 }}" + value: "{{ .Values.kafka.serviceName }}.{{ .Release.Namespace }}:{{ .Values.kafka.port }}" # properties for zookeeper connection - name: "ZOOKEEPER_HOSTS" - value: "{{ .Values.global.zookeeperServiceName }}.{{ .Release.Namespace }}:{{ .Values.global.zookeeperPort | default 2181 }}" + value: "{{ .Values.zookeeper.serviceName }}.{{ .Release.Namespace }}:{{ .Values.zookeeper.port }}" ports: - name: invoker diff --git a/helm/templates/kafka.yaml b/helm/templates/kafka.yaml new file mode 100644 index 0000000..a885d6a --- /dev/null +++ b/helm/templates/kafka.yaml @@ -0,0 +1,59 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.kafka.serviceName | quote }} + namespace: {{ .Release.Namespace | quote }} +spec: + ports: + - name: broker + port: {{ .Values.kafka.port }} + selector: + app: {{ .Values.kafka.statefulsetName | quote }} + +--- +apiVersion: apps/v1beta1 +kind: StatefulSet +metadata: + name: {{ .Values.kafka.statefulsetName | quote }} + namespace: {{ .Release.Namespace | quote }} +spec: + serviceName: {{ .Values.kafka.serviceName | quote }} + replicas: {{ .Values.kafka.replicaCount }} + template: + metadata: + labels: + app: {{ .Values.kafka.statefulsetName | quote }} + spec: + {{- if .Values.affinity.enabled }} + affinity: +{{ include "affinity.controlPlane" . | indent 8 }} +{{ include "affinity.selfAntiAffinity" ( .Values.kafka.statefulsetName | quote ) | indent 8 }} + {{- end }} + + initContainers: +{{ include "readiness.waitForZookeeper" . | indent 6 }} + + containers: + - name: {{ .Values.kafka.statefulsetName | quote }} + image: {{ .Values.kafka.image | quote }} + imagePullPolicy: {{ .Values.kafka.imagePullPolicy | quote }} + ports: + - containerPort: {{ .Values.kafka.port }} + name: kafka + env: + - name: "KAFKA_BROKER_ID" + value: "0" + - name: "KAFKA_ADVERTISED_HOST_NAME" + value: {{ .Values.kafka.statefulsetName | quote }} + - name: "KAFKA_ADVERTISED_PORT" + value: "{{ .Values.kafka.port }}" + - name: "KAFKA_HOST_NAME" + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: "KAFKA_PORT" + value: "{{ .Values.kafka.port }}" + + # zookeeper info + - name: "KAFKA_ZOOKEEPER_CONNECT" + value: {{ include "zookeeper_service_address" . | quote }} diff --git a/helm/templates/nginx.yaml b/helm/templates/nginx.yaml new file mode 100644 index 0000000..6b806a3 --- /dev/null +++ b/helm/templates/nginx.yaml @@ -0,0 +1,83 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.nginx.serviceName | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + name: {{ .Values.nginx.serviceName | quote }} +spec: + type: NodePort + selector: + name: {{ .Values.nginx.deploymentName | quote }} + ports: + - port: {{ .Values.nginx.httpPort }} + targetPort: {{ .Values.nginx.httpPort }} + {{- if .Values.nginx.httpNodePort }} + nodePort: {{ .Values.nginx.httpNodePort }} + {{- end }} + name: http + - port: {{ .Values.nginx.httpsPort }} + targetPort: {{ .Values.nginx.httpsPort }} + {{- if .Values.nginx.httpsNodePort }} + nodePort: {{ .Values.nginx.httpsNodePort }} + {{- end }} + name: https-api + - port: {{ .Values.nginx.httpsAdminPort }} + targetPort: {{ .Values.nginx.httpsAdminPort }} + {{- if .Values.nginx.httpsAdminNodePort }} + nodePort: {{ .Values.nginx.httpsAdminNodePort }} + {{- end }} + name: https-admin + +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Values.nginx.deploymentName | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + name: nginx +spec: + replicas: {{ .Values.nginx.replicaCount }} + template: + metadata: + labels: + name: {{ .Values.nginx.deploymentName | quote }} + spec: + restartPolicy: Always + + {{- if .Values.affinity.enabled }} + affinity: +{{ include "affinity.controlPlane" . | indent 8 }} +{{ include "affinity.selfAntiAffinity" ( .Values.nginx.deploymentName | quote ) | indent 8 }} + {{- end }} + + volumes: + - name: nginx-certs + secret: + secretName: {{ .Values.nginx.secretName | quote }} + - name: nginx-conf + configMap: + name: {{ .Values.nginx.configmapName | quote }} + - name: logs + emptyDir: {} + + containers: + - name: {{ .Values.nginx.deploymentName | quote }} + imagePullPolicy: {{ .Values.nginx.imagePullPolicy | quote }} + image: {{ .Values.nginx.image | quote }} + ports: + - name: http + containerPort: {{ .Values.nginx.httpPort }} + - name: http-api + containerPort: {{ .Values.nginx.httpsPort }} + - name: https-admin + containerPort: {{ .Values.nginx.httpsAdminPort }} + volumeMounts: + - name: nginx-conf + mountPath: "/etc/nginx/nginx.conf" + subPath: "nginx.conf" + - name: nginx-certs + mountPath: "/etc/nginx/certs" + - name: logs + mountPath: "/logs" diff --git a/helm/charts/nginx/templates/configmap.yaml b/helm/templates/nginx_configmap.yaml similarity index 98% rename from helm/charts/nginx/templates/configmap.yaml rename to helm/templates/nginx_configmap.yaml index cc4d45a..482ee7b 100644 --- a/helm/charts/nginx/templates/configmap.yaml +++ b/helm/templates/nginx_configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "nginx_configmap_name" . }} + name: {{ .Values.nginx.configmapName | quote }} namespace: {{ .Release.Namespace | quote }} data: nginx.conf: | diff --git a/helm/charts/nginx/templates/secret.yaml b/helm/templates/nginx_secret.yaml similarity index 98% rename from helm/charts/nginx/templates/secret.yaml rename to helm/templates/nginx_secret.yaml index a79dc20..baf7429 100644 --- a/helm/charts/nginx/templates/secret.yaml +++ b/helm/templates/nginx_secret.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "nginx_secret_name" . }} + name: {{ .Values.nginx.secretName | quote }} namespace: {{ .Release.Namespace | quote }} type: tls data: diff --git a/helm/templates/zookeeper.yaml b/helm/templates/zookeeper.yaml new file mode 100644 index 0000000..6adb712 --- /dev/null +++ b/helm/templates/zookeeper.yaml @@ -0,0 +1,55 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.zookeeper.serviceName | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + name: {{ .Values.zookeeper.serviceName | quote }} +spec: + selector: + name: {{ .Values.zookeeper.deploymentName | quote }} + ports: + - port: {{ .Values.zookeeper.port }} + targetPort: {{ .Values.zookeeper.port }} + name: "zookeeper" + - port: {{ .Values.zookeeper.serverPort }} + targetPort: {{ .Values.zookeeper.serverPort }} + name: "server" + - port: {{ .Values.zookeeper.leaderElectionPort }} + targetPort: {{ .Values.zookeeper.leaderElectionPort }} + name: "leader-election" + +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Values.zookeeper.deploymentName | quote }} + namespace: {{ .Release.Namespace | quote}} + labels: + name: {{ .Values.zookeeper.deploymentName | quote }} +spec: + replicas: {{ .Values.zookeeper.replicaCount }} + template: + metadata: + labels: + name: {{ .Values.zookeeper.deploymentName | quote }} + spec: + restartPolicy: {{ .Values.zookeeper.restartPolicy | quote }} + + {{- if .Values.affinity.enabled }} + affinity: +{{ include "affinity.controlPlane" . | indent 8 }} +{{ include "affinity.selfAntiAffinity" ( .Values.zookeeper.deploymentName | quote ) | indent 8 }} + {{- end }} + + containers: + - name: {{ .Values.zookeeper.containerName | quote }} + image: {{ .Values.zookeeper.image | quote }} + imagePullPolicy: {{ .Values.zookeeper.imagePullPolicy | quote }} + ports: + - name: zookeeper + containerPort: {{ .Values.zookeeper.port }} + - name: server + containerPort: {{ .Values.zookeeper.serverPort }} + - name: leader-election + containerPort: {{ .Values.zookeeper.leaderElectionPort }} diff --git a/helm/values.yaml b/helm/values.yaml index 7cdb21d..a47ef08 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -2,8 +2,12 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -# cluster configuration +# Overall system configuration whisk: + # You must provide these ingress values when deploying the chart + ingress: + api_host: nil + apigw_url: nil # Production deployments _MUST_ override these default auth values auth: system: "789c46b1-71f6-4ed5-8c54-816aa4f8c502:abczO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP" @@ -11,33 +15,46 @@ whisk: versions: cli: "latest" systemNameSpace: "/whisk.system" - ingress: + +travis: false # zookeeper configurations zookeeper: deploymentName: "zookeeper" + serviceName: "zookeeper" replicaCount: 1 restartPolicy: "Always" containerName: "zookeeper" image: "zookeeper:3.4" imagePullPolicy: "IfNotPresent" + port: 2181 serverPort: 2888 leaderElectionPort: 3888 # kafka configurations kafka: + serviceName: "kafka" statefulsetName: "kafka" replicaCount: 1 image: "wurstmeister/kafka:0.11.0.1" imagePullPolicy: "IfNotPresent" + port: 9092 -# Couchdb configurations -couchdb: +# Database configuration +db: deploymentName: "couchdb" - replicaCount: 1 + serviceName: "couchdb" + replicaCount: 1 imagePullPolicy: "IfNotPresent" image: "openwhisk/kube-couchdb" + port: 5984 + auth: + username: "whisk_admin" + password: "some_passw0rd" dbPrefix: "test_" + activationsTable: "test_activations" + actionsTable: "test_whisks" + authsTable: "test_subjects" persistence: enabled: false pvcName: couchdb-pvc @@ -45,7 +62,6 @@ couchdb: storageClass: CouchDBSC accessMode: ReadWriteOnce - # Nginx configurations nginx: secretName: "nginx" @@ -63,48 +79,42 @@ nginx: serviceName: "nginx" # Controller configurations -controllerImagePullPolicy: "IfNotPresent" -controllerImage: "openwhisk/controller" -controllerLimitsActionsInvokesConcurrentinsystem: 100 -controllerLimitsTriggersFiresPerminute: 100 -controllerLimitsActionsSequenceMaxlength: 1000 -controllerLimitsActionsInvokesConcurrent: 100 -controllerLimitsActionsInvokesConcurrentinsystem: 100 -controllerLocalbookkeeping: true -controllerSeedNodes: "[]" -controllerHA: false +controller: + serviceName: "controller" + statefulSetName: "controller" + replicaCount: 1 + imagePullPolicy: "IfNotPresent" + image: "openwhisk/controller" + port: 8080 + limits: + actionsSequenceMaxlength: 50 + triggersFiresPerminute: 60 + actionsInvokesPerminute: 60 + actionsInvokesConcurrentinsystem: 5000 + actionsInvokesConcurrent: 30 + localbookkeeping: true + seedNodes: "[]" + HA: false # Invoker configurations -invokerStatefulsetName: "invoker" +invokerDeploymentName: "invoker" invokerReplicasetCount: 1 invokerImagePullPolicy: "IfNotPresent" invokerImage: "openwhisk/invoker" invokerOptions: "" # API Gateway configurations +apigatewayImagePullPolicy: "IfNotPresent" +apigatewayImage: "openwhisk/apigateway" apigatewayReplicaCount: 1 +apigw: + deploymentName: "apigateway" + serviceName: "apigateway" + apiPort: 9000 + mgmtPort: 8080 -activationsTable: "test_activations" -actionsTable: "test_whisks" -authsTable: "test_subjects" - -# Global configurations -global: - zookeeperServiceName: "zookeeper" - kafkaServiceName: "kafka" - zookeeperPort: 2181 - kafkaPort: 9092 - couchdbServiceName: "couchdb" - couchdbInstances: 1 - couchdbPort: 5984 - controllerStatefulSetName: "controller" - controllerServiceName: "controller" - controllerPort: 8080 - controllerReplicaCount: 1 - couchdbUserName: "whisk_admin" - couchdbPassword: "some_passw0rd" - # Resolve the pod/node affinity for invoker, controller and other components. - affinity: - enabled: true - invokerNodeLabel: invoker - controlPlaneNodeLabel: control-plane +# Resolve the pod/node affinity for invoker, controller and other components. +affinity: + enabled: true + invokerNodeLabel: invoker + controlPlaneNodeLabel: control-plane diff --git a/tools/travis/build-helm.sh b/tools/travis/build-helm.sh index 495f7fc..4d22f95 100755 --- a/tools/travis/build-helm.sh +++ b/tools/travis/build-helm.sh @@ -143,6 +143,8 @@ wsk property set --auth `cat $ROOTDIR/kubernetes/cluster-setup/auth.guest` --api cd $ROOTDIR/helm cat > mycluster.yaml <<EOF +travis: true + whisk: ingress: api_host: $WSK_HOST:$WSK_PORT ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
