diff --git a/charts/snowplow-stream-collector/Chart.yaml b/charts/snowplow-stream-collector/Chart.yaml new file mode 100644 index 0000000..cf1c2a5 --- /dev/null +++ b/charts/snowplow-stream-collector/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +name: snowplow-stream-collector +description: A Helm Chart to deploy the Snowplow Stream Collector project +version: 0.1.0 +appVersion: "2.5.0" +icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png +home: https://github.com/snowplow-devops/helm-charts +sources: + - https://github.com/snowplow-devops/helm-charts + - https://github.com/snowplow/stream-collector +maintainers: + - name: jbeemster + url: https://github.com/jbeemster + email: jbeemster@users.noreply.github.com +keywords: + - snowplow + - pipeline + - collector + - schemas diff --git a/charts/snowplow-stream-collector/README.md b/charts/snowplow-stream-collector/README.md new file mode 100644 index 0000000..b6f8dd0 --- /dev/null +++ b/charts/snowplow-stream-collector/README.md @@ -0,0 +1,246 @@ +# snowplow-stream-collector + +A helm chart for [Snowplow Stream Collector](https://github.com/snowplow/stream-collector). + +## Installing the Chart + +Add the repository to Helm: + +```bash +helm repo add snowplow-devops https://snowplow-devops.github.io/helm-charts +``` + +Install or upgrading the chart with default configuration: + +```bash +helm upgrade --install snowplow-stream-collector snowplow-devops/snowplow-stream-collector +``` + +## Uninstalling the Chart + +To uninstall/delete the `snowplow-stream-collector` release: + +```bash +helm delete snowplow-stream-collector +``` + +## Deployment options + +The Collector is designed to run in the public cloud but can also be run in local distributions and has support for a wide-array of backends. This chart supports all of these available options. + +First determine the target you want to send data to and then build a valid config for the Collector - you can [view examples here](https://github.com/snowplow/stream-collector/tree/master/examples). The default installation writes everything to stdout. + +--- +*WARNING*: It is recommended to use `port = ${COLLECTOR_PORT}` in your config as then the chart can ensure the correct port is set in your configuration file. See the example configurations for how this looks. +--- + +#### Configure end2end TLS + +Due to a known issue in AkkaHTTP when handling TLS termination we now embed an NGINX proxy as an _optional_ side-car to the Collector - this replaces terminating TLS directly in the Collector itself and is the safer alternative for the moment. + +This also allows us to obfuscate the server being used for the Collector application itself. + +To enable TLS you will need to: + +1. Set `service.nginx.enable: true` +2. Set `service.ssl.enable: true` +3. Generate and pass both the certificate and private key in base64 encoded format in the appropriate fields + +The deployment will then be bound on the defined SSL port and will forward connections to the Collector side-car container directly. + +### On-premise deployment + +For fast testing and implementations where you do not care about integrating with public-cloud systems. + +#### Target: Stdout + +The simplest option is `stdout` which will send all events received directly to logging output: + +``` +helm upgrade --install snowplow-stream-collector . +``` + +#### Target: Kafka + +To test out Kafka support you can spin up a local cluster and then pipe data into it. We are using the `bitnami` chart to simplify the deployment: + +``` +# Deploy a default Kafka cluster +helm upgrade --install kafka bitnami/kafka + +# Deploy the collector sending data to Kafka +helm upgrade --install snowplow-stream-collector \ + --set service.config.hoconBase64=$(cat examples/kafka.hocon | base64) \ + --set service.image.target=kafka . +``` + +You can then setup your own Kafka consumer to pull down the data from created topics (good & bad). + +### GCP (GKE) settings + +#### Network Endpoint Group binding + +To manage the load balancer externally to the kubernetes cluster you can bind the deployment to dynamically assigned Network Endpoint Group (NEG). + +1. Set the NEG name: `service.gcp.networkEndpointGroupName: ` +2. This will create Zonal NEGs in your account automatically (do not proceed until the NEGs appear - check your deployment events if this doesn't happen!) +3. Create a Load Balancer as usual and map the NEGs created into your backend service (follow the `Create Load Balancer` flow in the GCP Console) + +_Note_: The HealthCheck you create should map to the same port you used for the service deployment. + +#### Target: PubSub + +To send data into PubSub you will need to bind a valid GCP service-account to the service deployment. In Terraform this looks something like the following: + +```hcl +resource "google_service_account" "snowplow_stream_collector" { + account_id = "snowplow-stream-collector" + display_name = "Snowplow Stream Collector service account" +} + +resource "google_service_account_iam_binding" "snowplow_stream_collector_sa_wiu_binding" { + role = "roles/iam.workloadIdentityUser" + members = [ + "serviceAccount:.svc.id.goog[default/snowplow-stream-collector]" + ] + service_account_id = google_service_account.snowplow_stream_collector.id +} + +resource "google_project_iam_member" "snowplow_stream_collector_sa_pubsub_viewer" { + role = "roles/pubsub.viewer" + member = "serviceAccount:${google_service_account.snowplow_stream_collector.email}" +} + +resource "google_project_iam_member" "snowplow_stream_collector_sa_pubsub_publisher" { + role = "roles/pubsub.publisher" + member = "serviceAccount:${google_service_account.snowplow_stream_collector.email}" +} + +output "snowplow_stream_collector_sa_account_email" { + value = google_service_account.snowplow_stream_collector.email +} +``` + +You can then use the resulting value as an input to `serviceAccount.gcp.serviceAccount` which will allow the deployment to access PubSub. + +You will need to fill these targeted fields: + +- `cloud: "gcp"` +- `serviceAccount.deploy: true` +- `serviceAccount.gcp.serviceAccount: ` + +### AWS (EKS) settings + +#### TargetGroup binding + +To manage the load balancer externally to the kubernetes cluster you can bind the deployment to an existing TargetGroup ARN. Its important that the TargetGroup exist ahead of time and that you use the same port as you have used in your `values.yaml`. + +_Note_: Before this will work you will need to install the `aws-load-balancer-controller-crds` and `aws-load-balancer-controller` charts into your EKS cluster. + +You will need to fill these targeted fields: + +- `cloud: "aws"` +- `service.aws.targetGroupARN: ""` + +#### Target: Kinesis and/or SQS + +To send data into Kinesis and/or SQS without hardcoded credentials you will need to bind a valid AWS IAM role ARN to the service deployment. In Terraform this looks something like the following: + +```hcl +resource "aws_iam_policy" "snowplow_stream_collector" { + name = "snowplow-stream-collector" + + policy = <` + +## Configuration + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| cloud | string | `""` | Cloud specific bindings (options: aws, gcp) | +| secrets.docker.email | string | `""` | Email address for user of the private repository | +| secrets.docker.name | string | `"dockerhub"` | Name of the secret to use for the private repository | +| secrets.docker.password | string | `""` | Password for the private repository | +| secrets.docker.server | string | `"https://index.docker.io/v1/"` | Repository server URL | +| secrets.docker.username | string | `""` | Username for the private repository | +| service.aws.targetGroupARN | string | `""` | EC2 TargetGroup ARN to bind the service onto | +| service.config.hoconBase64 | string | `""` | | +| service.config.javaOpts | string | `""` | | +| service.gcp.networkEndpointGroupName | string | `""` | Name of the Network Endpoint Group to bind onto (default: .Release.Name) | +| service.image.isRepositoryPublic | bool | `true` | | +| service.image.repository | string | `"snowplow/scala-stream-collector"` | | +| service.image.tag | string | `"2.5.0"` | | +| service.image.target | string | `"stdout"` | Which image should be pulled (options: stdout, nsq, kinesis, sqs, kafka or pubsub) | +| service.maxReplicas | int | `4` | | +| service.minReplicas | int | `1` | | +| service.nginx.deploy | bool | `false` | Whether to serve request with an NGINX proxy side-car instead of the Collector directly | +| service.nginx.image.isRepositoryPublic | bool | `true` | | +| service.nginx.image.repository | string | `"nginx"` | | +| service.nginx.image.tag | string | `"stable-alpine"` | | +| service.port | int | `8080` | HTTP port to bind and expose the service on | +| service.readinessProbe.failureThreshold | int | `3` | | +| service.readinessProbe.initialDelaySeconds | int | `5` | | +| service.readinessProbe.periodSeconds | int | `5` | | +| service.readinessProbe.successThreshold | int | `2` | | +| service.readinessProbe.timeoutSeconds | int | `5` | | +| service.ssl.certificateBase64 | string | `""` | Certificate in PEM form | +| service.ssl.certificatePrivateKeyBase64 | string | `""` | Certificate Private Key in PEM form | +| service.ssl.enable | bool | `false` | Whether to enable the TLS port (requires service.nginx.deploy to be true) | +| service.ssl.port | int | `8443` | HTTPS port to bind and expose the service on | +| service.targetCPUUtilizationPercentage | int | `75` | | +| service.terminationGracePeriodSeconds | int | `630` | | +| serviceAccount.aws.roleARN | string | `""` | IAM Role ARN to bind to the k8s service account | +| serviceAccount.deploy | bool | `false` | Whether to create a service-account | +| serviceAccount.gcp.serviceAccount | string | `""` | Service Account email to bind to the k8s service account | diff --git a/charts/snowplow-stream-collector/configs/collector.conf b/charts/snowplow-stream-collector/configs/collector.conf new file mode 100644 index 0000000..9cb640b --- /dev/null +++ b/charts/snowplow-stream-collector/configs/collector.conf @@ -0,0 +1,37 @@ +upstream ssc { + server localhost:{{ include "collector.port" . }}; +} + +server { + server_tokens off; + listen {{ .Values.service.port }}; + access_log /dev/null; + error_log /dev/null; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $http_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; + proxy_pass http://ssc; + } +} + +{{- if .Values.service.ssl.enable }} +server { + server_tokens off; + listen {{ .Values.service.ssl.port }}; + access_log /dev/null; + error_log /dev/null; + + ssl on; + ssl_certificate /etc/nginx/ssl/collector_cert.pem; + ssl_certificate_key /etc/nginx/ssl/collector_key.pem; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $http_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; + proxy_pass http://ssc; + } +} +{{- end }} diff --git a/charts/snowplow-stream-collector/configs/secretdocker.json b/charts/snowplow-stream-collector/configs/secretdocker.json new file mode 100644 index 0000000..99b9cae --- /dev/null +++ b/charts/snowplow-stream-collector/configs/secretdocker.json @@ -0,0 +1,10 @@ +{ + "auths":{ + "{{ .Values.secrets.docker.server }}":{ + "username":"{{ .Values.secrets.docker.username }}", + "password":"{{ .Values.secrets.docker.password }}", + "email":"{{ .Values.secrets.docker.email }}", + "auth":"{{ printf "%s:%s" .Values.secrets.docker.username .Values.secrets.docker.password | b64enc }}" + } + } +} diff --git a/charts/snowplow-stream-collector/examples/kafka.hocon b/charts/snowplow-stream-collector/examples/kafka.hocon new file mode 100644 index 0000000..44a8c73 --- /dev/null +++ b/charts/snowplow-stream-collector/examples/kafka.hocon @@ -0,0 +1,15 @@ +collector { + interface = "0.0.0.0" + port = ${COLLECTOR_PORT} + + streams { + good = "good" + bad = "bad" + + # Assumes you have a locally deployed Kafka cluster + # e.g. helm upgrade --install kafka bitnami/kafka + sink { + brokers = "kafka-0.kafka-headless.default.svc.cluster.local:9092" + } + } +} diff --git a/charts/snowplow-stream-collector/examples/stdout.hocon b/charts/snowplow-stream-collector/examples/stdout.hocon new file mode 100644 index 0000000..e690af2 --- /dev/null +++ b/charts/snowplow-stream-collector/examples/stdout.hocon @@ -0,0 +1,9 @@ +collector { + interface = "0.0.0.0" + port = ${COLLECTOR_PORT} + + streams { + good = "good" + bad = "bad" + } +} diff --git a/charts/snowplow-stream-collector/templates/NOTES.txt b/charts/snowplow-stream-collector/templates/NOTES.txt new file mode 100644 index 0000000..1355ae0 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/NOTES.txt @@ -0,0 +1,24 @@ +{{- if eq .Values.service.image.target "stdout" }} +------------------------------------------------------------------------------------------------------------------------ +WARNING: Your Collector is running in stdout mode which means all collected events are written directly to the pod logs. + In production you will need to target an external stream to persist events safely and allow for consumption by + downstream services like Snowplow Enrich. +------------------------------------------------------------------------------------------------------------------------ +{{- end }} + +The Collector can be accessed via port {{ .Values.service.port }} on the following DNS names from within your cluster: + + {{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local + +To connect to your server from outside the cluster execute the following commands: + + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Release.Name }} {{ .Values.service.port }}:{{ .Values.service.port }} + +You can check if the service is healthy by hitting the following endpoint: + + http://localhost:{{ .Values.service.port }}/health + +You can send a test event through (note: in stdout mode your events will land in the pod logs directly): + + http://localhost:{{ .Values.service.port }}/i?e=pv + http://localhost:{{ .Values.service.port }}/i diff --git a/charts/snowplow-stream-collector/templates/_helpers.tpl b/charts/snowplow-stream-collector/templates/_helpers.tpl new file mode 100644 index 0000000..b9b4a99 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Define default values for required values. +*/}} + +{{- define "service.targetCPUUtilizationPercentage" -}} +{{- mul .Values.service.targetCPUUtilizationPercentage .Values.service.minReplicas }} +{{- end -}} + +{{- define "service.gcp.networkEndpointGroupName" -}} +{{- default .Release.Name .Values.service.gcp.networkEndpointGroupName -}} +{{- end -}} + +{{- define "service.config.hoconBase64" -}} +{{- if eq .Values.service.config.hoconBase64 "" }} +{{- tpl (.Files.Get "examples/stdout.hocon") . | b64enc -}} +{{- else -}} +{{- .Values.service.config.hoconBase64 -}} +{{- end -}} +{{- end -}} + +{{- define "service.nginx.confBase64" -}} +{{- tpl (.Files.Get "configs/collector.conf") . | b64enc -}} +{{- end -}} + +{{- define "collector.port" -}} +{{- if .Values.service.nginx.deploy }} +{{- add .Values.service.port 1 -}} +{{- else -}} +{{- .Values.service.port -}} +{{- end -}} +{{- end -}} diff --git a/charts/snowplow-stream-collector/templates/collector-deployment.yaml b/charts/snowplow-stream-collector/templates/collector-deployment.yaml new file mode 100644 index 0000000..1aecd12 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/collector-deployment.yaml @@ -0,0 +1,130 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + annotations: + checksum/config.hocon: {{ include "service.config.hoconBase64" . | sha256sum}} + checksum/collector.conf: {{ include "service.nginx.confBase64" . | sha256sum}} + spec: + {{- if .Values.serviceAccount.deploy }} + serviceAccountName: {{ .Release.Name }} + {{- end }} + automountServiceAccountToken: true + terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }} + + {{- if not .Values.service.image.isRepositoryPublic }} + imagePullSecrets: + - name: {{ .Values.secrets.docker.name }} + {{- end }} + + volumes: + - configMap: + defaultMode: 420 + name: {{ .Release.Name }}-config-hocon + optional: false + name: {{ .Release.Name }}-config-volume + - configMap: + defaultMode: 420 + name: {{ .Release.Name }}-nginx-config-conf + optional: false + name: {{ .Release.Name }}-nginx-config-volume + {{- if .Values.service.ssl.enable }} + - configMap: + defaultMode: 420 + name: {{ .Release.Name }}-nginx-cert + optional: false + name: {{ .Release.Name }}-nginx-cert-volume + {{- end }} + + containers: + {{- if .Values.service.nginx.deploy }} + - name: {{ .Release.Name }}-nginx + image: {{ .Values.service.nginx.image.repository}}:{{ .Values.service.nginx.image.tag}} + imagePullPolicy: Always + + ports: + - containerPort: {{ .Values.service.port }} + protocol: TCP + {{- if .Values.service.ssl.enable }} + - containerPort: {{ .Values.service.ssl.port }} + protocol: TCP + {{- end }} + + readinessProbe: + httpGet: + path: /health + port: {{ .Values.service.port }} + scheme: HTTP + initialDelaySeconds: {{ .Values.service.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.service.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.service.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.service.readinessProbe.failureThreshold }} + successThreshold: {{ .Values.service.readinessProbe.successThreshold }} + + resources: + requests: + cpu: 100m + memory: 90Mi + + volumeMounts: + - mountPath: /etc/nginx/conf.d + mountPropagation: None + name: {{ .Release.Name }}-nginx-config-volume + {{- if .Values.service.ssl.enable }} + - mountPath: /etc/nginx/ssl + mountPropagation: None + name: {{ .Release.Name }}-nginx-cert-volume + {{- end }} + {{- end }} + + - name: {{ .Release.Name }}-collector + image: {{ .Values.service.image.repository}}-{{ .Values.service.image.target }}:{{ .Values.service.image.tag}} + imagePullPolicy: Always + + args: + - "--config" + - "/etc/config/config.hocon" + + {{- if not .Values.service.nginx.deploy }} + ports: + - containerPort: {{ include "collector.port" . }} + protocol: TCP + {{- end }} + + env: + - name : "COLLECTOR_PORT" + value: "{{ include "collector.port" . }}" + {{- if not (empty .Values.service.config.javaOpts) }} + - name : "JAVA_OPTS" + value: "{{ .Values.service.config.javaOpts }}" + {{- end }} + + readinessProbe: + httpGet: + path: /health + port: {{ include "collector.port" . }} + scheme: HTTP + initialDelaySeconds: {{ .Values.service.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.service.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.service.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.service.readinessProbe.failureThreshold }} + successThreshold: {{ .Values.service.readinessProbe.successThreshold }} + + resources: + limits: + memory: 2018Mi + requests: + cpu: 400m + + volumeMounts: + - mountPath: /etc/config + mountPropagation: None + name: {{ .Release.Name }}-config-volume diff --git a/charts/snowplow-stream-collector/templates/collector-hoconconfigmap.yaml b/charts/snowplow-stream-collector/templates/collector-hoconconfigmap.yaml new file mode 100644 index 0000000..1913358 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/collector-hoconconfigmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-config-hocon +binaryData: + config.hocon: {{ include "service.config.hoconBase64" . }} diff --git a/charts/snowplow-stream-collector/templates/collector-hpa.yaml b/charts/snowplow-stream-collector/templates/collector-hpa.yaml new file mode 100644 index 0000000..48f3c81 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/collector-hpa.yaml @@ -0,0 +1,12 @@ +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ .Release.Name }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ .Release.Name }} + minReplicas: {{ .Values.service.minReplicas }} + maxReplicas: {{ .Values.service.maxReplicas }} + targetCPUUtilizationPercentage: {{ include "service.targetCPUUtilizationPercentage" . }} diff --git a/charts/snowplow-stream-collector/templates/collector-service.yaml b/charts/snowplow-stream-collector/templates/collector-service.yaml new file mode 100644 index 0000000..706e28b --- /dev/null +++ b/charts/snowplow-stream-collector/templates/collector-service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + {{- if eq .Values.cloud "gcp" }} + annotations: + {{- if .Values.service.ssl.enable }} + cloud.google.com/app-protocols: '{"https-port": "HTTPS", "http-port": "HTTP"}' + cloud.google.com/neg: '{"exposed_ports": {"{{ .Values.service.ssl.port }}":{"name": "{{ include "service.gcp.networkEndpointGroupName" . }}"}}}' + {{- else }} + cloud.google.com/app-protocols: '{"http-port": "HTTP"}' + cloud.google.com/neg: '{"exposed_ports": {"{{ .Values.service.port }}":{"name": "{{ include "service.gcp.networkEndpointGroupName" . }}"}}}' + {{- end }} + {{- end }} +spec: + type: NodePort + selector: + app: {{ .Release.Name }} + ports: + - name: http-port + port: {{ .Values.service.port }} + protocol: TCP + targetPort: {{ .Values.service.port }} + {{- if .Values.service.ssl.enable }} + - name: https-port + port: {{ .Values.service.ssl.port }} + protocol: TCP + targetPort: {{ .Values.service.ssl.port }} + {{- end }} diff --git a/charts/snowplow-stream-collector/templates/collector-targetgroupbinding.yaml b/charts/snowplow-stream-collector/templates/collector-targetgroupbinding.yaml new file mode 100644 index 0000000..46ae367 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/collector-targetgroupbinding.yaml @@ -0,0 +1,15 @@ +{{- if eq .Values.cloud "aws" }} +apiVersion: elbv2.k8s.aws/v1beta1 +kind: TargetGroupBinding +metadata: + name: {{ .Release.Name }} +spec: + serviceRef: + name: {{ .Release.Name }} + {{- if .Values.service.ssl.enable }} + port: {{ .Values.service.ssl.port }} + {{- else }} + port: {{ .Values.service.port }} + {{- end }} + targetGroupARN: {{ .Values.service.aws.targetGroupARN }} +{{- end }} diff --git a/charts/snowplow-stream-collector/templates/common-secretdocker.yaml b/charts/snowplow-stream-collector/templates/common-secretdocker.yaml new file mode 100644 index 0000000..7a1e0f7 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/common-secretdocker.yaml @@ -0,0 +1,10 @@ +{{- if not .Values.service.image.isRepositoryPublic }} +apiVersion: v1 +kind: Secret +metadata: + namespace: {{ .Release.Namespace }} + name: {{ .Values.secrets.docker.name }} +type: kubernetes.io/dockerconfigjson +data: + ".dockerconfigjson": {{ tpl (.Files.Get "configs/secretdocker.json") . | b64enc }} +{{- end }} diff --git a/charts/snowplow-stream-collector/templates/common-serviceaccount.yaml b/charts/snowplow-stream-collector/templates/common-serviceaccount.yaml new file mode 100644 index 0000000..1e484b5 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/common-serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.deploy }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }} + annotations: + {{- if eq .Values.cloud "gcp" }} + iam.gke.io/gcp-service-account: {{ .Values.serviceAccount.gcp.serviceAccount }} + {{- else if eq .Values.cloud "aws" }} + eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.aws.roleARN }} + {{- end }} +{{- end }} diff --git a/charts/snowplow-stream-collector/templates/nginx-certconfigmap.yaml b/charts/snowplow-stream-collector/templates/nginx-certconfigmap.yaml new file mode 100644 index 0000000..7173464 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/nginx-certconfigmap.yaml @@ -0,0 +1,9 @@ +{{- if .Values.service.ssl.enable }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-nginx-cert +binaryData: + collector_cert.pem: {{ .Values.service.ssl.certificateBase64 }} + collector_key.pem: {{ .Values.service.ssl.certificatePrivateKeyBase64 }} +{{- end }} diff --git a/charts/snowplow-stream-collector/templates/nginx-confconfigmap.yaml b/charts/snowplow-stream-collector/templates/nginx-confconfigmap.yaml new file mode 100644 index 0000000..0499c39 --- /dev/null +++ b/charts/snowplow-stream-collector/templates/nginx-confconfigmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-nginx-config-conf +binaryData: + collector.conf: {{ include "service.nginx.confBase64" . }} diff --git a/charts/snowplow-stream-collector/values.yaml b/charts/snowplow-stream-collector/values.yaml new file mode 100644 index 0000000..41b6009 --- /dev/null +++ b/charts/snowplow-stream-collector/values.yaml @@ -0,0 +1,78 @@ +# -- Cloud specific bindings (options: aws, gcp) +cloud: "" + +service: + # -- HTTP port to bind and expose the service on + port: 8080 + + nginx: + # -- Whether to serve request with an NGINX proxy side-car instead of the Collector directly + deploy: false + image: + repository: "nginx" + tag: "stable-alpine" + isRepositoryPublic: true + + ssl: + # -- Whether to enable the TLS port (requires service.nginx.deploy to be true) + enable: false + # -- HTTPS port to bind and expose the service on + port: 8443 + # -- Certificate in PEM form + certificateBase64: "" + # -- Certificate Private Key in PEM form + certificatePrivateKeyBase64: "" + + image: + # -- Which image should be pulled (options: stdout, nsq, kinesis, sqs, kafka or pubsub) + target: "stdout" + repository: "snowplow/scala-stream-collector" + tag: "2.5.0" + isRepositoryPublic: true + minReplicas: 1 + maxReplicas: 4 + targetCPUUtilizationPercentage: 75 + terminationGracePeriodSeconds: 630 + + readinessProbe: + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + failureThreshold: 3 + successThreshold: 2 + + config: + hoconBase64: "" + javaOpts: "" + + aws: + # -- EC2 TargetGroup ARN to bind the service onto + targetGroupARN: "" + + gcp: + # -- Name of the Network Endpoint Group to bind onto (default: .Release.Name) + networkEndpointGroupName: "" + +secrets: + docker: + # -- Name of the secret to use for the private repository + name: "dockerhub" + # -- Username for the private repository + username: "" + # -- Password for the private repository + password: "" + # -- Repository server URL + server: "https://index.docker.io/v1/" + # -- Email address for user of the private repository + email: "" + +serviceAccount: + # -- Whether to create a service-account + deploy: false + + aws: + # -- IAM Role ARN to bind to the k8s service account + roleARN: "" + gcp: + # -- Service Account email to bind to the k8s service account + serviceAccount: ""