├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ci.py ├── deploy-key.enc ├── influxdb ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── config.yaml │ ├── deployment.yaml │ ├── post-install-set-auth.yaml │ ├── pvc.yaml │ ├── secret.yaml │ └── service.yaml └── values.yaml ├── kafka ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── _helpers.tpl │ ├── cleanup-hook.yaml │ ├── cleanup-role.yaml │ ├── cleanup-rolebinding.yaml │ ├── cleanup-serviceaccount.yaml │ ├── deployment.yaml │ ├── exporter-configmap.yaml │ ├── init-job.yaml │ ├── pvc.yaml │ ├── static-svc.yaml │ └── svc.yaml └── values.yaml ├── keystone-init ├── .helmignore ├── Chart.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── _keystone_env.tpl │ ├── cleanup-hook.yaml │ ├── cleanup-role.yaml │ ├── cleanup-rolebinding.yaml │ ├── cleanup-serviceaccount.yaml │ ├── keystone-init-job.yaml │ ├── keystone-preload-configmap.yaml │ ├── keystone-role.yaml │ ├── keystone-rolebinding.yaml │ └── keystone-serviceaccount.yaml └── values.yaml ├── monasca-agent ├── .helmignore ├── Chart.yaml ├── templates │ ├── _helpers.tpl │ ├── configmap.yaml │ ├── daemonset.yaml │ ├── deployment.yaml │ └── role.yaml └── values.yaml ├── monasca-alarms ├── Chart.yaml ├── README.md ├── templates │ ├── _helpers.tpl │ └── alarms.yaml └── values.yaml ├── monasca ├── .helmignore ├── Chart.yaml ├── README.md ├── requirements.lock ├── requirements.yaml ├── templates │ ├── _helpers.tpl │ ├── _secret_env.tpl │ ├── agent-clusterrole.yaml │ ├── agent-clusterrolebinding.yaml │ ├── agent-configmap.yaml │ ├── agent-daemonset.yaml │ ├── agent-deployment.yaml │ ├── agent-serviceaccount.yaml │ ├── aggregator-configmap.yaml │ ├── aggregator-deployment.yaml │ ├── alarm-definition-controller-deployment.yaml │ ├── alarm-definition-resource.yaml │ ├── alarms-configmap.yaml │ ├── alarms-init-job.yaml │ ├── api-deployment.yaml │ ├── api-svc.yaml │ ├── cleanup-hook.yaml │ ├── cleanup-role.yaml │ ├── cleanup-rolebinding.yaml │ ├── cleanup-serviceaccount.yaml │ ├── client-deployment.yaml │ ├── forwarder-configmap.yaml │ ├── forwarder-deployment.yaml │ ├── grafana-configmap.yaml │ ├── grafana-deployment.yaml │ ├── grafana-init-job.yaml │ ├── grafana-svc.yaml │ ├── influx-init-job.yaml │ ├── keystone-configmap.yaml │ ├── keystone-deployment.yaml │ ├── keystone-svc.yaml │ ├── memcached-deployment.yaml │ ├── memcached-svc.yaml │ ├── mysql-api-secret.yaml │ ├── mysql-grafana-secret.yaml │ ├── mysql-init-job.yaml │ ├── mysql-keystone-secret.yaml │ ├── mysql-notification-secret.yaml │ ├── mysql-thresh-secret.yaml │ ├── notification-deployment.yaml │ ├── notification-hipchat-configmap.yaml │ ├── persister-deployment.yaml │ ├── smoke-test-pod.yaml │ ├── static-api-svc.yaml │ ├── static-keystone-svc.yaml │ ├── tempest-tests-pod.yaml │ ├── thresh-deployment.yaml │ └── thresh-init-job.yaml └── values.yaml ├── mysql-users-init ├── .helmignore ├── Chart.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── cleanup-hook.yaml │ ├── cleanup-role.yaml │ ├── cleanup-rolebinding.yaml │ ├── cleanup-serviceaccount.yaml │ ├── mysql-users-init-job.yaml │ ├── mysql-users-init-role.yaml │ ├── mysql-users-init-rolebinding.yaml │ ├── mysql-users-init-serviceaccount.yaml │ └── mysql-users-preload-configmap.yaml └── values.yaml ├── push.sh ├── spark ├── .helmignore ├── Chart.yaml ├── requirements.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── spark-master-config.yaml │ ├── spark-master-rc.yaml │ ├── spark-master-service.yaml │ ├── spark-worker-config.yaml │ ├── spark-worker-rc.yaml │ └── spark-worker-service.yaml └── values.yaml ├── storm ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── nimbus-deployment.yaml │ ├── nimbus-pvc.yaml │ ├── nimbus-svc.yaml │ └── supervisor-deployment.yaml └── values.yaml ├── transform ├── .helmignore ├── Chart.yaml ├── requirements.lock ├── requirements.yaml ├── specs │ ├── README.md │ ├── pre_transform_specs.json │ ├── pre_transform_specs.sql │ ├── transform_specs.json │ └── transform_specs.sql ├── sql │ └── monasca-transform_mysql.sql ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── monasca-transform-config.yaml │ ├── monasca-transform-spark-config.yaml │ ├── monasca-transform.yaml │ ├── mysql-config.yaml │ ├── mysql-service.yaml │ └── mysql.yaml └── values.yaml └── zookeeper ├── .helmignore ├── Chart.yaml ├── README.md ├── templates ├── _helpers.tpl ├── zookeeper-configmap.yaml ├── zookeeper-deployment.yaml ├── zookeeper-pvc.yaml ├── zookeeper-static-svc.yaml └── zookeeper-svc.yaml └── values.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | **/charts/*.tgz 2 | .idea/ 3 | *.tgz 4 | deploy-key 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: python 3 | before_install: 4 | - wget https://storage.googleapis.com/kubernetes-helm/helm-v2.4.1-linux-amd64.tar.gz 5 | - tar -zxvf helm-v2.4.1-linux-amd64.tar.gz 6 | - mv linux-amd64/helm . 7 | - rm -rf linux-amd64 helm-v2.4.1-linux-amd64.tar.gz 8 | - pip install pyyaml 9 | script: 10 | - python ci.py 11 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | We're happy to accept contributions from the community. To do so, simply submit 4 | a pull request to this repository. 5 | 6 | ## Signing Commits 7 | 8 | We require a code sign-off for all contributions to indicate you have the right 9 | to release any code as open-source. As explained by the [Docker project][1]: 10 | 11 | > The sign-off is a simple line at the end of the explanation for the patch. 12 | > Your signature certifies that you wrote the patch or otherwise have the right 13 | > to pass it on as an open-source patch. 14 | 15 | The agreement we use is the [Developer Certificate of Origin][1] (copied below), 16 | as used by the Linux kernel, Docker, and many other open source projects: 17 | 18 | ``` 19 | Developer Certificate of Origin 20 | Version 1.1 21 | 22 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 23 | 1 Letterman Drive 24 | Suite D4700 25 | San Francisco, CA, 94129 26 | 27 | Everyone is permitted to copy and distribute verbatim copies of this 28 | license document, but changing it is not allowed. 29 | 30 | 31 | Developer's Certificate of Origin 1.1 32 | 33 | By making a contribution to this project, I certify that: 34 | 35 | (a) The contribution was created in whole or in part by me and I 36 | have the right to submit it under the open source license 37 | indicated in the file; or 38 | 39 | (b) The contribution is based upon previous work that, to the best 40 | of my knowledge, is covered under an appropriate open source 41 | license and I have the right under that license to submit that 42 | work with modifications, whether created in whole or in part 43 | by me, under the same open source license (unless I am 44 | permitted to submit under a different license), as indicated 45 | in the file; or 46 | 47 | (c) The contribution was provided directly to me by some other 48 | person who certified (a), (b) or (c) and I have not modified 49 | it. 50 | 51 | (d) I understand and agree that this project and the contribution 52 | are public and that a record of the contribution (including all 53 | personal information I submit with it, including my sign-off) is 54 | maintained indefinitely and may be redistributed consistent with 55 | this project or the open source license(s) involved. 56 | 57 | ``` 58 | 59 | Assuming you agree, simply add a line like the following to the end of each 60 | commit message: 61 | 62 | ``` 63 | Signed-off-by: Joe Smith 64 | ``` 65 | 66 | (note that we do need a real name here!) 67 | 68 | For best results, use `git commit -s` to have this metadata added automatically 69 | based on your configured Git name and email. 70 | 71 | Ideally, all commits should also be [GPG signed][2], though we aren't strictly 72 | enforcing this at the moment. 73 | 74 | ## Getting Help 75 | 76 | For any contribution-related questions, please file an issue on this repository, 77 | or ask in the `#openstack-monasca` channel on Freenode. 78 | 79 | [1]: https://developercertificate.org/ 80 | [2]: https://help.github.com/articles/signing-commits-using-gpg/ 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Monasca Helm 2 | 3 | This repo contains Helm charts for Monasca and its dependencies. Each chart release is hosted on 4 | [monasca.io](http://monasca.io) via github pages. 5 | 6 | ## Quick Start 7 | 8 | To install Monasca in Kubernetes you can follow the following steps: 9 | 10 | ```bash 11 | $ helm repo add monasca http://monasca.io/monasca-helm 12 | $ helm install monasca/monasca --name monasca --namespace monitoring 13 | ``` 14 | 15 | It may take several minutes to download the container images. 16 | 17 | If you have already added the helm repo make sure you update it before installing monasca to ensure you get the latest 18 | version 19 | 20 | ```bash 21 | $ helm repo update 22 | ``` 23 | 24 | By default Monasca will monitor pod workloads, basic Kubernetes Health and autodetect Prometheus endpoints. 25 | 26 | ### Local Development Environment 27 | For local development we use [minikube](https://github.com/kubernetes/minikube) for bringing up Kubernetes to deploy 28 | Monasca on. 29 | 30 | ### Accessing Data via Grafana 31 | 32 | Apart of the Monasca install is Grafana with default Kubernetes graphs. This can be accessed by port-forwarding the 33 | grafana service to localhost. 34 | 35 | Setting up grafana port-forward: 36 | ```bash 37 | $ kubectl get pods -n monitoring -l component=grafana 38 | $ kubectl port-forward {{ grafana_pod_name_from_output_above }} -n monitoring 3000 39 | ``` 40 | 41 | After the above is set up you can visit [grafana](http://localhost:3000) with the default credentials mini-mon/password 42 | 43 | For more details on configuring the Monasca chart you can refer to the chart's [README](monasca/README.md) and for 44 | general details around Monasca in Kubernetes you can refer to [monasca.io](http://monasca.io/docs/kubernetes.html) 45 | -------------------------------------------------------------------------------- /deploy-key.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monasca/monasca-helm/65529892127e600eefd8e360a6b850c3c79583b8/deploy-key.enc -------------------------------------------------------------------------------- /influxdb/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /influxdb/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: influxdb 2 | version: 0.6.2-0.0.2 3 | description: Scalable datastore for metrics, events, and real-time analytics. 4 | keywords: 5 | - influxdb 6 | - database 7 | - timeseries 8 | home: https://www.influxdata.com/time-series-platform/influxdb/ 9 | sources: 10 | - https://github.com/influxdata/influxdb 11 | maintainers: 12 | - name: Jack Zampolin 13 | email: jack@influxdb.com 14 | engine: gotpl 15 | -------------------------------------------------------------------------------- /influxdb/README.md: -------------------------------------------------------------------------------- 1 | # InfluxDB 2 | 3 | ## An Open-Source Time Series Database 4 | 5 | [InfluxDB](https://github.com/influxdata/influxdb) is an open source time series database built by the folks over at [InfluxData](https://influxdata.com) with no external dependencies. It's useful for recording metrics, events, and performing analytics. 6 | 7 | ## QuickStart 8 | 9 | ```bash 10 | $ helm install stable/influxdb --name foo --namespace bar 11 | ``` 12 | 13 | ## Introduction 14 | 15 | This chart bootstraps an InfluxDB deployment and service on a Kubernetes cluster using the Helm Package manager. 16 | 17 | ## Prerequisites 18 | 19 | - Kubernetes 1.4+ 20 | - PV provisioner support in the underlying infrastructure (optional) 21 | 22 | ## Installing the Chart 23 | 24 | To install the chart with the release name `my-release`: 25 | 26 | ```bash 27 | $ helm install --name my-release stable/influxdb 28 | ``` 29 | 30 | The command deploys InfluxDB on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 31 | 32 | > **Tip**: List all releases using `helm list` 33 | 34 | ## Uninstalling the Chart 35 | 36 | To uninstall/delete the `my-release` deployment: 37 | 38 | ```bash 39 | $ helm delete my-release --purge 40 | ``` 41 | 42 | The command removes all the Kubernetes components associated with the chart and deletes the release. 43 | 44 | ## Configuration 45 | 46 | The default configuration values for this chart are listed in `values.yaml`. 47 | 48 | The [full image documentation](https://hub.docker.com/_/influxdb/) contains more information about running InfluxDB in docker. 49 | 50 | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 51 | 52 | ```bash 53 | $ helm install --name my-release \ 54 | --set persistence.enabled=true,persistence.size=200Gi \ 55 | stable/influxdb 56 | ``` 57 | 58 | The above command enables persistence and changes the size of the requested data volume to 200GB. 59 | 60 | Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, 61 | 62 | ```bash 63 | $ helm install --name my-release -f values.yaml stable/influxdb 64 | ``` 65 | 66 | > **Tip**: You can use the default [values.yaml](values.yaml) 67 | 68 | ### InfluxDB Watcher Configuration 69 | 70 | Parameter | Description | Default 71 | --------- | ----------- | ------- 72 | `watcher.enabled` | InfluxDB watcher enabled flag | `false` 73 | `watcher.image.repository` | InfluxDB watcher container image repository | `monasca/influxdb-watcher` 74 | `watcher.image.tag` | InfluxDB watcher container image tag | `latest` 75 | `watcher.image.pullPolicy` | InfluxDB watcher container image pull policy | `IfNotPresent` 76 | `watcher.address` | InfluxDB service address | `http://localhost:8086` 77 | `watcher.username` | InfluxDB username with read/write privileges | `influxdb_watcher` 78 | `watcher.password` | InfluxDB password | `password` 79 | `watcher.database` | InfluxDB database | `mon` 80 | `watcher.watcher_period` | InfluxDB watcher period | `600` 81 | `watcher.watcher_timeout` | InfluxDB watcher read/write timeout | `60` 82 | `watcher.stay_alive_on_failure` | If `true`, watcher container stays alive for 2 hours after watcher exits | `false` 83 | `watcher.port` | InfluxDB watcher port to expose Promethues metrics on | `8080` 84 | 85 | ## Persistence 86 | 87 | The [InfluxDB](https://hub.docker.com/_/influxdb/) image stores data in the `/var/lib/influxdb` directory in the container. 88 | 89 | The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. 90 | 91 | ## Starting with authentication 92 | 93 | In `values.yaml` change `.Values.config.http.auth_enabled` to `true`. 94 | 95 | Influxdb requires also a user to be set in order for authentication to be enforced. See more details [here](https://docs.influxdata.com/influxdb/v1.2/query_language/authentication_and_authorization/#set-up-authentication). 96 | 97 | To handle this setup on startup, a job can be enabled in `values.yaml` by setting `.Values.setDefaultUser.enabled` to `true`. 98 | 99 | Make sure to uncomment or configure the job settings after enabling it. If a password is not set, a random password will be generated. 100 | -------------------------------------------------------------------------------- /influxdb/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | InfluxDB can be accessed via port {{ .Values.config.http.bind_address }} on the following DNS name from within your cluster: 2 | 3 | - http://{{ template "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address }} 4 | 5 | You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following: 6 | 7 | - kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address }} 8 | 9 | You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following: 10 | 11 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 12 | 13 | To tail the logs for the InfluxDB pod run the following: 14 | 15 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 16 | -------------------------------------------------------------------------------- /influxdb/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "influxdb.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "influxdb.fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /influxdb/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "influxdb.fullname" . }} 5 | labels: 6 | app: {{ template "influxdb.fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "influxdb.fullname" . }} 16 | {{- if .Values.watcher.enabled }} 17 | annotations: 18 | prometheus.io/scrape: "true" 19 | prometheus.io/port: "{{ .Values.watcher.port }}" 20 | monasca.io/usek8slabels: "false" 21 | monasca.io/whitelist: | 22 | - influxdb_average_round_trip_time 23 | - influxdb_dropped_message_count 24 | - influxdb_max_round_trip_time 25 | - influxdb_min_round_trip_time 26 | - influxdb_read_failure_count 27 | - influxdb_running_average_round_trip_time 28 | - influxdb_watcher_status 29 | - influxdb_write_failure_count 30 | - go_memstats_heap_objects 31 | - go_memstats_heap_inuse_bytes 32 | {{- end }} 33 | spec: 34 | containers: 35 | - name: {{ template "influxdb.fullname" . }} 36 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 37 | imagePullPolicy: {{ .Values.image.pullPolicy | quote }} 38 | resources: 39 | {{ toYaml .Values.resources | indent 10 }} 40 | ports: 41 | - name: api 42 | containerPort: {{ .Values.config.http.bind_address }} 43 | {{ if .Values.config.admin.enabled -}} 44 | - name: admin 45 | containerPort: {{ .Values.config.admin.bind_address }} 46 | {{- end }} 47 | {{ if .Values.config.graphite.enabled -}} 48 | - name: graphite 49 | containerPort: {{ .Values.config.graphite.bind_address }} 50 | {{- end }} 51 | {{ if .Values.config.collectd.enabled -}} 52 | - name: collectd 53 | containerPort: {{ .Values.config.collectd.bind_address }} 54 | {{- end }} 55 | {{ if .Values.config.udp.enabled -}} 56 | - name: udp 57 | containerPort: {{ .Values.config.udp.bind_address }} 58 | {{- end }} 59 | {{ if .Values.config.opentsdb.enabled -}} 60 | - name: opentsdb 61 | containerPort: {{ .Values.config.opentsdb.bind_address }} 62 | {{- end }} 63 | {{- if .Values.watcher.enabled }} 64 | - name: metrics 65 | containerPort: {{ .Values.watcher.port }} 66 | {{- end }} 67 | livenessProbe: 68 | httpGet: 69 | path: /ping 70 | port: api 71 | initialDelaySeconds: {{ .Values.liveness.initial_delay_seconds }} 72 | timeoutSeconds: {{ .Values.liveness.timeout_seconds }} 73 | readinessProbe: 74 | httpGet: 75 | path: /ping 76 | port: api 77 | initialDelaySeconds: {{ .Values.readiness.initial_delay_seconds }} 78 | timeoutSeconds: {{ .Values.readiness.timeout_seconds }} 79 | volumeMounts: 80 | - name: data 81 | mountPath: {{ .Values.config.storage_directory }} 82 | - name: config 83 | mountPath: /etc/influxdb 84 | {{- if .Values.watcher.enabled }} 85 | - name: watcher 86 | image: "{{ .Values.watcher.image.repository }}:{{ .Values.watcher.image.tag }}" 87 | imagePullPolicy: {{ .Values.watcher.image.pullPolicy }} 88 | resources: 89 | {{ toYaml .Values.watcher.resources | indent 12 }} 90 | env: 91 | - name: INFLUXDB_ADDRESS 92 | value: {{ .Values.watcher.address | quote }} 93 | - name: INFLUXDB_USERNAME 94 | value: {{ .Values.watcher.username | quote }} 95 | - name: INFLUXDB_PASSWORD 96 | value: {{ .Values.watcher.password | quote }} 97 | - name: INFLUXDB_DATABASE 98 | value: {{ .Values.watcher.database | quote }} 99 | - name: PROMETHEUS_ENDPOINT 100 | value: "0.0.0.0:{{ .Values.watcher.port }}" 101 | - name: WATCHER_PERIOD 102 | value: {{ .Values.watcher.watcher_period | quote }} 103 | - name: WATCHER_TIMEOUT 104 | value: {{ .Values.watcher.watcher_timeout | quote }} 105 | - name: STAY_ALIVE_ON_FAILURE 106 | value: {{ .Values.watcher.stay_alive_on_failure | quote }} 107 | {{- end }} 108 | volumes: 109 | - name: data 110 | {{- if .Values.persistence.enabled }} 111 | {{- if not (empty .Values.persistence.name) }} 112 | persistentVolumeClaim: 113 | claimName: {{ .Values.persistence.name }} 114 | {{- else }} 115 | persistentVolumeClaim: 116 | claimName: {{ template "influxdb.fullname" . }} 117 | {{- end }} 118 | {{- else }} 119 | emptyDir: {} 120 | {{- end }} 121 | - name: config 122 | configMap: 123 | name: {{ template "influxdb.fullname" . }} 124 | {{- if .Values.nodeSelector }} 125 | nodeSelector: 126 | {{ toYaml .Values.nodeSelector | indent 8 }} 127 | {{- end -}} 128 | -------------------------------------------------------------------------------- /influxdb/templates/post-install-set-auth.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.setDefaultUser.enabled -}} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | labels: 6 | app: {{ template "influxdb.fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | name: {{ template "influxdb.fullname" . }}-set-auth 11 | annotations: 12 | "helm.sh/hook": post-install 13 | spec: 14 | activeDeadlineSeconds: {{ .Values.setDefaultUser.activeDeadlineSeconds }} 15 | template: 16 | metadata: 17 | labels: 18 | app: {{ template "influxdb.fullname" . }} 19 | release: "{{ .Release.Name }}" 20 | spec: 21 | containers: 22 | - name: {{ template "influxdb.fullname" . }}-set-auth 23 | image: "{{ .Values.setDefaultUser.image }}" 24 | env: 25 | - name: INFLUXDB_USER 26 | valueFrom: 27 | secretKeyRef: 28 | name: {{ template "influxdb.fullname" . }}-auth 29 | key: influxdb-user 30 | - name: INFLUXDB_PASSWORD 31 | valueFrom: 32 | secretKeyRef: 33 | name: {{ template "influxdb.fullname" . }}-auth 34 | key: influxdb-password 35 | args: 36 | - "/bin/sh" 37 | - "-c" 38 | - | 39 | curl -X POST http://{{ template "influxdb.fullname" . }}:{{ .Values.config.http.bind_address }}/query \ 40 | --data-urlencode \ 41 | "q=CREATE USER \"${INFLUXDB_USER}\" WITH PASSWORD '${INFLUXDB_PASSWORD}' {{ .Values.setDefaultUser.user.privileges }}" 42 | restartPolicy: {{ .Values.setDefaultUser.restartPolicy }} 43 | {{- end -}} 44 | -------------------------------------------------------------------------------- /influxdb/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.persistence.enabled) (not .Values.persistence.useExisting) }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: "{{- if not (empty .Values.persistence.name) }}{{ .Values.persistence.name }}{{- else }}{{ template "influxdb.fullname" . }}{{- end }}" 6 | labels: 7 | app: "{{- if not (empty .Values.persistence.name) }}{{ .Values.persistence.name }}{{- else }}{{ template "influxdb.fullname" . }}{{- end }}" 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | spec: 12 | accessModes: 13 | - {{ .Values.persistence.accessMode | quote }} 14 | resources: 15 | requests: 16 | storage: {{ .Values.persistence.size | quote }} 17 | {{- if .Values.persistence.storageClass }} 18 | {{- if (eq "-" .Values.persistence.storageClass) }} 19 | storageClassName: "" 20 | {{- else }} 21 | storageClassName: "{{ .Values.persistence.storageClass }}" 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | -------------------------------------------------------------------------------- /influxdb/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.setDefaultUser.enabled -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | labels: 6 | app: {{ template "influxdb.fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ template "influxdb.fullname" . }}-auth 11 | data: 12 | {{- if .Values.setDefaultUser.user.password }} 13 | influxdb-password: {{ .Values.setDefaultUser.user.password | b64enc | quote }} 14 | {{- else }} 15 | influxdb-password: {{ randAscii 10 | b64enc | quote }} 16 | {{- end }} 17 | influxdb-user: {{ .Values.setDefaultUser.user.username | b64enc | quote }} 18 | {{- end -}} 19 | -------------------------------------------------------------------------------- /influxdb/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | {{- if .Values.service.annotations }} 5 | annotations: 6 | {{ toYaml .Values.service.annotations | indent 4 }} 7 | {{- end }} 8 | name: {{ template "influxdb.fullname" . }} 9 | labels: 10 | app: {{ template "influxdb.fullname" . }} 11 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 12 | release: "{{ .Release.Name }}" 13 | heritage: "{{ .Release.Service }}" 14 | spec: 15 | type: {{ .Values.service.type }} 16 | ports: 17 | {{- if .Values.config.http.enabled }} 18 | - name: api 19 | port: {{ .Values.config.http.bind_address }} 20 | targetPort: {{ .Values.config.http.bind_address }} 21 | {{- end }} 22 | {{- if .Values.config.admin.enabled }} 23 | - name: admin 24 | port: {{ .Values.config.admin.bind_address }} 25 | targetPort: {{ .Values.config.admin.bind_address }} 26 | {{- end }} 27 | {{- if .Values.config.graphite.enabled }} 28 | - name: graphite 29 | port: {{ .Values.config.graphite.bind_address }} 30 | targetPort: {{ .Values.config.graphite.bind_address }} 31 | {{- end }} 32 | {{- if .Values.config.collectd.enabled }} 33 | - name: collectd 34 | port: {{ .Values.config.collectd.bind_address }} 35 | targetPort: {{ .Values.config.collectd.bind_address }} 36 | {{- end }} 37 | {{- if .Values.config.udp.enabled }} 38 | - name: udp 39 | port: {{ .Values.config.udp.bind_address }} 40 | targetPort: {{ .Values.config.udp.bind_address }} 41 | {{- end }} 42 | {{- if .Values.config.opentsdb.enabled }} 43 | - name: opentsdb 44 | port: {{ .Values.config.opentsdb.bind_address }} 45 | targetPort: {{ .Values.config.opentsdb.bind_address }} 46 | {{- end }} 47 | selector: 48 | app: {{ template "influxdb.fullname" . }} 49 | -------------------------------------------------------------------------------- /kafka/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /kafka/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: A Helm chart for Kafka 3 | name: kafka 4 | version: 0.4.3 5 | -------------------------------------------------------------------------------- /kafka/README.md: -------------------------------------------------------------------------------- 1 | ### Kafka Configuration parameters 2 | 3 | Parameter | Description | Default 4 | --------- | ----------- | ------- 5 | `image.repository` | Kafka container image repository | `monasca/kafka` 6 | `image.tag` | Kafka container image tag | `0.9.0.1-2.11-1.1.4` 7 | `image.pullPolicy` | Kafka container image pull policy | `IfNotPresent` 8 | `resources.requests.memory` | Memory request per kafka pod | `1Gi` 9 | `resources.requests.cpu` | CPU request per kafka pod | `250m` 10 | `resources.limits.memory` | Memory limit per kafka pod | `2Gi` 11 | `resources.limits.cpu` | Memory limit per kafka pod | `2000m` 12 | `persistence.storageClass` | Kafka storage class | `default` 13 | `persistence.enabled` | Kafka persistent storage enabled flag | `false` 14 | `persistence.accessMode` | Kafka persistent storage accessMode | `ReadWriteOnce` 15 | `persistence.size` | Kafka persistent storage size | `10Gi` 16 | `topic_config` | Default config args for created topics | `segment.ms=900000` 17 | `service.port` | Kafka service port | `9092` 18 | `service.type` | Kafka service type | `ClusterIP` 19 | `exporter.enabled` | Kafka exporter enabled flag | `false` 20 | `exporter.image.repository` | Kafka exporter container image repository | `rbrndt/kafka-prometheus` 21 | `exporter.image.tag` | Kafka exporter container image tag | `latest` 22 | `exporter.image.pullPolicy` | Kafka exporter container image pull policy | `IfNotPresent` 23 | `exporter.port` | Kafka exporter port to expose Promethues metrics on | `7204` 24 | `stack_size` | JVM stack size | `1024k` 25 | `memory_ratio` | Ratio of memory to reserve for the JVM out of cgroup limit | `.85` 26 | `stay_alive_on_failure` | If `true`, container stays alive for 2 hours after kafka exits | `false` 27 | `watcher.enabled` | Kafka watcher enabled flag | `false` 28 | `watcher.image.repository` | Kafka watcher container image repository | `monasca/kafka-watcher` 29 | `watcher.image.tag` | Kafka watcher container image tag | `latest` 30 | `watcher.image.pullPolicy` | Kafka watcher container image pull policy | `IfNotPresent` 31 | `watcher.health_check_topic` | Kafka watcher health check topic | `kafka-health-check` 32 | `watcher.group_id` | Kafka watcher consumer group id | `kafka_watcher` 33 | `watcher.watcher_period` | Kafka watcher period | `600` 34 | `watcher.watcher_timeout` | Kafka watcher read/write timeout | `60` 35 | `watcher.stay_alive_on_failure` | If `true`, watcher container stays alive for 2 hours after watcher exits | `false` 36 | `watcher.port` | Kafka watcher port to expose Promethues metrics on | `8080` 37 | -------------------------------------------------------------------------------- /kafka/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | Create a fully qualified cleanup name. 20 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 21 | */}} 22 | {{- define "kafka.cleanup.fullname" -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- printf "%s-%s-%s" .Release.Name $name "cleanup" | trunc 63 | trimSuffix "-" -}} 25 | {{- end -}} 26 | -------------------------------------------------------------------------------- /kafka/templates/cleanup-hook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | # while not recommended, we add a random sequence to the end of the job name 5 | # this job will attempt to delete itself when finished, but should it fail for 6 | # some reason we don't want future upgrades to fail because of a name conflict 7 | # (plus the future runs of this job will delete any previous iterations that 8 | # failed to clean themselves up) 9 | name: "{{ template "kafka.cleanup.fullname" . }}-job-{{ randAlphaNum 5 | lower }}" 10 | labels: 11 | app: {{ template "fullname" . }} 12 | component: "{{ .Values.cleanup.name }}" 13 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 14 | release: "{{ .Release.Name }}" 15 | heritage: "{{ .Release.Service }}" 16 | annotations: 17 | "helm.sh/hook": pre-upgrade,post-delete 18 | "helm.sh/hook-weight": "-5" 19 | spec: 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ template "fullname" . }} 24 | component: "{{ .Values.cleanup.name }}" 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 26 | release: "{{ .Release.Name }}" 27 | heritage: "{{ .Release.Service }}" 28 | spec: 29 | restartPolicy: OnFailure 30 | containers: 31 | - name: {{ template "name" . }}-{{ .Values.cleanup.name }}-job 32 | image: "{{ .Values.cleanup.image.repository }}:{{ .Values.cleanup.image.tag }}" 33 | imagePullPolicy: {{ .Values.cleanup.image.pullPolicy }} 34 | resources: 35 | {{ toYaml .Values.cleanup.resources | indent 12 }} 36 | env: 37 | - name: "WAIT_RETRIES" 38 | value: "{{ .Values.cleanup.wait.retries }}" 39 | - name: "WAIT_DELAY" 40 | value: "{{ .Values.cleanup.wait.delay }}" 41 | - name: "WAIT_TIMEOUT" 42 | value: "{{ .Values.cleanup.wait.timeout }}" 43 | {{- if .Values.cleanup.serviceAccount }} 44 | serviceAccountName: {{ .Values.cleanup.serviceAccount | quote }} 45 | {{- else if .Values.rbac.create }} 46 | serviceAccountName: "{{ template "kafka.cleanup.fullname" . }}" 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /kafka/templates/cleanup-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "kafka.cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["pods"] 21 | verbs: ["get", "list", "delete", "patch"] 22 | - apiGroups: ["batch"] 23 | resources: ["jobs"] 24 | verbs: ["get", "list", "delete"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /kafka/templates/cleanup-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "kafka.cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "kafka.cleanup.fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "kafka.cleanup.fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /kafka/templates/cleanup-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "kafka.cleanup.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.cleanup.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /kafka/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | component: kafka 11 | spec: 12 | replicas: 1 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | {{- if .Values.watcher.enabled }} 18 | annotations: 19 | prometheus.io/scrape: "true" 20 | prometheus.io/port: "{{ .Values.watcher.port }}" 21 | monasca.io/usek8slabels: "false" 22 | monasca.io/whitelist: | 23 | - kafka_dropped_message_count 24 | - kafka_max_round_trip_time 25 | - kafka_min_round_trip_time 26 | - kafka_read_failure_count 27 | - kafka_watcher_status 28 | - kafka_write_failure_count 29 | - go_memstats_heap_objects 30 | - go_memstats_heap_inuse_bytes 31 | {{- end }} 32 | spec: 33 | containers: 34 | - name: {{ .Chart.Name }} 35 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 36 | imagePullPolicy: {{ .Values.image.pullPolicy }} 37 | resources: 38 | {{ toYaml .Values.resources | indent 12 }} 39 | ports: 40 | - name: kafka 41 | containerPort: 9092 42 | volumeMounts: 43 | - name: kafka 44 | mountPath: /data 45 | env: 46 | - name: KAFKA_DELETE_TOPIC_ENABLE 47 | value: "true" 48 | - name: KAFKA_AUTO_CREATE_TOPICS 49 | value: "false" 50 | - name: KAFKA_JMX 51 | value: "true" 52 | - name: JVM_MAX_RATIO 53 | value: {{ .Values.memory_ratio | quote }} 54 | - name: KAFKA_STACK_SIZE 55 | value: {{ .Values.stack_size | quote }} 56 | - name: ZOOKEEPER_CONNECTION_STRING 57 | {{- if .Values.zookeeper.overrideUri }} 58 | value: "{{ .Values.zookeeper.overrideUri }}" 59 | {{- else }} 60 | value: {{ .Release.Name }}-zookeeper:2181 61 | {{- end }} 62 | - name: STAY_ALIVE_ON_FAILURE 63 | value: {{ .Values.stay_alive_on_failure | quote }} 64 | {{- if .Values.exporter.enabled }} 65 | - name: {{ .Chart.Name }}-exporter 66 | image: "{{ .Values.exporter.image.repository }}:{{ .Values.exporter.image.tag }}" 67 | imagePullPolicy: {{ .Values.exporter.image.pullPolicy }} 68 | ports: 69 | - name: exporter 70 | containerPort: {{ .Values.exporter.port }} 71 | volumeMounts: 72 | - name: kafka-exporter 73 | mountPath: /prometheus-config 74 | {{- end }} 75 | {{- if .Values.watcher.enabled }} 76 | - name: watcher 77 | image: "{{ .Values.watcher.image.repository }}:{{ .Values.watcher.image.tag }}" 78 | imagePullPolicy: {{ .Values.watcher.image.pullPolicy }} 79 | resources: 80 | {{ toYaml .Values.watcher.resources | indent 12 }} 81 | env: 82 | - name: HEALTH_CHECK_TOPIC 83 | value: {{ .Values.watcher.health_check_topic | quote }} 84 | - name: BOOT_STRAP_SERVERS 85 | value: "localhost:9092" 86 | - name: GROUP_ID 87 | value: {{ .Values.watcher.group_id | quote }} 88 | - name: PROMETHEUS_ENDPOINT 89 | value: "0.0.0.0:{{ .Values.watcher.port }}" 90 | - name: WATCHER_PERIOD 91 | value: {{ .Values.watcher.watcher_period | quote }} 92 | - name: WATCHER_TIMEOUT 93 | value: {{ .Values.watcher.watcher_timeout | quote }} 94 | - name: STAY_ALIVE_ON_FAILURE 95 | value: {{ .Values.watcher.stay_alive_on_failure | quote }} 96 | ports: 97 | - name: metrics 98 | containerPort: {{ .Values.watcher.port }} 99 | {{- end }} 100 | volumes: 101 | - name: kafka 102 | {{- if .Values.persistence.enabled }} 103 | persistentVolumeClaim: 104 | claimName: {{ template "fullname" . }} 105 | {{- else }} 106 | emptyDir: {} 107 | {{- end -}} 108 | {{- if .Values.exporter.enabled }} 109 | - name: kafka-exporter 110 | configMap: 111 | name: {{ template "fullname" . }}-exporter 112 | {{- end }} 113 | affinity: 114 | podAntiAffinity: 115 | preferredDuringSchedulingIgnoredDuringExecution: 116 | - weight: 1 117 | podAffinityTerm: 118 | labelSelector: 119 | matchExpressions: 120 | - key: app 121 | operator: In 122 | values: 123 | - "{{ .Release.Name }}-influxdb" 124 | topologyKey: "kubernetes.io/hostname" 125 | -------------------------------------------------------------------------------- /kafka/templates/exporter-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.exporter.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "fullname" . }}-exporter 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | data: 12 | kafka-config.yml: | 13 | --- 14 | jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:7203/jmxrmi 15 | 16 | lowercaseOutputName: true 17 | rules: 18 | - pattern: '"kafka.controller"<>(Value)' 19 | name: kafka_controller_$1_$2 20 | - pattern: '"kafka.server"<>(Value)' 21 | name: kafka_server_$1_$2 22 | # This metric doesn't appear to be available in 0.8.1.1 23 | #- pattern: '"kafka.server"<>(Value)' 24 | # name: kafka_server_$2 25 | - pattern: '"kafka.server"<>(Count)' 26 | name: kafka_server_$1_$2_$3_total 27 | labels: 28 | topic: all_topics 29 | - pattern: '"kafka.server"<>(Count)' 30 | name: kafka_server_$1_$3_$4_total 31 | labels: 32 | topic: $2 33 | - pattern: '"kafka.network"<>(Count)' 34 | name: kafka_network_$1_fetch_$2_total_ms 35 | - pattern: '"kafka.network"<>(Count)' 36 | name: kafka_network_$1_produce_$2_ms 37 | # These metric doesn't appear to be available in 0.8.1.1 38 | #- pattern: '"kafka.server"<>(Count)' 39 | # name: kafka_server_$1_$2 40 | #- pattern: "kafka.network"<>(Value)' 41 | # name: kafa_network_$1_$2 42 | - pattern: '"kafka.controller"<>(Count)' 43 | name: kafka_controller_$1_$2 44 | - pattern: '"kafka.server"<>(Value)' 45 | name: kafka_server_$1_$3 46 | labels: 47 | topic: $2 48 | - pattern: '"kafka.server"<>(Count)' 49 | name: kafka_server_$1_isr_$2_per_sec 50 | {{- end }} 51 | -------------------------------------------------------------------------------- /kafka/templates/init-job.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.init.enabled }} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | name: {{ template "fullname" . }}-init-job 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "kafka-init-job" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | component: kafka-init-job 18 | spec: 19 | restartPolicy: OnFailure 20 | containers: 21 | - name: kafka-init-job 22 | image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}" 23 | imagePullPolicy: {{ .Values.init.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.init.resources | indent 12 }} 26 | env: 27 | - name: KAFKA_HOST 28 | value: "{{ template "fullname" . }}:9092" 29 | - name: ZOOKEEPER_CONNECTION_STRING 30 | {{- if .Values.zookeeper.overrideUri }} 31 | value: "{{ .Values.zookeeper.overrideUri }}" 32 | {{- else }} 33 | value: {{ .Release.Name }}-zookeeper:2181 34 | {{- end }} 35 | - name: KAFKA_DELETE_TOPIC_ENABLE 36 | value: "true" 37 | - name: KAFKA_AUTO_CREATE_TOPICS 38 | value: "false" 39 | - name: JVM_MAX_HEAP_RATIO 40 | value: {{ .Values.heap_ratio | quote }} 41 | - name: KAFKA_STACK_SIZE 42 | value: {{ .Values.stack_size | quote }} 43 | {{- if .Values.init.topicConfig }} 44 | - name: KAFKA_TOPIC_CONFIG 45 | value: {{ .Values.init.topicConfig | quote }} 46 | {{- end }} 47 | - name: KAFKA_CREATE_TOPICS 48 | value: {{ .Values.init.topics | join "," | quote }} 49 | {{- end }} 50 | -------------------------------------------------------------------------------- /kafka/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ template "fullname" . }} 11 | spec: 12 | accessModes: 13 | - {{ .Values.persistence.accessMode | quote }} 14 | storageClassName: {{ .Values.persistence.storageClass | quote }} 15 | resources: 16 | requests: 17 | storage: {{ .Values.persistence.size | quote }} 18 | {{- end }} 19 | -------------------------------------------------------------------------------- /kafka/templates/static-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.static_service.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ .Values.static_service.name }} 11 | spec: 12 | type: {{ .Values.static_service.type }} 13 | ports: 14 | - name: kafka 15 | port: {{ .Values.static_service.port }} 16 | targetPort: kafka 17 | selector: 18 | app: {{ template "fullname" . }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /kafka/templates/svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: {{ template "fullname" . }} 6 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 7 | heritage: "{{ .Release.Service }}" 8 | release: "{{ .Release.Name }}" 9 | name: {{ template "fullname" . }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | - name: kafka 14 | port: {{ .Values.service.port }} 15 | targetPort: kafka 16 | selector: 17 | app: {{ template "fullname" . }} 18 | -------------------------------------------------------------------------------- /kafka/values.yaml: -------------------------------------------------------------------------------- 1 | exporter: 2 | enabled: false 3 | image: 4 | repository: rbrndt/kafka-prometheus 5 | tag: latest 6 | pullPolicy: IfNotPresent 7 | port: 7204 8 | watcher: 9 | enabled: false 10 | image: 11 | repository: monasca/kafka-watcher 12 | tag: 0.0.4 13 | pullPolicy: IfNotPresent 14 | resources: 15 | requests: 16 | memory: 32Mi 17 | cpu: 25m 18 | limits: 19 | memory: 64Mi 20 | cpu: 50m 21 | port: 8080 22 | health_check_topic: kafka-health-check 23 | group_id: kafka_watcher 24 | watcher_period: 600 25 | watcher_timeout: 60 26 | stay_alive_on_failure: false 27 | image: 28 | repository: monasca/kafka 29 | tag: 0.9.0.1-2.11-1.1.6 30 | pullPolicy: IfNotPresent 31 | service: 32 | type: ClusterIP 33 | port: 9092 34 | resources: 35 | requests: 36 | memory: 1Gi 37 | cpu: 250m 38 | limits: 39 | memory: 2Gi 40 | cpu: 2000m 41 | persistence: 42 | storageClass: default 43 | enabled: false 44 | accessMode: ReadWriteOnce 45 | size: 10Gi 46 | memory_ratio: .85 47 | stack_size: 1024k 48 | stay_alive_on_failure: false 49 | init: 50 | enabled: true 51 | image: 52 | repository: monasca/kafka-init 53 | tag: 0.0.3 54 | pullPolicy: IfNotPresent 55 | resources: 56 | requests: 57 | memory: 128Mi 58 | cpu: 200m 59 | limits: 60 | memory: 256Mi 61 | cpu: 250m 62 | topicConfig: '' 63 | topics: [] 64 | static_service: 65 | enabled: false 66 | type: ClusterIP 67 | name: kafka 68 | port: 9092 69 | 70 | zookeeper: 71 | overrideUri: '' 72 | 73 | cleanup: 74 | name: cleanup 75 | serviceAccount: '' 76 | image: 77 | repository: monasca/job-cleanup 78 | tag: 1.2.1 79 | pullPolicy: IfNotPresent 80 | resources: 81 | requests: 82 | memory: 64Mi 83 | cpu: 50m 84 | limits: 85 | memory: 128Mi 86 | cpu: 100m 87 | wait: 88 | retries: "24" 89 | delay: "5.0" 90 | timeout: "10" 91 | 92 | rbac: 93 | create: false 94 | -------------------------------------------------------------------------------- /keystone-init/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /keystone-init/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Chart to initialize users in Keystone 3 | name: keystone-init 4 | version: 0.4.0 5 | -------------------------------------------------------------------------------- /keystone-init/templates/NOTES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monasca/monasca-helm/65529892127e600eefd8e360a6b850c3c79583b8/keystone-init/templates/NOTES.txt -------------------------------------------------------------------------------- /keystone-init/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | Create a fully qualified cleanup name. 20 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 21 | */}} 22 | {{- define "cleanup.fullname" -}} 23 | {{- printf "%s-%s" .Release.Name "cleanup" | trunc 63 -}} 24 | {{- end -}} 25 | -------------------------------------------------------------------------------- /keystone-init/templates/_keystone_env.tpl: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Read a single optional secret or string from values into an `env` `value:` or 3 | `valueFrom:`, depending on the user-defined content of the value. 4 | 5 | Example: 6 | - name: OS_AUTH_URL 7 | {{ template "keystone_init_secret_env" .Values.auth.url }} 8 | 9 | Note that unlike keystone_init_keystone_env, secret_key can not have any default 10 | values. 11 | 12 | Make sure to change the name of this template when copying to keep it unique, 13 | e.g. chart_name_secret_env. 14 | */}} 15 | {{- define "keystone_init_secret_env" -}} 16 | {{- if eq (kindOf .) "map" -}} 17 | valueFrom: 18 | secretKeyRef: 19 | name: "{{ .secret_name }}" 20 | key: "{{ .secret_key }}" 21 | {{- else -}} 22 | value: "{{ . }}" 23 | {{- end -}} 24 | {{- end -}} 25 | 26 | {{- /* 27 | Generate a list of environment vars for Keystone Auth 28 | 29 | Example: 30 | env: 31 | {{ include "keystone_init_keystone_env" .Values.my_pod.auth | indent 4 }} 32 | 33 | (indent level should be adjusted as necessary) 34 | 35 | Make sure to change the name of this template when copying to keep it unique, 36 | e.g. chart_name_keystone_env. 37 | 38 | Note that keystone_init_secret_env is not used here because we want to provide 39 | default key names. 40 | */}} 41 | {{- define "keystone_init_keystone_env" -}} 42 | - name: OS_AUTH_URL 43 | {{- if eq (kindOf .url) "map" }} 44 | valueFrom: 45 | secretKeyRef: 46 | name: "{{ .url.secret_name }}" 47 | key: "{{ .url.secret_key | default "OS_AUTH_URL" }}" 48 | {{- else }} 49 | value: "{{ .url }}" 50 | {{- end }} 51 | {{- if .admin_url }} 52 | - name: OS_ADMIN_URL 53 | {{- if eq (kindOf .admin_url) "map" }} 54 | valueFrom: 55 | secretKeyRef: 56 | name: "{{ .admin_url.secret_name }}" 57 | key: "{{ .admin_url.secret_key | default "OS_ADMIN_URL" }}" 58 | {{- else }} 59 | value: "{{ .admin_url }}" 60 | {{- end }} 61 | {{- end }} 62 | {{- if .api_version }} 63 | - name: OS_IDENTITY_API_VERSION 64 | value: "{{ .api_version }}" 65 | {{- end }} 66 | - name: OS_USERNAME 67 | {{- if eq (kindOf .username) "map" }} 68 | valueFrom: 69 | secretKeyRef: 70 | name: "{{ .username.secret_name }}" 71 | key: "{{ .username.secret_key | default "OS_USERNAME" }}" 72 | {{- else }} 73 | value: "{{ .username }}" 74 | {{- end }} 75 | - name: OS_PASSWORD 76 | {{- if eq (kindOf .password) "map" }} 77 | valueFrom: 78 | secretKeyRef: 79 | name: "{{ .password.secret_name }}" 80 | key: "{{ .password.secret_key | default "OS_PASSWORD" }}" 81 | {{- else }} 82 | value: "{{ .password }}" 83 | {{- end }} 84 | {{- if .user_domain_name }} 85 | - name: OS_USER_DOMAIN_NAME 86 | {{- if eq (kindOf .user_domain_name) "map" }} 87 | valueFrom: 88 | secretKeyRef: 89 | name: "{{ .user_domain_name.secret_name }}" 90 | key: "{{ .user_domain_name.secret_key | default "OS_USER_DOMAIN_NAME" }}" 91 | {{- else }} 92 | value: "{{ .user_domain_name }}" 93 | {{- end }} 94 | {{- end }} 95 | {{- if .project_name }} 96 | - name: OS_PROJECT_NAME 97 | {{- if eq (kindOf .project_name) "map" }} 98 | valueFrom: 99 | secretKeyRef: 100 | name: "{{ .project_name.secret_name }}" 101 | key: "{{ .project_name.secret_key | default "OS_PROJECT_NAME" }}" 102 | {{- else }} 103 | value: "{{ .project_name }}" 104 | {{- end }} 105 | {{- end }} 106 | {{- if .project_domain_name }} 107 | - name: OS_PROJECT_DOMAIN_NAME 108 | {{- if eq (kindOf .project_domain_name) "map" }} 109 | valueFrom: 110 | secretKeyRef: 111 | name: "{{ .project_domain_name.secret_name }}" 112 | key: "{{ .project_domain_name.secret_key | default "OS_PROJECT_DOMAIN_NAME" }}" 113 | {{- else }} 114 | value: "{{ .project_domain_name }}" 115 | {{- end }} 116 | {{- end }} 117 | {{- if .tenant_name }} 118 | - name: OS_TENANT_NAME 119 | {{- if eq (kindOf .tenant_name) "map" }} 120 | valueFrom: 121 | secretKeyRef: 122 | name: "{{ .tenant_name.secret_name }}" 123 | key: "{{ .tenant_name.secret_key | default "OS_TENANT_NAME" }}" 124 | {{- else }} 125 | value: "{{ .tenant_name }}" 126 | {{- end }} 127 | {{- end }} 128 | {{- if .tenant_id }} 129 | - name: OS_TENANT_ID 130 | {{- if eq (kindOf .tenant_id) "map" }} 131 | valueFrom: 132 | secretKeyRef: 133 | name: "{{ .tenant_id.secret_name }}" 134 | key: "{{ .tenant_id.secret_key | default "OS_TENANT_ID" }}" 135 | {{- else }} 136 | value: "{{ .tenant_id }}" 137 | {{- end }} 138 | {{- end }} 139 | {{- if .region_name }} 140 | - name: OS_REGION_NAME 141 | {{- if eq (kindOf .region_name) "map" }} 142 | valueFrom: 143 | secretKeyRef: 144 | name: "{{ .region_name.secret_name }}" 145 | key: "{{ .region_name.secret_key | default "OS_REGION_NAME" }}" 146 | {{- else }} 147 | value: "{{ .region_name }}" 148 | {{- end }} 149 | {{- end }} 150 | {{- end -}} 151 | -------------------------------------------------------------------------------- /keystone-init/templates/cleanup-hook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | # while not recommended, we add a random sequence to the end of the job name 5 | # this job will attempt to delete itself when finished, but should it fail for 6 | # some reason we don't want future upgrades to fail because of a name conflict 7 | # (plus the future runs of this job will delete any previous iterations that 8 | # failed to clean themselves up) 9 | name: "{{ template "cleanup.fullname" . }}-job-{{ randAlphaNum 5 | lower }}" 10 | labels: 11 | app: {{ template "fullname" . }} 12 | component: "{{ .Values.cleanup.name }}" 13 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 14 | release: "{{ .Release.Name }}" 15 | heritage: "{{ .Release.Service }}" 16 | annotations: 17 | "helm.sh/hook": pre-upgrade,post-delete 18 | "helm.sh/hook-weight": "-5" 19 | spec: 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ template "fullname" . }} 24 | component: "{{ .Values.cleanup.name }}" 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 26 | release: "{{ .Release.Name }}" 27 | heritage: "{{ .Release.Service }}" 28 | spec: 29 | restartPolicy: OnFailure 30 | containers: 31 | - name: {{ template "name" . }}-{{ .Values.cleanup.name }}-job 32 | image: "{{ .Values.cleanup.image.repository }}:{{ .Values.cleanup.image.tag }}" 33 | imagePullPolicy: {{ .Values.cleanup.image.pullPolicy }} 34 | resources: 35 | {{ toYaml .Values.cleanup.resources | indent 12 }} 36 | env: 37 | - name: "WAIT_RETRIES" 38 | value: "{{ .Values.cleanup.wait.retries }}" 39 | - name: "WAIT_DELAY" 40 | value: "{{ .Values.cleanup.wait.delay }}" 41 | - name: "WAIT_TIMEOUT" 42 | value: "{{ .Values.cleanup.wait.timeout }}" 43 | {{- if .Values.cleanup.serviceAccount }} 44 | serviceAccountName: {{ .Values.cleanup.serviceAccount | quote }} 45 | {{- else if .Values.rbac.create }} 46 | serviceAccountName: "{{ template "cleanup.fullname" . }}" 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /keystone-init/templates/cleanup-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["pods"] 21 | verbs: ["get", "list", "delete", "patch"] 22 | - apiGroups: ["batch"] 23 | resources: ["jobs"] 24 | verbs: ["get", "list", "delete"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /keystone-init/templates/cleanup-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "cleanup.fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "cleanup.fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /keystone-init/templates/cleanup-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "cleanup.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.cleanup.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /keystone-init/templates/keystone-init-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: {{ template "fullname" . }}-job 5 | labels: 6 | app: {{ template "fullname" . }} 7 | component: "{{ .Values.keystone_init.name }}" 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | spec: 12 | {{- if .Values.keystone_init.deadline }} 13 | activeDeadlineSeconds: {{ .Values.keystone_init.deadline }} 14 | {{- end }} 15 | template: 16 | metadata: 17 | labels: 18 | app: {{ template "fullname" . }} 19 | component: "{{ .Values.keystone_init.name }}" 20 | spec: 21 | restartPolicy: OnFailure 22 | volumes: 23 | - name: preload-config 24 | configMap: 25 | name: "{{ template "fullname" . }}-preload" 26 | containers: 27 | - name: {{ template "fullname" . }}-job 28 | image: "{{ .Values.keystone_init.image.repository }}:{{ .Values.keystone_init.image.tag }}" 29 | imagePullPolicy: {{ .Values.keystone_init.image.pullPolicy }} 30 | resources: 31 | {{ toYaml .Values.keystone_init.resources | indent 12 }} 32 | env: 33 | - name: LOG_LEVEL 34 | value: {{ .Values.keystone_init.log_level }} 35 | - name: KEYSTONE_TIMEOUT 36 | value: "{{ .Values.keystone_init.timeout }}" 37 | - name: KEYSTONE_VERIFY 38 | value: "{{ .Values.keystone_init.verify }}" 39 | - name: KEYSTONE_CERT 40 | value: "{{ .Values.keystone_init.cert }}" 41 | {{ include "keystone_init_keystone_env" .Values.keystone_init.auth | indent 12 }} 42 | - name: PRELOAD_PATH 43 | value: "/config/preload.yml" 44 | volumeMounts: 45 | - name: preload-config 46 | mountPath: /config 47 | {{- if .Values.keystone_init.serviceAccount }} 48 | serviceAccountName: {{ .Values.keystone_init.serviceAccount | quote }} 49 | {{- else if .Values.rbac.create }} 50 | serviceAccountName: "{{ template "fullname" . }}" 51 | {{- end }} 52 | -------------------------------------------------------------------------------- /keystone-init/templates/keystone-preload-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: "{{ template "fullname" . }}-preload" 5 | labels: 6 | app: "{{ template "fullname" . }}" 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | data: 11 | preload.yml: | 12 | {{ toYaml .Values.keystone_init.preload | indent 4 }} 13 | -------------------------------------------------------------------------------- /keystone-init/templates/keystone-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.keystone_init.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.keystone_init.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["secrets"] 21 | verbs: ["get", "create", "update"] 22 | - apiGroups: [""] 23 | resources: ["namespaces"] 24 | verbs: ["get", "create"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /keystone-init/templates/keystone-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.keystone_init.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.keystone_init.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /keystone-init/templates/keystone-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.keystone_init.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.keystone_init.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /keystone-init/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for keystone-init. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | keystone_init: 5 | name: keystone-init 6 | 7 | # an optional preexisting serviceAccount to use 8 | # to create a service account with the deployment, 9 | # deploy with rbac.create=true 10 | serviceAccount: '' 11 | 12 | image: 13 | repository: monasca/keystone-init 14 | tag: 1.3.0 15 | pullPolicy: IfNotPresent 16 | 17 | # general options for the init job 18 | log_level: INFO # python logging level 19 | timeout: "10" # timeout in seconds 20 | verify: "true" # if "true", verify SSL 21 | cert: '' # cert to override if desired (must be mounted as configmap) 22 | 23 | # keystone authentication for this component 24 | # note that these options allow the init container to connect to keystone and 25 | # the referenced account must already exist 26 | # each parameter may either be specified directly as a string OR reference a 27 | # secret 28 | # example: 29 | # # plaintext (will be stored in Helm's ConfigMap) 30 | # password: 'some-plaintext-password' 31 | # 32 | # # secret ref 33 | # password: 34 | # secret_name: some-secret-name 35 | # # key is optional, will default to `OS_`-style variables 36 | # secret_key: some-key 37 | auth: 38 | url: 'http://keystone:5000' 39 | username: "admin" 40 | password: "s3cr3t" 41 | user_domain_name: Default 42 | project_name: 'admin' 43 | project_domain_name: Default 44 | 45 | # specify domains, projects, roles, and users to create 46 | preload: 47 | # global roles 48 | global_roles: [] 49 | 50 | # named domains, the key name will be used to look up keystone domain name 51 | domains: 52 | # note that `default` is special and refers directly to the ID `default`, 53 | # not the name `Default` 54 | default: 55 | # a list of project names that must exist (will be created) 56 | projects: [] 57 | 58 | # a list of domain-scoped role names that must exist (will be created) 59 | roles: [] 60 | 61 | # a list of user objects that must exist 62 | # example: 63 | # users: 64 | # - username: some-user 65 | # project: some-project # will be created if it does not exist 66 | # roles: # will also be created automatically 67 | # - a 68 | # - b 69 | # - c 70 | # # if desired, create a secret (optional): 71 | # secret: some-secret-name 72 | # # alternatively, specify a namespace and name 73 | # secret: some-namespace/some-secret-name 74 | # # or even: 75 | # secret: 76 | # namespace: some-namespace 77 | # name: some-secret-name 78 | users: [] 79 | 80 | # container resource limits and requests 81 | resources: 82 | limits: 83 | cpu: 100m 84 | memory: 128Mi 85 | requests: 86 | cpu: 100m 87 | memory: 128Mi 88 | 89 | cleanup: 90 | name: cleanup 91 | serviceAccount: '' 92 | image: 93 | repository: monasca/job-cleanup 94 | tag: 1.2.1 95 | pullPolicy: IfNotPresent 96 | resources: 97 | requests: 98 | memory: 128Mi 99 | cpu: 200m 100 | limits: 101 | memory: 128Mi 102 | cpu: 250m 103 | wait: 104 | retries: "10" 105 | delay: "3.0" 106 | timeout: "10" 107 | 108 | rbac: 109 | create: false 110 | -------------------------------------------------------------------------------- /monasca-agent/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /monasca-agent/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: A Helm chart for Monasca-agent 3 | name: monasca-agent 4 | version: 0.2.3 5 | sources: 6 | - https://github.com/openstack/monasca-agent 7 | maintainers: 8 | - name: Tim Buckley 9 | email: timothy.jas.buckley@hpe.com 10 | -------------------------------------------------------------------------------- /monasca-agent/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} -------------------------------------------------------------------------------- /monasca-agent/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.plugins.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ template "fullname" . }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | {{ toYaml .Values.plugins.config_files | indent 2 }} 14 | {{- end}} 15 | -------------------------------------------------------------------------------- /monasca-agent/templates/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.enabled }} 2 | kind: ClusterRole 3 | apiVersion: rbac.authorization.k8s.io/v1alpha1 4 | metadata: 5 | name: "{{ .Release.Name }}-role" 6 | rules: 7 | - apiGroups: ["", "extensions", "storage.k8s.io"] 8 | verbs: ["get", "list"] 9 | resources: 10 | - namespaces 11 | - pods 12 | - replicasets 13 | - deployments 14 | - replicationcontrollers 15 | - nodes 16 | - services 17 | - componentstatuses 18 | - storageclasses 19 | --- 20 | kind: ClusterRoleBinding 21 | apiVersion: rbac.authorization.k8s.io/v1alpha1 22 | metadata: 23 | name: "{{ .Release.Name }}-role-binding" 24 | subjects: 25 | - kind: ServiceAccount 26 | name: default 27 | namespace: "{{ .Release.Namespace }}" 28 | roleRef: 29 | kind: ClusterRole 30 | name: "{{ .Release.Name }}-role" 31 | apiGroup: rbac.authorization.k8s.io 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /monasca-agent/values.yaml: -------------------------------------------------------------------------------- 1 | name: agent 2 | collector: 3 | image: 4 | repository: monasca/agent-collector 5 | tag: master-20180112-162543 6 | pullPolicy: IfNotPresent 7 | check_freq: 30 8 | num_collector_threads: 1 9 | pool_full_max_retries: 4 10 | sub_collection_warn: 6 11 | forwarder: 12 | image: 13 | repository: monasca/agent-forwarder 14 | tag: master-20180206-002800 15 | pullPolicy: IfNotPresent 16 | max_batch_size: 0 17 | max_measurement_buffer_size: -1 18 | backlog_send_rate: 5 19 | non_local_traffic: "true" 20 | insecure: False 21 | log_level: WARN 22 | keystone: 23 | os_username: mini-mon 24 | os_user_domain_name: Default 25 | os_password: password 26 | os_project_name: mini-mon 27 | os_project_domain_name: Default 28 | url: http://keystone:35357/v3 29 | monasca_url: http://monasca-api:8070/v2.0 30 | prometheus: 31 | auto_detect_pod_endpoints: true 32 | auto_detect_service_endpoints: true 33 | kubernetes_labels: 'app' 34 | timeout: 3 35 | kubernetes_api: 36 | kubernetes_labels: 'app' 37 | timeout: 3 38 | storage: 39 | report: true 40 | kubernetes: 41 | kubernetes_labels: 'app' 42 | timeout: 3 43 | cadvisor: 44 | enabled: true 45 | timeout: 3 46 | resources: 47 | requests: 48 | memory: 256Mi 49 | cpu: 100m 50 | limits: 51 | memory: 512Mi 52 | cpu: 500m 53 | plugins: 54 | enabled: false 55 | rbac: 56 | enabled: false 57 | -------------------------------------------------------------------------------- /monasca-alarms/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: A Helm chart for adding Alarms for Monasca 3 | name: monasca-alarms 4 | version: 0.0.1 5 | sources: 6 | - https://wiki.openstack.org/wiki/Monasca 7 | maintainers: 8 | - name: Michael Hoppal 9 | email: michael.jam.hoppal@hpe.com 10 | -------------------------------------------------------------------------------- /monasca-alarms/README.md: -------------------------------------------------------------------------------- 1 | # Monasca-alarms 2 | 3 | ## Alarms for Monasca components 4 | 5 | [Monasca](https://wiki.openstack.org/wiki/Monasca), an 6 | [Openstack](https://www.openstack.org/) official project, is a scalable 7 | monitoring as a service solution. It monitors services and systems by a push 8 | model. The Monasca Agent will collect metrics from each node and push them to 9 | the Monasca API. It will then be processed by separate microservices for 10 | storing, alarming and notifications. The architecture can be viewed 11 | [here](https://wiki.openstack.org/wiki/File:Monasca-arch-component-diagram.png) 12 | 13 | This chart adds alarms for the components of Monasca so Monasca can monitor 14 | itself. However, some components failing, for example Kafka, will have no 15 | alarms generated as the threshold engine requires kafka to be working. 16 | 17 | ## QuickStart 18 | 19 | ```bash 20 | $ helm repo add monasca http://monasca.io/monasca-helm 21 | $ helm install monasca/monasca --name monasca --namespace monitoring 22 | $ helm install monasca/monasca-alarms --name monasca-alarms --namespace monitoring 23 | ``` 24 | 25 | ## Introduction 26 | 27 | This chart adds Alarms for the components of a [Monasca](https://wiki.openstack.org/wiki/Monasca) 28 | deployment on a Kubernetes cluster using the Helm Package manager. 29 | 30 | ## Prerequisites 31 | 32 | - Kubernetes 1.4+ 33 | - Monasca installed using Helm 34 | 35 | ## Installing the Chart 36 | 37 | Monasca-alarms can either be installed from the [monasca.io](https://monasca.io/) helm repo or by source. 38 | 39 | ### Installing via Helm repo (recommended) 40 | 41 | ```bash 42 | $ helm install monasca/monasca-alarms --name monasca-alarms --namespace monitoring 43 | ``` 44 | Note: monasca-alarms must be installed in the same namespace as monasca 45 | 46 | ### Installing via source 47 | 48 | ```bash 49 | $ helm repo add monasca http://monasca.io/monasca-helm 50 | $ helm dependency update monasca-alarms 51 | $ helm install monasca-alarms --name monasca-alarms --namespace monitoring 52 | ``` 53 | 54 | Either option will add the alarms for the components of Monasca on the Kubernetes cluster 55 | with the default configuration. The [configuration](#configuration) section lists the parameters 56 | that can be configured during installation. 57 | 58 | > **Tip**: List all releases using `helm list` 59 | 60 | ## Uninstalling the Chart 61 | 62 | To uninstall/delete the `my-release` deployment: 63 | 64 | ```bash 65 | $ helm delete my-release --purge 66 | ``` 67 | 68 | The command removes all the Kubernetes components associated with the chart and 69 | deletes the release. 70 | 71 | ### Default Alarms for components 72 | 73 | By default Monasca alarms will be created for Kafka and Zookeeper. 74 | 75 | ## Configuration 76 | 77 | The following tables lists the configurable parameters of the Monasca alarms chart 78 | broken down by microservice and their default values. 79 | 80 | Specify each parameter using the `--set key=value[,key=value]` argument to 81 | `helm install`. For example, 82 | 83 | ```console 84 | $ helm install monasca-alarms --name my-release \ 85 | --set kafka.start_periods=4 86 | ``` 87 | 88 | Alternatively, a YAML file that specifies the values for the below parameters 89 | can be provided while installing the chart. For example, 90 | 91 | ```console 92 | $ helm install monasca-alarms --name my-release -f values.yaml 93 | ``` 94 | 95 | > **Tip**: You can use the default [values.yaml](values.yaml) 96 | 97 | 98 | ### Kafka 99 | 100 | Parameter | Description | Default 101 | --------- | ----------- | ------- 102 | `kafka.enabled` | Kafka alarms enabled | `true` 103 | `kafka.start_periods` | How many periods Kafka is not started before alarming | `3` 104 | `kafka.running_periods` | How many periods Kafka is not running before alarming | `1` 105 | 106 | ### Zookeeper 107 | 108 | Parameter | Description | Default 109 | --------- | ----------- | ------- 110 | `zookeeper.enabled` | Zookeeper alarms enabled | `true` 111 | `zookeeper.start_periods` | How many periods Zookeeper is not started before alarming | `3` 112 | `zookeeper.running_periods` | How many periods Zookeeper is not running before alarming | `1` 113 | -------------------------------------------------------------------------------- /monasca-alarms/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /monasca-alarms/templates/alarms.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.kafka.enabled }} 2 | --- 3 | apiVersion: "monasca.io/v1" 4 | kind: AlarmDefinition 5 | metadata: 6 | name: kafka-not-starting 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | alarmDefinitionSpec: 13 | name: "Kafka not started" 14 | expression: "avg(kafka_watcher_status) < 0 times {{ .Values.kafka.start_periods }}" 15 | match_by: [] 16 | description: "Kafka has not started in {{ .Values.kafka.start_periods }} minutes" 17 | severity: "HIGH" 18 | --- 19 | apiVersion: "monasca.io/v1" 20 | kind: AlarmDefinition 21 | metadata: 22 | name: kafka-not-running 23 | labels: 24 | app: {{ template "fullname" . }} 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 26 | release: "{{ .Release.Name }}" 27 | heritage: "{{ .Release.Service }}" 28 | alarmDefinitionSpec: 29 | name: "Kafka not running" 30 | expression: "avg(kafka_watcher_status) > 0 times {{ .Values.kafka.running_periods }}" 31 | match_by: [] 32 | description: "Kafka is not running for {{ .Values.kafka.running_periods }} minutes" 33 | severity: "HIGH" 34 | {{- end }} 35 | {{- if .Values.zookeeper.enabled }} 36 | --- 37 | apiVersion: "monasca.io/v1" 38 | kind: AlarmDefinition 39 | metadata: 40 | name: zookeeper-not-starting 41 | labels: 42 | app: {{ template "fullname" . }} 43 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 44 | release: "{{ .Release.Name }}" 45 | heritage: "{{ .Release.Service }}" 46 | alarmDefinitionSpec: 47 | name: "Zookeeper not started" 48 | expression: "avg(zookeeper_watcher_status) < 0 times {{ .Values.zookeeper.start_periods }}" 49 | match_by: [] 50 | description: "Zookeeper not started in {{ .Values.zookeeper.start_periods }} minutes" 51 | severity: "HIGH" 52 | --- 53 | apiVersion: "monasca.io/v1" 54 | kind: AlarmDefinition 55 | metadata: 56 | name: zookeeper-not-running 57 | labels: 58 | app: {{ template "fullname" . }} 59 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 60 | release: "{{ .Release.Name }}" 61 | heritage: "{{ .Release.Service }}" 62 | alarmDefinitionSpec: 63 | name: "Zookeeper not running" 64 | expression: "avg(zookeeper_watcher_status) > 0 times {{ .Values.zookeeper.running_periods }}" 65 | match_by: [] 66 | description: "Zookeeper is not running for {{ .Values.zookeeper.running_periods }} minutes" 67 | severity: "HIGH" 68 | {{- end }} 69 | -------------------------------------------------------------------------------- /monasca-alarms/values.yaml: -------------------------------------------------------------------------------- 1 | kafka: 2 | enabled: true 3 | start_periods: 3 4 | running_periods: 1 5 | 6 | zookeeper: 7 | enabled: true 8 | start_periods: 3 9 | running_periods: 1 10 | -------------------------------------------------------------------------------- /monasca/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /monasca/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: A Helm chart for Monasca running in Kubernetes 3 | name: monasca 4 | version: 0.6.4 5 | sources: 6 | - https://wiki.openstack.org/wiki/Monasca 7 | maintainers: 8 | - name: Tim Buckley 9 | email: timothy.jas.buckley@hpe.com 10 | -------------------------------------------------------------------------------- /monasca/requirements.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: influxdb 3 | repository: http://monasca.io/monasca-helm/ 4 | version: 0.6.2-0.0.2 5 | - name: mysql 6 | repository: https://kubernetes-charts.storage.googleapis.com/ 7 | version: 0.2.4 8 | - name: kafka 9 | repository: http://monasca.io/monasca-helm/ 10 | version: 0.4.2 11 | - name: storm 12 | repository: http://monasca.io/monasca-helm/ 13 | version: 0.5.3 14 | - name: zookeeper 15 | repository: http://monasca.io/monasca-helm/ 16 | version: 0.3.8 17 | digest: sha256:d4518c0c9c2fe0c60929de067e1ebb39c1d4db8272917f5582bf649d91b572e5 18 | generated: 2018-04-17T12:40:23.242201764-06:00 19 | -------------------------------------------------------------------------------- /monasca/requirements.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: influxdb 3 | version: 0.6.2-0.0.2 4 | condition: 'influxdb.enabled, global.influxdb.enabled' 5 | repository: 'http://monasca.io/monasca-helm/' 6 | - name: mysql 7 | version: 0.2.4 8 | condition: 'mysql.enabled, global.mysql.enabled' 9 | repository: 'https://kubernetes-charts.storage.googleapis.com/' 10 | - name: kafka 11 | version: 0.4.2 12 | condition: 'kafka.enabled, global.kafka.enabled' 13 | repository: 'http://monasca.io/monasca-helm/' 14 | - name: storm 15 | version: 0.5.3 16 | condition: 'storm.enabled, global.storm.enabled' 17 | repository: 'http://monasca.io/monasca-helm/' 18 | - name: zookeeper 19 | version: 0.3.8 20 | condition: 'zookeeper.enabled, global.zookeeper.enabled' 21 | repository: 'http://monasca.io/monasca-helm/' 22 | -------------------------------------------------------------------------------- /monasca/templates/_secret_env.tpl: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Read a single optional secret or string from values into an `env` `value:` or 3 | `valueFrom:`, depending on the user-defined content of the value. 4 | 5 | Example: 6 | - name: OS_AUTH_URL 7 | {{ template "monasca_secret_env" .Values.auth.url }} 8 | 9 | Note that unlike monasca_keystone_env, secret_key can not have any default 10 | values. 11 | 12 | Make sure to change the name of this template when copying to keep it unique, 13 | e.g. chart_name_secret_env. 14 | */}} 15 | {{- define "monasca_secret_env" }} 16 | {{- if eq (kindOf .) "map" }} 17 | valueFrom: 18 | secretKeyRef: 19 | name: "{{ .secret_name }}" 20 | key: "{{ .secret_key }}" 21 | {{- else }} 22 | value: "{{ . }}" 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{- /* 27 | Generate a list of environment vars for Keystone Auth 28 | 29 | Example: 30 | env: 31 | {{ include "monasca_keystone_env" .Values.my_pod.auth | indent 4 }} 32 | 33 | (indent level should be adjusted as necessary) 34 | 35 | Make sure to change the name of this template when copying to keep it unique, 36 | e.g. chart_name_keystone_env. 37 | 38 | Note that monasca_secret_env is not used here because we want to provide 39 | default key names. 40 | 41 | Note: this template does NOT set OS_AUTH_URL, since we may need to reference our 42 | internal Keystone URL and Helm cannot pass more than one variable at once. 43 | */}} 44 | {{- define "monasca_keystone_env" -}} 45 | {{- if .api_version }} 46 | - name: OS_IDENTITY_API_VERSION 47 | value: "{{ .api_version }}" 48 | {{- end }} 49 | {{- if .domain_name }} 50 | - name: OS_DOMAIN_NAME 51 | {{- if eq (kindOf .domain_name) "map" }} 52 | valueFrom: 53 | secretKeyRef: 54 | name: "{{ .domain_name.secret_name }}" 55 | key: "{{ .domain_name.secret_key | default "OS_DOMAIN_NAME" }}" 56 | {{- else }} 57 | value: "{{ .domain_name }}" 58 | {{- end }} 59 | {{- end }} 60 | - name: OS_USERNAME 61 | {{- if eq (kindOf .username) "map" }} 62 | valueFrom: 63 | secretKeyRef: 64 | name: "{{ .username.secret_name }}" 65 | key: "{{ .username.secret_key | default "OS_USERNAME" }}" 66 | {{- else }} 67 | value: "{{ .username }}" 68 | {{- end }} 69 | - name: OS_PASSWORD 70 | {{- if eq (kindOf .password) "map" }} 71 | valueFrom: 72 | secretKeyRef: 73 | name: "{{ .password.secret_name }}" 74 | key: "{{ .password.secret_key | default "OS_PASSWORD" }}" 75 | {{- else }} 76 | value: "{{ .password }}" 77 | {{- end }} 78 | {{- if .user_domain_name }} 79 | - name: OS_USER_DOMAIN_NAME 80 | {{- if eq (kindOf .user_domain_name) "map" }} 81 | valueFrom: 82 | secretKeyRef: 83 | name: "{{ .user_domain_name.secret_name }}" 84 | key: "{{ .user_domain_name.secret_key | default "OS_USER_DOMAIN_NAME" }}" 85 | {{- else }} 86 | value: "{{ .user_domain_name }}" 87 | {{- end }} 88 | {{- end }} 89 | {{- if .project_name }} 90 | - name: OS_PROJECT_NAME 91 | {{- if eq (kindOf .project_name) "map" }} 92 | valueFrom: 93 | secretKeyRef: 94 | name: "{{ .project_name.secret_name }}" 95 | key: "{{ .project_name.secret_key | default "OS_PROJECT_NAME" }}" 96 | {{- else }} 97 | value: "{{ .project_name }}" 98 | {{- end }} 99 | {{- end }} 100 | {{- if .project_domain_name }} 101 | - name: OS_PROJECT_DOMAIN_NAME 102 | {{- if eq (kindOf .project_domain_name) "map" }} 103 | valueFrom: 104 | secretKeyRef: 105 | name: "{{ .project_domain_name.secret_name }}" 106 | key: "{{ .project_domain_name.secret_key | default "OS_PROJECT_DOMAIN_NAME" }}" 107 | {{- else }} 108 | value: "{{ .project_domain_name }}" 109 | {{- end }} 110 | {{- end }} 111 | {{- if .tenant_name }} 112 | - name: OS_TENANT_NAME 113 | {{- if eq (kindOf .tenant_name) "map" }} 114 | valueFrom: 115 | secretKeyRef: 116 | name: "{{ .tenant_name.secret_name }}" 117 | key: "{{ .tenant_name.secret_key | default "OS_TENANT_NAME" }}" 118 | {{- else }} 119 | value: "{{ .tenant_name }}" 120 | {{- end }} 121 | {{- end }} 122 | {{- if .tenant_id }} 123 | - name: OS_TENANT_ID 124 | {{- if eq (kindOf .tenant_id) "map" }} 125 | valueFrom: 126 | secretKeyRef: 127 | name: "{{ .tenant_id.secret_name }}" 128 | key: "{{ .tenant_id.secret_key | default "OS_TENANT_ID" }}" 129 | {{- else }} 130 | value: "{{ .tenant_id }}" 131 | {{- end }} 132 | {{- end }} 133 | {{- if .region_name }} 134 | - name: OS_REGION_NAME 135 | {{- if eq (kindOf .region_name) "map" }} 136 | valueFrom: 137 | secretKeyRef: 138 | name: "{{ .region_name.secret_name }}" 139 | key: "{{ .region_name.secret_key | default "OS_REGION_NAME" }}" 140 | {{- else }} 141 | value: "{{ .region_name }}" 142 | {{- end }} 143 | {{- end }} 144 | {{- if .auth_type }} 145 | - name: OS_AUTH_TYPE 146 | {{- if eq (kindOf .auth_type) "map" }} 147 | valueFrom: 148 | secretKeyRef: 149 | name: "{{ .auth_type.secret_name }}" 150 | key: "{{ .auth_type.secret_key | default "OS_AUTH_TYPE" }}" 151 | {{- else }} 152 | value: "{{ .auth_type }}" 153 | {{- end }} 154 | {{- end }} 155 | {{- end -}} 156 | -------------------------------------------------------------------------------- /monasca/templates/agent-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.agent.serviceAccount) }} 2 | kind: ClusterRole 3 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 6 | apiVersion: rbac.authorization.k8s.io/v1beta1 7 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 8 | apiVersion: rbac.authorization.k8s.io/v1alpha1 9 | {{- end }} 10 | metadata: 11 | name: "{{ template "agent.fullname" . }}" 12 | rules: 13 | - apiGroups: ["", "extensions", "storage.k8s.io"] 14 | verbs: ["get", "list"] 15 | resources: 16 | - namespaces 17 | - pods 18 | - replicasets 19 | - deployments 20 | - replicationcontrollers 21 | - nodes 22 | - services 23 | - componentstatuses 24 | - storageclasses 25 | - apiGroups: ["", "batch", "extensions", "storage.k8s.io"] 26 | verbs: ["get", "list", "delete"] 27 | resources: 28 | - jobs 29 | - pods 30 | {{- end }} 31 | -------------------------------------------------------------------------------- /monasca/templates/agent-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.agent.serviceAccount) }} 2 | kind: ClusterRoleBinding 3 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 6 | apiVersion: rbac.authorization.k8s.io/v1beta1 7 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 8 | apiVersion: rbac.authorization.k8s.io/v1alpha1 9 | {{- end }} 10 | metadata: 11 | name: "{{ template "agent.fullname" . }}" 12 | subjects: 13 | - kind: ServiceAccount 14 | name: "{{ template "agent.fullname" . }}" 15 | namespace: "{{ .Release.Namespace }}" 16 | roleRef: 17 | kind: ClusterRole 18 | name: "{{ template "agent.fullname" . }}" 19 | apiGroup: rbac.authorization.k8s.io 20 | {{- end }} 21 | -------------------------------------------------------------------------------- /monasca/templates/agent-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.agent.plugins.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "agent.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.agent.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | {{ toYaml .Values.agent.plugins.config_files | indent 2 }} 14 | {{- end}} 15 | -------------------------------------------------------------------------------- /monasca/templates/agent-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.agent.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: "{{ template "agent.fullname" . }}" 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.agent.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /monasca/templates/aggregator-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.aggregator.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "aggregator.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.aggregator.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | {{ toYaml .Values.aggregator.metric_configuration | indent 2 }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /monasca/templates/aggregator-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.aggregator.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "aggregator.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.aggregator.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: {{ .Values.aggregator.replicaCount }} 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.aggregator.name }}" 19 | annotations: 20 | checksum/metric_config: {{ toYaml .Values.aggregator.metric_configuration | sha256sum }} 21 | prometheus.io/scrape: "true" 22 | prometheus.io/path: "/metrics" 23 | prometheus.io/port: "8080" 24 | spec: 25 | containers: 26 | - name: aggregator 27 | image: "{{ .Values.aggregator.image.repository }}:{{ .Values.aggregator.image.tag }}" 28 | imagePullPolicy: {{ .Values.aggregator.image.pullPolicy }} 29 | resources: 30 | {{ toYaml .Values.aggregator.resources | indent 10 }} 31 | ports: 32 | - containerPort: 8080 33 | name: metrics 34 | env: 35 | - name: AGGREGATION_WINDOW_SIZE 36 | value: {{ .Values.aggregator.window_size | quote }} 37 | - name: AGGREGATION_WINDOW_LAG 38 | value: {{ .Values.aggregator.window_lag | quote }} 39 | - name: KAFKA_URI 40 | {{- if .Values.kafka.overrideUri }} 41 | value: "{{ .Values.kafka.overrideUri }}" 42 | {{- else }} 43 | value: "{{ template "kafka.fullname" . }}:9092" 44 | {{- end }} 45 | volumeMounts: 46 | - name: aggregator-config 47 | mountPath: /specs 48 | volumes: 49 | - name: aggregator-config 50 | configMap: 51 | name: {{ template "aggregator.fullname" . }} 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /monasca/templates/alarm-definition-controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.alarm_definition_controller.controller_enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "alarm_definition_controller.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.alarm_definition_controller.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: 1 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.alarm_definition_controller.name }}" 19 | spec: 20 | containers: 21 | - name: adc 22 | image: "{{ .Values.alarm_definition_controller.image.repository }}:{{ .Values.alarm_definition_controller.image.tag }}" 23 | imagePullPolicy: {{ .Values.alarm_definition_controller.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.alarm_definition_controller.resources | indent 12 }} 26 | env: 27 | - name: OS_AUTH_URL 28 | {{- if .Values.alarm_definition_controller.keystone.url }} 29 | {{- if eq (kindOf .Values.alarm_definition_controller.keystone.url) "map" }} 30 | valueFrom: 31 | secretKeyRef: 32 | name: "{{ .Values.alarm_definition_controller.keystone.url.secret_name }}" 33 | key: "{{ .Values.alarm_definition_controller.keystone.url.secret_key | default "OS_AUTH_URL" }}" 34 | {{- else }} 35 | value: "{{ .Values.alarm_definition_controller.keystone.url }}" 36 | {{- end }} 37 | {{- else if .Values.keystone.override.public_url }} 38 | value: "{{ .Values.keystone.override.public_url }}" 39 | {{- else }} 40 | value: "http://{{ template "keystone.fullname" . }}:{{ .Values.keystone.service.port }}" 41 | {{- end }} 42 | {{ include "monasca_keystone_env" .Values.alarm_definition_controller.keystone | indent 12 }} 43 | - name: MONASCA_URL 44 | value: "http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0" 45 | {{- if .Values.alarm_definition_controller.default_notification_name }} 46 | - name: DEFAULT_NOTIFICATION 47 | value: "{{ .Values.alarm_definition_controller.default_notification_name }}" 48 | {{- end }} 49 | - name: NAMESPACE 50 | {{- if .Values.alarm_definition_controller.namespace }} 51 | value: "{{ .Values.alarm_definition_controller.namespace }}" 52 | {{- else }} 53 | valueFrom: 54 | fieldRef: 55 | fieldPath: metadata.namespace 56 | {{- end }} 57 | - name: VERSION 58 | value: "{{ .Values.alarm_definition_controller.version }}" 59 | {{- end }} 60 | -------------------------------------------------------------------------------- /monasca/templates/alarm-definition-resource.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.alarm_definition_controller.resource_enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: ThirdPartyResource 4 | metadata: 5 | name: alarm-definition.monasca.io 6 | description: "A specification to create a Monasca alarm definition" 7 | versions: 8 | - name: {{ .Values.alarm_definition_controller.version }} 9 | {{- end }} 10 | -------------------------------------------------------------------------------- /monasca/templates/alarms-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.alarms.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "alarms.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.alarms.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | {{ toYaml .Values.alarms.definitions_configuration | indent 2 }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /monasca/templates/alarms-init-job.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.alarms.enabled }} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | name: {{ template "alarms.fullname" . }}-init-job 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.alarms.name }}-init-job" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | component: "{{ .Values.alarms.name }}-init-job" 18 | spec: 19 | restartPolicy: OnFailure 20 | containers: 21 | - name: alarms-init-job 22 | image: "{{ .Values.alarms.image.repository }}:{{ .Values.alarms.image.tag }}" 23 | imagePullPolicy: {{ .Values.alarms.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.alarms.resources | indent 12 }} 26 | env: 27 | - name: KEYSTONE_DEFAULTS_ENABLED 28 | value: "{{ .Values.alarms.keystone.defaults_enabled }}" 29 | - name: OS_AUTH_URL 30 | {{- if .Values.alarms.keystone.url }} 31 | {{- if eq (kindOf .Values.alarms.keystone.url) "map" }} 32 | valueFrom: 33 | secretKeyRef: 34 | name: "{{ .Values.alarms.keystone.url.secret_name }}" 35 | key: "{{ .Values.alarms.keystone.url.secret_key | default "OS_AUTH_URL" }}" 36 | {{- else }} 37 | value: "{{ .Values.alarms.keystone.url }}" 38 | {{- end }} 39 | {{- else if .Values.keystone.override.public_url }} 40 | value: "{{ .Values.keystone.override.public_url }}/v3" 41 | {{- else }} 42 | value: "http://{{ template "keystone.fullname" . }}:{{ .Values.keystone.service.port }}/v3" 43 | {{- end }} 44 | {{ include "monasca_keystone_env" .Values.alarms.keystone | indent 12 }} 45 | - name: MONASCA_API_URL 46 | value: "http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0" 47 | - name: MONASCA_WAIT_FOR_API 48 | value: "{{ .Values.alarms.wait.enabled }}" 49 | - name: MONASCA_API_WAIT_RETRIES 50 | value: "{{ .Values.alarms.wait.retries }}" 51 | - name: MONASCA_API_WAIT_DELAY 52 | value: "{{ .Values.alarms.wait.delay }}" 53 | {{- if .Values.alarms.notification_name }} 54 | - name: NOTIFICATION_NAME 55 | value: "{{ .Values.alarms.notification_name }}" 56 | {{- end }} 57 | {{- if .Values.alarms.notification_type }} 58 | - name: NOTIFICATION_TYPE 59 | value: "{{ .Values.alarms.notification_type }}" 60 | {{- end }} 61 | {{- if .Values.alarms.notification_address_secret }} 62 | - name: NOTIFICATION_ADDRESS 63 | valueFrom: 64 | secretKeyRef: 65 | name: "{{ .Values.alarms.notification_address_secret }}" 66 | key: "{{ .Values.alarms.notification_address_secret_key | default .Values.alarms.notification_address_secret }}" 67 | {{- else if .Values.alarms.notification_address }} 68 | - name: NOTIFICATION_ADDRESS 69 | value: "{{ .Values.alarms.notification_address }}" 70 | {{- end }} 71 | volumeMounts: 72 | - name: alarms-config 73 | mountPath: /config/definitions.yml.j2 74 | subPath: definitions.yml.j2 75 | volumes: 76 | - name: alarms-config 77 | configMap: 78 | name: {{ template "alarms.fullname" . }} 79 | items: 80 | - key: definitions.yml.j2 81 | path: definitions.yml.j2 82 | {{- end }} 83 | -------------------------------------------------------------------------------- /monasca/templates/api-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: {{ template "fullname" . }} 6 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 7 | component: "{{ .Values.api.name }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ template "api.fullname" . }} 11 | spec: 12 | type: {{ .Values.api.service.type }} 13 | ports: 14 | - name: http 15 | port: {{ .Values.api.service.port}} 16 | {{- if .Values.api.service.node_port }} 17 | nodePort: {{ .Values.api.service.node_port }} 18 | {{- end }} 19 | selector: 20 | app: {{ template "fullname" . }} 21 | component: "{{ .Values.api.name }}" 22 | -------------------------------------------------------------------------------- /monasca/templates/cleanup-hook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | # while not recommended, we add a random sequence to the end of the job name 5 | # this job will attempt to delete itself when finished, but should it fail for 6 | # some reason we don't want future upgrades to fail because of a name conflict 7 | # (plus the future runs of this job will delete any previous iterations that 8 | # failed to clean themselves up) 9 | name: "{{ template "cleanup.fullname" . }}-job-{{ randAlphaNum 5 | lower }}" 10 | labels: 11 | app: {{ template "fullname" . }} 12 | component: "{{ .Values.cleanup.name }}-job" 13 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 14 | release: "{{ .Release.Name }}" 15 | heritage: "{{ .Release.Service }}" 16 | annotations: 17 | "helm.sh/hook": pre-upgrade,post-delete 18 | "helm.sh/hook-weight": "-5" 19 | spec: 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ template "fullname" . }} 24 | component: "{{ .Values.cleanup.name }}-job" 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 26 | release: "{{ .Release.Name }}" 27 | heritage: "{{ .Release.Service }}" 28 | spec: 29 | restartPolicy: OnFailure 30 | containers: 31 | - name: {{ template "name" . }}-{{ .Values.cleanup.name }}-job 32 | image: "{{ .Values.cleanup.image.repository }}:{{ .Values.cleanup.image.tag }}" 33 | imagePullPolicy: {{ .Values.cleanup.image.pullPolicy }} 34 | resources: 35 | {{ toYaml .Values.cleanup.resources | indent 12 }} 36 | env: 37 | - name: "WAIT_RETRIES" 38 | value: "{{ .Values.cleanup.wait.retries }}" 39 | - name: "WAIT_DELAY" 40 | value: "{{ .Values.cleanup.wait.delay }}" 41 | - name: "WAIT_TIMEOUT" 42 | value: "{{ .Values.cleanup.wait.timeout }}" 43 | {{- if .Values.cleanup.serviceAccount }} 44 | serviceAccountName: {{ .Values.cleanup.serviceAccount | quote }} 45 | {{- else if .Values.rbac.create }} 46 | serviceAccountName: "{{ template "cleanup.fullname" . }}" 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /monasca/templates/cleanup-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["pods"] 21 | verbs: ["get", "list", "delete", "patch"] 22 | - apiGroups: ["batch"] 23 | resources: ["jobs"] 24 | verbs: ["get", "list", "delete"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /monasca/templates/cleanup-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "cleanup.fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "cleanup.fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /monasca/templates/cleanup-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "cleanup.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.cleanup.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /monasca/templates/client-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.client.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "client.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.client.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | template: 14 | metadata: 15 | labels: 16 | component: "{{ .Values.client.name }}-deployment" 17 | app: {{ template "fullname" . }} 18 | spec: 19 | containers: 20 | - name: client 21 | image: "{{ .Values.client.image.repository }}:{{ .Values.client.image.tag }}" 22 | imagePullPolicy: {{ .Values.client.image.pullPolicy }} 23 | command: 24 | - "sh" 25 | - "-c" 26 | - "while true; do sleep 86400; done" 27 | resources: 28 | {{ toYaml .Values.client.resources | indent 12 }} 29 | env: 30 | - name: OS_AUTH_URL 31 | {{- if .Values.client.keystone.url }} 32 | {{- if eq (kindOf .Values.client.keystone.url) "map" }} 33 | valueFrom: 34 | secretKeyRef: 35 | name: "{{ .Values.client.keystone.url.secret_name }}" 36 | key: "{{ .Values.client.keystone.url.secret_key | default "OS_AUTH_URL" }}" 37 | {{- else }} 38 | value: "{{ .Values.client.keystone.url }}" 39 | {{- end }} 40 | {{- else if .Values.keystone.override.public_url }} 41 | value: "{{ .Values.keystone.override.public_url }}/v3" 42 | {{- else }} 43 | value: "http://{{ template "keystone.fullname" . }}:{{ .Values.keystone.service.port }}/v3" 44 | {{- end }} 45 | {{ include "monasca_keystone_env" .Values.client.keystone | indent 12 }} 46 | - name: MONASCA_API_URL 47 | value: "http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0" 48 | {{- end }} 49 | -------------------------------------------------------------------------------- /monasca/templates/forwarder-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.forwarder.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "forwarder.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.forwarder.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | {{ toYaml .Values.forwarder.metric_configuration | indent 2 }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /monasca/templates/forwarder-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.forwarder.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "forwarder.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.forwarder.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: {{ .Values.forwarder.replicaCount }} 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.forwarder.name }}" 19 | annotations: 20 | checksum/metric_config: {{ toYaml .Values.forwarder.metric_configuration | sha256sum }} 21 | spec: 22 | containers: 23 | - name: forwarder 24 | image: "{{ .Values.forwarder.image.repository }}:{{ .Values.forwarder.image.tag }}" 25 | imagePullPolicy: {{ .Values.forwarder.image.pullPolicy }} 26 | resources: 27 | {{ toYaml .Values.forwarder.resources | indent 10 }} 28 | env: 29 | - name: MONASCA_PROJECT_ID 30 | value: {{ .Values.forwarder.config.monasca_project_id | quote }} 31 | - name: REMOTE_API_URL 32 | value: {{ .Values.forwarder.config.remote_api_url | quote }} 33 | - name: DEBUG 34 | value: {{ .Values.forwarder.logging.debug | quote }} 35 | - name: VERBOSE 36 | value: {{ .Values.forwarder.logging.verbose | quote }} 37 | - name: ZOOKEEPER_URL 38 | {{- if .Values.zookeeper.overrideUri }} 39 | value: "{{ .Values.zookeeper.overrideUri }}" 40 | {{- else }} 41 | value: "{{ template "zookeeper.fullname" . }}:2181" 42 | {{- end }} 43 | - name: KAFKA_URI 44 | {{- if .Values.kafka.overrideUri }} 45 | value: "{{ .Values.kafka.overrideUri }}" 46 | {{- else }} 47 | value: "{{ template "kafka.fullname" . }}:9092" 48 | {{- end }} 49 | - name: USE_INSECURE 50 | value: {{ .Values.forwarder.config.use_insecure | quote}} 51 | - name: MONASCA_ROLE 52 | value: {{ .Values.forwarder.config.monasca_role | quote }} 53 | {{- if .Values.forwarder.metric_project_id }} 54 | - name: METRIC_PROJECT_ID 55 | value: {{ .Values.forwarder.config.metric_project_id | quote }} 56 | {{- end }} 57 | volumeMounts: 58 | - name: forwarder-config 59 | mountPath: /config/forwarder_metric_match.yml.j2 60 | subPath: forwarder_metric_match.yml.j2 61 | volumes: 62 | - name: forwarder-config 63 | configMap: 64 | name: {{ template "forwarder.fullname" . }} 65 | items: 66 | - key: forwarder_metric_match.yml 67 | path: forwarder_metric_match.yml.j2 68 | {{- end }} 69 | -------------------------------------------------------------------------------- /monasca/templates/grafana-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.grafana.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "grafana.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.grafana.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | grafana.ini: | 14 | [paths] 15 | plugins = /var/lib/grafana/plugins 16 | 17 | [auth.basic] 18 | enabled = false 19 | 20 | [users] 21 | allow_sign_up = true 22 | allow_org_create = true 23 | 24 | [auth.keystone] 25 | enabled = true 26 | verify_ssl_cert = false 27 | v3 = true 28 | default_domain = Default 29 | 30 | [log.console] 31 | level = trace 32 | 33 | [database] 34 | type = mysql 35 | name = grafana 36 | ssl_mode = disable 37 | {{- end}} 38 | -------------------------------------------------------------------------------- /monasca/templates/grafana-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.grafana.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "grafana.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.grafana.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: 1 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.grafana.name }}" 19 | spec: 20 | containers: 21 | - name: grafana 22 | image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}" 23 | imagePullPolicy: {{ .Values.grafana.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.grafana.resources | indent 12 }} 26 | ports: 27 | - name: http 28 | containerPort: 3000 29 | volumeMounts: 30 | - name: grafana-config 31 | mountPath: /etc/grafana 32 | env: 33 | - name: GF_AUTH_KEYSTONE_AUTH_URL 34 | {{- if .Values.grafana.keystone_url }} 35 | {{- include "monasca_secret_env" .Values.grafana.keystone_url | indent 14 }} 36 | {{- else }} 37 | value: "http://{{ template "keystone.fullname" . }}:{{ .Values.keystone.service.admin_port }}" 38 | {{- end }} 39 | - name: GF_DATABASE_HOST 40 | {{- if .Values.grafana.mysql.host }} 41 | {{- if eq (kindOf .Values.grafana.mysql.host) "map" }} 42 | valueFrom: 43 | secretKeyRef: 44 | name: "{{ .Values.grafana.mysql.host.secret_name }}" 45 | key: "{{ .Values.grafana.mysql.host.secret_key | default "host" }}" 46 | {{- else }} 47 | value: "{{ .Values.grafana.mysql.host }}" 48 | {{- end}} 49 | {{- else }} 50 | value: "{{ .Release.Name }}-mysql" 51 | {{- end}} 52 | - name: GF_DATABASE_PORT 53 | {{- include "monasca_secret_env" .Values.grafana.mysql.port | indent 14 }} 54 | - name: GF_DATABASE_PASSWORD 55 | valueFrom: 56 | secretKeyRef: 57 | {{- if .Values.grafana.mysql.password.secret_name}} 58 | name: "{{ .Values.grafana.mysql.password.secret_name }}" 59 | {{- else }} 60 | name: "{{ .Release.Name }}-mysql-grafana-secret" 61 | {{- end}} 62 | key: "{{ .Values.grafana.mysql.password.secret_key | default "password" }}" 63 | - name: GF_DATABASE_USER 64 | valueFrom: 65 | secretKeyRef: 66 | {{- if .Values.grafana.mysql.username.secret_name}} 67 | name: "{{ .Values.grafana.mysql.username.secret_name }}" 68 | {{- else }} 69 | name: "{{ .Release.Name }}-mysql-grafana-secret" 70 | {{- end}} 71 | key: "{{ .Values.grafana.mysql.username.secret_key | default "username" }}" 72 | volumes: 73 | - name: grafana-config 74 | configMap: 75 | name: {{ template "grafana.fullname" . }} 76 | {{- end}} 77 | -------------------------------------------------------------------------------- /monasca/templates/grafana-init-job.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.grafana.enabled }} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | name: {{ template "grafana.fullname" . }}-init-job 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.grafana.name }}-init-job" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | component: "{{ .Values.grafana.name }}-init-job" 18 | spec: 19 | restartPolicy: OnFailure 20 | containers: 21 | - name: grafana-init-job 22 | image: "{{ .Values.grafana_init.image.repository }}:{{ .Values.grafana_init.image.tag }}" 23 | imagePullPolicy: {{ .Values.grafana_init.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.grafana_init.resources | indent 12 }} 26 | env: 27 | - name: LOG_LEVEL 28 | value: {{ .Values.grafana_init.log_level }} 29 | - name: GRAFANA_URL 30 | {{- if $.Values.grafana.simple_name }} 31 | value: "http://{{ $.Values.grafana.name}}:{{ .Values.grafana.service.port }}" 32 | {{- else }} 33 | value: "http://{{ template "grafana.fullname" . }}:{{ .Values.grafana.service.port }}" 34 | {{- end }} 35 | - name: GRAFANA_USERNAME 36 | {{- include "monasca_secret_env" .Values.grafana_init.username | indent 14 }} 37 | - name: GRAFANA_PASSWORD 38 | {{- include "monasca_secret_env" .Values.grafana_init.password | indent 14 }} 39 | - name: DATASOURCE_URL 40 | value: "http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}" 41 | {{- end}} 42 | -------------------------------------------------------------------------------- /monasca/templates/grafana-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.grafana.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | {{- if $.Values.grafana.simple_name }} 6 | name: {{ $.Values.grafana.name }} 7 | {{- else }} 8 | name: {{ template "grafana.fullname" . }} 9 | {{- end }} 10 | labels: 11 | app: {{ template "fullname" . }} 12 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 13 | component: "{{ .Values.grafana.name }}" 14 | release: "{{ .Release.Name }}" 15 | heritage: "{{ .Release.Service }}" 16 | spec: 17 | type: {{ .Values.grafana.service.type }} 18 | ports: 19 | - name: http 20 | port: {{ .Values.grafana.service.port }} 21 | selector: 22 | app: {{ template "fullname" . }} 23 | component: "{{ .Values.grafana.name }}" 24 | {{- end}} 25 | -------------------------------------------------------------------------------- /monasca/templates/influx-init-job.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.influx_init.enabled }} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | name: {{ .Release.Name }}-influx-init-job 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | spec: 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "fullname" . }} 16 | spec: 17 | restartPolicy: OnFailure 18 | containers: 19 | - name: influx-init-job 20 | image: "{{ .Values.influx_init.image.repository }}:{{ .Values.influx_init.image.tag }}" 21 | imagePullPolicy: {{ .Values.influx_init.image.pullPolicy }} 22 | env: 23 | - name: INFLUXDB_URL 24 | value: "http://{{ .Release.Name }}-influxdb:{{ .Values.influxdb.config.http.bind_address }}" 25 | - name: INFLUXDB_SHARD_DURATION 26 | value: {{ .Values.influx_init.shard_duration | quote }} 27 | - name: INFLUXDB_DEFAULT_RETENTION 28 | value: {{ .Values.influx_init.default_retention | quote }} 29 | resources: 30 | {{ toYaml .Values.influx_init.resources | indent 12 }} 31 | {{- end }} 32 | -------------------------------------------------------------------------------- /monasca/templates/keystone-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.keystone.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | component: "{{ .Values.keystone.name }}" 9 | heritage: "{{ .Release.Service }}" 10 | release: "{{ .Release.Name }}" 11 | name: {{ template "keystone.fullname" . }} 12 | data: 13 | preload.yml: | 14 | users: 15 | - username: mini-mon 16 | password: {{ .Values.keystone.users.mini_mon.password }} 17 | project: mini-mon 18 | role: monasca-user 19 | 20 | - username: monasca-agent 21 | password: {{ .Values.keystone.users.monasca_agent.password }} 22 | project: mini-mon 23 | role: monasca-agent 24 | 25 | - username: mini-mon 26 | password: {{ .Values.keystone.users.mini_mon.password }} 27 | project: mini-mon 28 | role: admin 29 | 30 | - username: admin 31 | password: {{ .Values.keystone.users.admin.password }} 32 | project: admin 33 | role: monasca-user 34 | 35 | - username: demo 36 | password: {{ .Values.keystone.users.demo.password }} 37 | project: demo 38 | role: monasca-user 39 | 40 | - username: monasca-read-only-user 41 | password: {{ .Values.keystone.users.monasca_read_only.password }} 42 | project: mini-mon 43 | role: monasca-read-only-user 44 | 45 | endpoints: 46 | - name: monasca 47 | description: Monasca monitoring service 48 | type: monitoring 49 | region: RegionOne 50 | interfaces: 51 | - name: internal 52 | url: http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0 53 | - name: public 54 | url: http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0 55 | {{- if .Values.api.service.node_port }} 56 | resolve: true 57 | {{- end }} 58 | - name: admin 59 | url: http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}/v2.0 60 | {{- if .Values.api.service.node_port }} 61 | resolve: true 62 | {{- end }} 63 | {{- end}} 64 | -------------------------------------------------------------------------------- /monasca/templates/keystone-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.keystone.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | component: "{{ .Values.keystone.name }}" 9 | heritage: "{{ .Release.Service }}" 10 | release: "{{ .Release.Name }}" 11 | name: {{ template "keystone.fullname" . }} 12 | spec: 13 | replicas: {{ .Values.keystone.replicaCount }} 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.keystone.name }}" 19 | spec: 20 | volumes: 21 | - name: preload-config 22 | configMap: 23 | name: {{ template "keystone.fullname" . }} 24 | items: 25 | - key: preload.yml 26 | path: preload.yml 27 | containers: 28 | - name: keystone 29 | image: "{{ .Values.keystone.image.repository }}:{{ .Values.keystone.image.tag }}" 30 | imagePullPolicy: {{ .Values.keystone.image.pullPolicy }} 31 | resources: 32 | {{ toYaml .Values.keystone.resources | indent 12 }} 33 | env: 34 | - name: KEYSTONE_HOST 35 | valueFrom: 36 | fieldRef: 37 | fieldPath: status.podIP 38 | - name: KEYSTONE_USERNAME 39 | value: {{ .Values.keystone.bootstrap.user | quote }} 40 | - name: KEYSTONE_PASSWORD 41 | value: {{ .Values.keystone.bootstrap.password | quote }} 42 | - name: KEYSTONE_PROJECT 43 | value: {{ .Values.keystone.bootstrap.project | quote }} 44 | - name: KEYSTONE_ROLE 45 | value: {{ .Values.keystone.bootstrap.role | quote }} 46 | - name: KEYSTONE_SERVICE 47 | value: {{ .Values.keystone.bootstrap.service | quote }} 48 | - name: KEYSTONE_REGION 49 | value: {{ .Values.keystone.bootstrap.region | quote }} 50 | - name: KEYSTONE_DATABASE_BACKEND 51 | value: {{ .Values.keystone.database_backend | quote }} 52 | - name: KEYSTONE_MYSQL_HOST 53 | value: "{{ .Release.Name }}-mysql" 54 | - name: KEYSTONE_MYSQL_USER 55 | valueFrom: 56 | secretKeyRef: 57 | name: "{{ .Release.Name }}-mysql-keystone-secret" 58 | key: username 59 | - name: KEYSTONE_MYSQL_PASSWORD 60 | valueFrom: 61 | secretKeyRef: 62 | name: "{{ .Release.Name }}-mysql-keystone-secret" 63 | key: password 64 | - name: KEYSTONE_MYSQL_DATABASE 65 | value: {{ .Values.keystone.mysql.database | quote }} 66 | - name: KEYSTONE_MYSQL_TCP_PORT 67 | value: "3306" 68 | {{- if .Values.keystone.service.node_port }} 69 | {{- if .Values.keystone.service.admin_node_port }} 70 | - name: KUBERNETES_RESOLVE_PUBLIC_ENDPOINTS 71 | value: "true" 72 | - name: KEYSTONE_SERVICE_NAME 73 | value: "{{ template "keystone.fullname" . }}" 74 | {{- end }} 75 | {{- end }} 76 | ports: 77 | - name: http 78 | containerPort: 5000 79 | - name: admin 80 | containerPort: 35357 81 | volumeMounts: 82 | - name: preload-config 83 | mountPath: /preload.yml 84 | subPath: preload.yml 85 | {{- end}} 86 | -------------------------------------------------------------------------------- /monasca/templates/keystone-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.keystone.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | component: "{{ .Values.keystone.name }}" 9 | heritage: "{{ .Release.Service }}" 10 | release: "{{ .Release.Name }}" 11 | name: {{ template "keystone.fullname" . }} 12 | spec: 13 | type: {{ .Values.keystone.service.type }} 14 | ports: 15 | - name: http 16 | port: {{ .Values.keystone.service.port }} 17 | targetPort: http 18 | {{- if .Values.keystone.service.node_port }} 19 | nodePort: {{ .Values.keystone.service.node_port }} 20 | {{- end }} 21 | - name: admin 22 | port: {{ .Values.keystone.service.admin_port }} 23 | targetPort: admin 24 | {{- if .Values.keystone.service.admin_node_port }} 25 | nodePort: {{ .Values.keystone.service.admin_node_port }} 26 | {{- end }} 27 | selector: 28 | app: {{ template "fullname" . }} 29 | component: "{{ .Values.keystone.name }}" 30 | {{- end}} 31 | -------------------------------------------------------------------------------- /monasca/templates/memcached-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.memcached.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "memcached.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.memcached.name }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: {{ .Values.memcached.replicaCount }} 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.memcached.name }}" 19 | spec: 20 | containers: 21 | - name: memcached 22 | image: "{{ .Values.memcached.image.repository }}:{{ .Values.memcached.image.tag }}" 23 | imagePullPolicy: {{ .Values.memcached.image.pullPolicy }} 24 | resources: 25 | {{ toYaml .Values.memcached.resources | indent 10 }} 26 | ports: 27 | - containerPort: 11211 28 | name: memcached 29 | {{- end }} 30 | -------------------------------------------------------------------------------- /monasca/templates/memcached-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.memcached.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | component: "{{ .Values.memcached.name }}" 9 | heritage: "{{ .Release.Service }}" 10 | release: "{{ .Release.Name }}" 11 | name: {{ template "memcached.fullname" . }} 12 | spec: 13 | type: {{ .Values.memcached.service.type | default "ClusterIP" }} 14 | ports: 15 | - name: memcached 16 | port: {{ .Values.memcached.service.port | default "11211" }} 17 | targetPort: memcached 18 | {{- if .Values.memcached.service.node_port }} 19 | nodePort: {{ .Values.memcached.service.node_port }} 20 | {{- end }} 21 | selector: 22 | app: {{ template "fullname" . }} 23 | component: "{{ .Values.memcached.name }}" 24 | {{- end}} 25 | -------------------------------------------------------------------------------- /monasca/templates/mysql-api-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: "{{ .Release.Name }}-mysql-api-secret" 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | type: Opaque 11 | data: 12 | username: {{ b64enc .Values.mysql.users.api.username | quote }} 13 | password: {{ b64enc .Values.mysql.users.api.password | quote }} 14 | -------------------------------------------------------------------------------- /monasca/templates/mysql-grafana-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.grafana.enabled }} 2 | {{- if .Values.grafana.local_mysql_enabled }} 3 | apiVersion: v1 4 | kind: Secret 5 | metadata: 6 | name: "{{ .Release.Name }}-mysql-grafana-secret" 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | heritage: "{{ .Release.Service }}" 11 | release: "{{ .Release.Name }}" 12 | type: Opaque 13 | data: 14 | username: {{ b64enc .Values.mysql.users.grafana.username | quote }} 15 | password: {{ b64enc .Values.mysql.users.grafana.password | quote }} 16 | {{- end}} 17 | {{- end}} 18 | -------------------------------------------------------------------------------- /monasca/templates/mysql-keystone-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: "{{ .Release.Name }}-mysql-keystone-secret" 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | type: Opaque 11 | data: 12 | username: {{ b64enc .Values.mysql.users.keystone.username | quote }} 13 | password: {{ b64enc .Values.mysql.users.keystone.password | quote }} 14 | -------------------------------------------------------------------------------- /monasca/templates/mysql-notification-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: "{{ .Release.Name }}-mysql-notification-secret" 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | type: Opaque 11 | data: 12 | username: {{ b64enc .Values.mysql.users.notification.username | quote }} 13 | password: {{ b64enc .Values.mysql.users.notification.password | quote }} 14 | -------------------------------------------------------------------------------- /monasca/templates/mysql-thresh-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: "{{ .Release.Name }}-mysql-thresh-secret" 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | type: Opaque 11 | data: 12 | username: {{ b64enc .Values.mysql.users.thresh.username | quote }} 13 | password: {{ b64enc .Values.mysql.users.thresh.password | quote }} 14 | -------------------------------------------------------------------------------- /monasca/templates/notification-hipchat-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.notification.enabled }} 2 | {{- if .Values.notification.plugin_config.hipchat.template }} 3 | apiVersion: v1 4 | kind: ConfigMap 5 | metadata: 6 | name: "{{ template "notification.fullname" . }}-hipchat-template" 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | component: "{{ .Values.notification.name }}" 11 | release: "{{ .Release.Name }}" 12 | heritage: "{{ .Release.Service }}" 13 | data: 14 | hipchat-template.yml.j2: | 15 | {{ .Values.notification.plugin_config.hipchat.template | indent 4 }} 16 | {{- end }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /monasca/templates/persister-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: {{ template "fullname" . }} 6 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 7 | component: "{{ .Values.persister.name }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ template "persister.fullname" . }} 11 | spec: 12 | replicas: {{ .Values.persister.replicaCount }} 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | component: "{{ .Values.persister.name }}" 18 | spec: 19 | containers: 20 | - name: persister 21 | image: "{{ .Values.persister.image.repository }}:{{ .Values.persister.image.tag }}" 22 | imagePullPolicy: {{ .Values.persister.image.pullPolicy }} 23 | resources: 24 | {{ toYaml .Values.persister.resources | indent 10 }} 25 | env: 26 | - name: DEBUG 27 | value: {{ .Values.persister.logging.debug | quote }} 28 | - name: VERBOSE 29 | value: {{ .Values.persister.logging.verbose | quote }} 30 | - name: ZOOKEEPER_URI 31 | {{- if .Values.zookeeper.overrideUri }} 32 | value: "{{ .Values.zookeeper.overrideUri }}" 33 | {{- else }} 34 | value: "{{ template "zookeeper.fullname" . }}:2181" 35 | {{- end }} 36 | - name: KAFKA_URI 37 | {{- if .Values.kafka.overrideUri }} 38 | value: "{{ .Values.kafka.overrideUri }}" 39 | {{- else }} 40 | value: "{{ template "kafka.fullname" . }}:9092" 41 | {{- end }} 42 | - name: INFLUX_PORT 43 | value: {{ .Values.influxdb.config.http.bind_address | quote }} 44 | - name: INFLUX_USER 45 | value: {{ .Values.persister.influxdb.user | quote }} 46 | - name: INFLUX_PASSWORD 47 | value: {{ .Values.persister.influxdb.password | quote }} 48 | - name: INFLUX_DB 49 | value: {{ .Values.persister.influxdb.database | quote }} 50 | - name: INFLUX_HOST 51 | value: "{{ .Release.Name }}-influxdb" 52 | - name: KAFKA_METRICS_BATCH_SIZE 53 | value: {{ .Values.persister.kafka.metrics.batch_size | quote }} 54 | - name: KAFKA_METRICS_WAIT_TIME 55 | value: {{ .Values.persister.kafka.metrics.wait_time | quote }} 56 | - name: KAFKA_ALARM_HISTORY_BATCH_SIZE 57 | value: {{ .Values.persister.kafka.alarm_history.batch_size | quote }} 58 | - name: KAFKA_ALARM_HISTORY_WAIT_TIME 59 | value: {{ .Values.persister.kafka.alarm_history.wait_time | quote }} 60 | -------------------------------------------------------------------------------- /monasca/templates/smoke-test-pod.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.smoke_tests.enabled }} 2 | apiVersion: v1 3 | kind: Pod 4 | metadata: 5 | name: {{ template "smoke_tests.fullname" . }}-test-pod 6 | annotations: 7 | "helm.sh/hook": test-success 8 | labels: 9 | app: {{ template "fullname" . }} 10 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 11 | component: "{{ .Values.smoke_tests.name }}-test-pod" 12 | release: "{{ .Release.Name }}" 13 | heritage: "{{ .Release.Service }}" 14 | spec: 15 | restartPolicy: Never 16 | containers: 17 | - name: smoke-tests 18 | image: "{{ .Values.smoke_tests.image.repository }}:{{ .Values.smoke_tests.image.tag }}" 19 | imagePullPolicy: {{ .Values.smoke_tests.image.pullPolicy }} 20 | resources: 21 | {{ toYaml .Values.smoke_tests.resources | indent 8 }} 22 | ports: 23 | - containerPort: 8080 24 | name: smoke-tests 25 | env: 26 | - name: OS_AUTH_URL 27 | {{- if .Values.smoke_tests.keystone.url }} 28 | {{- if eq (kindOf .Values.smoke_tests.keystone.url) "map" }} 29 | valueFrom: 30 | secretKeyRef: 31 | name: "{{ .Values.smoke_tests.keystone.url.secret_name }}" 32 | key: "{{ .Values.smoke_tests.keystone.url.secret_key | default "OS_AUTH_URL" }}" 33 | {{- else }} 34 | value: "{{ .Values.smoke_tests.keystone.url }}" 35 | {{- end }} 36 | {{- else if .Values.keystone.override.public_url }} 37 | value: "{{ .Values.keystone.override.public_url }}/v3" 38 | {{- else }} 39 | value: "http://{{ template "keystone.fullname" . }}:{{ .Values.keystone.service.port }}/v3" 40 | {{- end }} 41 | {{ include "monasca_keystone_env" .Values.smoke_tests.keystone | indent 8 }} 42 | - name: MONASCA_URL 43 | value: "http://{{ template "api.fullname" . }}:{{ .Values.api.service.port }}" 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /monasca/templates/static-api-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.api.static_service.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | component: "{{ .Values.api.name }}" 9 | heritage: "{{ .Release.Service }}" 10 | release: "{{ .Release.Name }}" 11 | name: {{ .Values.api.static_service.name }} 12 | spec: 13 | type: {{ .Values.api.static_service.type }} 14 | ports: 15 | - name: http 16 | port: {{ .Values.api.static_service.port}} 17 | {{- if .Values.api.static_service.node_port }} 18 | nodePort: {{ .Values.api.static_service.node_port }} 19 | {{- end }} 20 | selector: 21 | app: {{ template "fullname" . }} 22 | component: "{{ .Values.api.name }}" 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /monasca/templates/static-keystone-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.keystone.enabled }} 2 | {{- if .Values.keystone.static_service.enabled }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.keystone.name }}" 10 | heritage: "{{ .Release.Service }}" 11 | release: "{{ .Release.Name }}" 12 | name: {{ .Values.keystone.static_service.name }} 13 | spec: 14 | type: {{ .Values.keystone.static_service.type }} 15 | ports: 16 | - name: http 17 | port: {{ .Values.keystone.static_service.port }} 18 | targetPort: http 19 | {{- if .Values.keystone.static_service.node_port }} 20 | nodePort: {{ .Values.keystone.static_service.node_port }} 21 | {{- end }} 22 | - name: admin 23 | port: {{ .Values.keystone.static_service.admin_port }} 24 | targetPort: admin 25 | {{- if .Values.keystone.static_service.admin_node_port }} 26 | nodePort: {{ .Values.keystone.static_service.admin_node_port }} 27 | {{- end }} 28 | selector: 29 | app: {{ template "fullname" . }} 30 | component: "{{ .Values.keystone.name }}" 31 | {{- end }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /monasca/templates/tempest-tests-pod.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.tempest_tests.enabled }} 2 | apiVersion: v1 3 | kind: Pod 4 | metadata: 5 | name: {{ template "tempest_tests.fullname" . }}-test-pod 6 | annotations: 7 | "helm.sh/hook": test-success 8 | labels: 9 | app: {{ template "fullname" . }} 10 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 11 | component: "{{ .Values.tempest_tests.name }}-test-pod" 12 | release: "{{ .Release.Name }}" 13 | heritage: "{{ .Release.Service }}" 14 | spec: 15 | restartPolicy: Never 16 | containers: 17 | - name: tempest-tests 18 | image: "{{ .Values.tempest_tests.image.repository }}:{{ .Values.tempest_tests.image.tag }}" 19 | imagePullPolicy: {{ .Values.tempest_tests.image.pullPolicy }} 20 | env: 21 | - name: MONASCA_WAIT_FOR_API 22 | value: "{{ .Values.tempest_tests.wait.enabled }}" 23 | - name: MONASCA_API_WAIT_RETRIES 24 | value: "{{ .Values.tempest_tests.wait.retries }}" 25 | - name: MONASCA_API_WAIT_DELAY 26 | value: "{{ .Values.tempest_tests.wait.delay }}" 27 | - name: OS_PASSWORD 28 | value: "{{ .Values.tempest_tests.keystone.os_password }}" 29 | - name: OS_USERNAME 30 | value: "{{ .Values.tempest_tests.keystone.os_username }}" 31 | - name: KEYSTONE_SERVER 32 | value: {{ template "keystone.fullname" . }} 33 | - name: KEYSTONE_PORT 34 | value: "{{ .Values.keystone.service.port }}" 35 | - name: OS_TENANT_NAME 36 | value: "{{ .Values.tempest_tests.keystone.os_tenant_name }}" 37 | - name: OS_DOMAIN_NAME 38 | value: "{{ .Values.tempest_tests.keystone.os_domain_name }}" 39 | - name: ALT_USERNAME 40 | value: "{{ .Values.tempest_tests.keystone.alt_username }}" 41 | - name: ALT_PASSWORD 42 | value: "{{ .Values.tempest_tests.keystone.alt_password }}" 43 | - name: ALT_TENANT_NAME 44 | value: "{{ .Values.tempest_tests.keystone.alt_tenant_name }}" 45 | - name: AUTH_USE_SSL 46 | value: "{{ .Values.tempest_tests.keystone.auth_use_ssl }}" 47 | - name: USE_DYNAMIC_CREDS 48 | value: "{{ .Values.tempest_tests.use_dynamic_creds }}" 49 | - name: ADMIN_PROJECT_NAME 50 | value: "{{ .Values.tempest_tests.keystone.admin_project_name }}" 51 | - name: ADMIN_USERNAME 52 | value: "{{ .Values.tempest_tests.keystone.admin_username }}" 53 | - name: ADMIN_PASSWORD 54 | value: "{{ .Values.tempest_tests.keystone.admin_password }}" 55 | - name: ADMIN_DOMAIN_NAME 56 | value: "{{ .Values.tempest_tests.keystone.admin_domain_name }}" 57 | - name: OSTESTR_REGEX 58 | value: "{{ .Values.tempest_tests.ostestr_regex }}" 59 | - name: STAY_ALIVE_ON_FAILURE 60 | value: "{{ .Values.tempest_tests.stay_alive_on_failure }}" 61 | {{- end }} 62 | -------------------------------------------------------------------------------- /mysql-users-init/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /mysql-users-init/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Chart to initialize users and databases in MySQL 3 | name: mysql-users-init 4 | version: 0.2.1 5 | -------------------------------------------------------------------------------- /mysql-users-init/templates/NOTES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monasca/monasca-helm/65529892127e600eefd8e360a6b850c3c79583b8/mysql-users-init/templates/NOTES.txt -------------------------------------------------------------------------------- /mysql-users-init/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | Create a fully qualified cleanup name. 20 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 21 | */}} 22 | {{- define "cleanup.fullname" -}} 23 | {{- printf "%s-%s" .Release.Name "cleanup" | trunc 63 -}} 24 | {{- end -}} 25 | 26 | {{- /* 27 | Read a single optional secret or string from values into an `env` `value:` or 28 | `valueFrom:`, depending on the user-defined content of the value. 29 | 30 | Example: 31 | - name: OS_AUTH_URL 32 | {{ include "mysql_users_secret_env" .Values.auth.url | indent 4 }} 33 | 34 | Make sure to change the name of this template when copying to keep it unique, 35 | e.g. chart_name_secret_env. 36 | */}} 37 | {{- define "mysql_users_init_secret_env" -}} 38 | {{- if eq (kindOf .) "map" -}} 39 | valueFrom: 40 | secretKeyRef: 41 | name: "{{ .secret_name }}" 42 | key: "{{ .secret_key }}" 43 | {{- else -}} 44 | value: "{{ . }}" 45 | {{- end -}} 46 | {{- end -}} 47 | -------------------------------------------------------------------------------- /mysql-users-init/templates/cleanup-hook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | # while not recommended, we add a random sequence to the end of the job name 5 | # this job will attempt to delete itself when finished, but should it fail for 6 | # some reason we don't want future upgrades to fail because of a name conflict 7 | # (plus the future runs of this job will delete any previous iterations that 8 | # failed to clean themselves up) 9 | name: "{{ template "cleanup.fullname" . }}-job-{{ randAlphaNum 5 | lower }}" 10 | labels: 11 | app: {{ template "fullname" . }} 12 | component: "{{ .Values.cleanup.name }}" 13 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 14 | release: "{{ .Release.Name }}" 15 | heritage: "{{ .Release.Service }}" 16 | annotations: 17 | "helm.sh/hook": pre-upgrade,post-delete 18 | "helm.sh/hook-weight": "-5" 19 | spec: 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ template "fullname" . }} 24 | component: "{{ .Values.cleanup.name }}" 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 26 | release: "{{ .Release.Name }}" 27 | heritage: "{{ .Release.Service }}" 28 | spec: 29 | restartPolicy: OnFailure 30 | containers: 31 | - name: {{ template "name" . }}-{{ .Values.cleanup.name }}-job 32 | image: "{{ .Values.cleanup.image.repository }}:{{ .Values.cleanup.image.tag }}" 33 | imagePullPolicy: {{ .Values.cleanup.image.pullPolicy }} 34 | resources: 35 | {{ toYaml .Values.cleanup.resources | indent 12 }} 36 | env: 37 | - name: "WAIT_RETRIES" 38 | value: "{{ .Values.cleanup.wait.retries }}" 39 | - name: "WAIT_DELAY" 40 | value: "{{ .Values.cleanup.wait.delay }}" 41 | - name: "WAIT_TIMEOUT" 42 | value: "{{ .Values.cleanup.wait.timeout }}" 43 | {{- if .Values.cleanup.serviceAccount }} 44 | serviceAccountName: {{ .Values.cleanup.serviceAccount | quote }} 45 | {{- else if .Values.rbac.create }} 46 | serviceAccountName: "{{ template "cleanup.fullname" . }}" 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /mysql-users-init/templates/cleanup-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["pods"] 21 | verbs: ["get", "list", "delete", "patch"] 22 | - apiGroups: ["batch"] 23 | resources: ["jobs"] 24 | verbs: ["get", "list", "delete"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /mysql-users-init/templates/cleanup-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "cleanup.fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.cleanup.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "cleanup.fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "cleanup.fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /mysql-users-init/templates/cleanup-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.cleanup.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "cleanup.fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.cleanup.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /mysql-users-init/templates/mysql-users-init-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: {{ template "fullname" . }}-job 5 | labels: 6 | app: {{ template "fullname" . }} 7 | component: "{{ .Values.mysql_users_init.name }}" 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | spec: 12 | {{- if .Values.mysql_users_init.deadline }} 13 | activeDeadlineSeconds: {{ .Values.mysql_users_init.deadline }} 14 | {{- end }} 15 | template: 16 | metadata: 17 | labels: 18 | app: {{ template "fullname" . }} 19 | component: "{{ .Values.mysql_users_init.name }}" 20 | spec: 21 | restartPolicy: OnFailure 22 | volumes: 23 | - name: preload-config 24 | configMap: 25 | name: "{{ template "fullname" . }}-preload" 26 | containers: 27 | - name: {{ template "fullname" . }}-job 28 | image: "{{ .Values.mysql_users_init.image.repository }}:{{ .Values.mysql_users_init.image.tag }}" 29 | imagePullPolicy: {{ .Values.mysql_users_init.image.pullPolicy }} 30 | resources: 31 | {{ toYaml .Values.mysql_users_init.resources | indent 12 }} 32 | env: 33 | - name: LOG_LEVEL 34 | value: {{ .Values.mysql_users_init.log_level }} 35 | - name: MYSQL_INIT_HOST 36 | {{ include "mysql_users_init_secret_env" .Values.mysql_users_init.mysql.host | indent 14 }} 37 | - name: MYSQL_INIT_PORT 38 | {{ include "mysql_users_init_secret_env" .Values.mysql_users_init.mysql.port | indent 14 }} 39 | - name: MYSQL_INIT_USERNAME 40 | {{ include "mysql_users_init_secret_env" .Values.mysql_users_init.mysql.username | indent 14 }} 41 | - name: MYSQL_INIT_PASSWORD 42 | {{ include "mysql_users_init_secret_env" .Values.mysql_users_init.mysql.password | indent 14 }} 43 | - name: PRELOAD_PATH 44 | value: "/config/preload.yml" 45 | volumeMounts: 46 | - name: preload-config 47 | mountPath: /config 48 | {{- if .Values.mysql_users_init.serviceAccount }} 49 | serviceAccountName: {{ .Values.mysql_users_init.serviceAccount | quote }} 50 | {{- else if .Values.rbac.create }} 51 | serviceAccountName: "{{ template "fullname" . }}" 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /mysql-users-init/templates/mysql-users-init-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.mysql_users_init.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: Role 10 | metadata: 11 | name: {{ template "fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.mysql_users_init.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | rules: 19 | - apiGroups: [""] 20 | resources: ["secrets"] 21 | verbs: ["get", "create", "update"] 22 | - apiGroups: [""] 23 | resources: ["namespaces"] 24 | verbs: ["get", "create"] 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /mysql-users-init/templates/mysql-users-init-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.mysql_users_init.serviceAccount) }} 2 | {{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} 5 | apiVersion: rbac.authorization.k8s.io/v1beta1 6 | {{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} 7 | apiVersion: rbac.authorization.k8s.io/v1alpha1 8 | {{- end }} 9 | kind: RoleBinding 10 | metadata: 11 | name: {{ template "fullname" . }} 12 | labels: 13 | app: {{ template "fullname" . }} 14 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 15 | component: "{{ .Values.mysql_users_init.name }}" 16 | heritage: {{ .Release.Service }} 17 | release: {{ .Release.Name }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "fullname" . }} 21 | namespace: "{{ .Release.Namespace }}" 22 | roleRef: 23 | kind: Role 24 | name: {{ template "fullname" . }} 25 | apiGroup: rbac.authorization.k8s.io 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /mysql-users-init/templates/mysql-users-init-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.rbac.create) (not .Values.mysql_users_init.serviceAccount) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 9 | component: "{{ .Values.mysql_users_init.name }}" 10 | heritage: {{ .Release.Service }} 11 | release: {{ .Release.Name }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /mysql-users-init/templates/mysql-users-preload-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: "{{ template "fullname" . }}-preload" 5 | labels: 6 | app: "{{ template "fullname" . }}" 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | data: 11 | preload.yml: | 12 | {{ toYaml .Values.mysql_users_init.preload | indent 4 }} 13 | -------------------------------------------------------------------------------- /mysql-users-init/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for mysql-users-init. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | mysql_users_init: 5 | name: job 6 | 7 | # an optional preexisting serviceAccount to use 8 | # to create a service account with the deployment, 9 | # deploy with rbac.create=true 10 | serviceAccount: '' 11 | 12 | image: 13 | repository: monasca/mysql-users-init 14 | tag: 1.1.0 15 | pullPolicy: IfNotPresent 16 | 17 | # general options for the init job 18 | log_level: INFO # python logging level 19 | 20 | # mysql connection details for this component 21 | # note that these options allow the init container to connect to mysql and 22 | # the referenced account must already exist 23 | # each parameter may either be specified directly as a string OR reference a 24 | # secret 25 | # example: 26 | # # plaintext (will be stored in Helm's ConfigMap) 27 | # password: 'some-plaintext-password' 28 | # 29 | # # secret ref 30 | # password: 31 | # secret_name: some-secret-name 32 | # secret_key: some-key 33 | mysql: 34 | host: mysql 35 | port: '3306' 36 | username: root 37 | password: password 38 | 39 | preload: 40 | users: [] 41 | databases: [] 42 | 43 | # container resource limits and requests 44 | resources: 45 | limits: 46 | cpu: 100m 47 | memory: 128Mi 48 | requests: 49 | cpu: 100m 50 | memory: 128Mi 51 | 52 | cleanup: 53 | name: cleanup 54 | serviceAccount: '' 55 | image: 56 | repository: monasca/job-cleanup 57 | tag: 1.2.1 58 | pullPolicy: IfNotPresent 59 | resources: 60 | requests: 61 | memory: 128Mi 62 | cpu: 200m 63 | limits: 64 | memory: 128Mi 65 | cpu: 250m 66 | wait: 67 | retries: "24" 68 | delay: "5.0" 69 | timeout: "10" 70 | 71 | rbac: 72 | create: false 73 | -------------------------------------------------------------------------------- /push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | REPO=$(git config remote.origin.url) 5 | SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} 6 | 7 | # Set up git config 8 | git config --global user.email "monasca@lists.launchpad.net" 9 | git config --global user.name "Monasca CI" 10 | 11 | # Initialize Helm 12 | ./helm init -c 13 | 14 | # Build Helm Charts 15 | ./helm repo add monasca http://monasca.io/monasca-helm/ 16 | 17 | for chart in "$@" 18 | do 19 | ./helm dependency update "$chart" 20 | ./helm package "$chart" 21 | done 22 | 23 | # clone repo to make changes in 24 | git clone $REPO out 25 | cd out 26 | git checkout gh-pages 27 | cd .. 28 | 29 | # copy over packages 30 | cp *.tgz out/. 31 | 32 | # Update index file 33 | cd out 34 | ../helm repo index . --url http://monasca.io/monasca-helm/ 35 | 36 | # Commit changes 37 | git add *.tgz 38 | git add index.yaml 39 | git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" 40 | 41 | # Set up key to push 42 | set +x 43 | openssl aes-256-cbc -K $encrypted_c04b32b34bc7_key -iv $encrypted_c04b32b34bc7_iv -in ../deploy-key.enc -out ../deploy-key -d 44 | chmod 600 ../deploy-key 45 | eval "$(ssh-agent -s)" 46 | ssh-add ../deploy-key 47 | 48 | # Push Changes 49 | git push "$SSH_REPO" gh-pages 50 | 51 | # Remove out directory 52 | cd .. 53 | rm -rf out 54 | git checkout -- . 55 | 56 | # check out master branch again to create pull requests 57 | git status 58 | -------------------------------------------------------------------------------- /spark/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /spark/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Spark cluster chart 3 | name: spark 4 | version: 0.2.3 5 | maintainers: 6 | - name: David C Kennedy 7 | email: david.c.kennedy@hpe.com 8 | -------------------------------------------------------------------------------- /spark/requirements.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monasca/monasca-helm/65529892127e600eefd8e360a6b850c3c79583b8/spark/requirements.yaml -------------------------------------------------------------------------------- /spark/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spark/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /spark/templates/spark-master-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | #namespace: monitoring 5 | name: spark-master-config 6 | data: 7 | spark-defaults.conf: | 8 | spark.blockManager.port {{ .Values.spark_master.config.ports.blockManager }} 9 | spark.broadcast.port {{ .Values.spark_master.config.ports.broadcast }} 10 | spark.cleaner.ttl 900 11 | spark.cores.max 1 12 | spark.driver.extraClassPath {{ .Values.spark_master.config.driver.extraClassPath }} 13 | spark.driver.extraJavaOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_driver.log -Xmx512m 14 | spark.driver.memory 512m 15 | spark.driver.port {{ .Values.spark_master.config.ports.driver }} 16 | spark.eventLog.dir {{ .Values.spark_master.config.eventLog_dir }} 17 | spark.executor.cores 1 18 | spark.executor.extraClassPath {{ .Values.spark_master.config.executor.extraClassPath }} 19 | spark.executor.extraJavaOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_executor.log 20 | spark.executor.memory 512m 21 | spark.executor.port {{ .Values.spark_master.config.ports.executor }} 22 | spark.fileserver.port {{ .Values.spark_master.config.ports.fileserver }} 23 | spark.history.fs.logDirectory {{ .Values.spark_master.config.history_fs_logDirectory }} 24 | spark.history.ui.port {{ .Values.spark_master.config.ports.history_ui }} 25 | spark.python.worker.memory 16m 26 | spark.speculation {{ .Values.spark_master.config.speculation }} 27 | spark.speculation.interval {{ .Values.spark_master.config.speculation_interval }} 28 | spark.sql.shuffle.partitions 32 29 | spark.sql.ui.retainedExecutions 10 30 | spark.streaming.ui.retainedBatches 10 31 | spark.ui.retainedJobs 10 32 | spark.ui.retainedStages 10 33 | spark.worker.cleanup.enabled True 34 | spark.worker.ui.retainedDrivers 10 35 | spark.worker.ui.retainedExecutors 10 36 | 37 | 38 | spark-env.sh: | 39 | #!/usr/bin/env bash 40 | export SPARK_MASTER_PORT={{ .Values.spark_master.config.ports.master }} 41 | export SPARK_MASTER_WEBUI_PORT={{ .Values.spark_master.config.ports.master_web_ui }} 42 | 43 | export SPARK_WORKER_PORT={{ .Values.spark_master.config.ports.worker }} 44 | export SPARK_WORKER_WEBUI_PORT={{ .Values.spark_master.config.ports.worker_web_ui }} 45 | export SPARK_LOG_DIR={{ .Values.spark_master.config.log_dir }} 46 | export SPARK_DAEMON_JAVA_OPTS={{ .Values.spark_master.config.daemon_java_opts }} 47 | start_spark_master.sh: | 48 | #!/usr/bin/env bash 49 | . /etc/config/spark-env.sh 50 | export EXEC_CLASS=org.apache.spark.deploy.master.Master 51 | export INSTANCE_ID=1 52 | export SPARK_CLASSPATH=/opt/spark/current/conf/:/opt/spark/current/lib/spark-assembly-1.6.1-hadoop2.6.0.jar:/opt/spark/current/lib/datanucleus-core-3.2.10.jar:/opt/spark/current/lib/datanucleus-rdbms-3.2.9.jar:/opt/spark/current/lib/datanucleus-api-jdo-3.2.6.jar 53 | export log="$SPARK_LOG_DIR/spark-spark-"$EXEC_CLASS"-"$INSTANCE_ID"-${SPARK_LOCAL_IP}.out" 54 | export SPARK_HOME=/opt/spark/current 55 | 56 | /usr/bin/java -cp $SPARK_CLASSPATH $SPARK_DAEMON_JAVA_OPTS -Xms1g -Xmx1g "$EXEC_CLASS" --ip "$SPARK_MASTER_IP" --port "$SPARK_MASTER_PORT" --webui-port "$SPARK_MASTER_WEBUI_PORT" 2>&1 | tee $log 57 | 58 | -------------------------------------------------------------------------------- /spark/templates/spark-master-rc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: spark-master 5 | #namespace: monitoring 6 | labels: 7 | app: spark-master 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | spec: 10 | replicas: {{ .Values.spark_master.replicaCount }} 11 | selector: 12 | app: spark-master 13 | template: 14 | metadata: 15 | labels: 16 | app: spark-master 17 | spec: 18 | containers: 19 | - name: {{ .Values.spark_master.containerName }} 20 | image: "{{ .Values.spark_master.image.repository }}/{{ .Values.spark_master.image.tag }}" 21 | command: 22 | - "/bin/bash" 23 | - "/etc/config/start_spark_master.sh" 24 | env: 25 | - name: SPARK_LOCAL_IP 26 | valueFrom: 27 | fieldRef: 28 | fieldPath: status.podIP 29 | - name: SPARK_MASTER_IP 30 | valueFrom: 31 | fieldRef: 32 | fieldPath: status.podIP 33 | ports: 34 | - name: master 35 | containerPort: 7077 36 | - name: master-webui 37 | containerPort: 18080 38 | - name: block-manager 39 | containerPort: 7100 40 | - name: broadcast 41 | containerPort: 7105 42 | - name: driver 43 | containerPort: 7110 44 | - name: executor 45 | containerPort: 7115 46 | - name: fileserver 47 | containerPort: 7120 48 | volumeMounts: 49 | - name: config-volume 50 | mountPath: /etc/config 51 | volumes: 52 | - name: config-volume 53 | configMap: 54 | name: spark-master-config 55 | 56 | -------------------------------------------------------------------------------- /spark/templates/spark-master-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Values.spark_master.service.name }} 5 | #namespace: monitoring 6 | labels: 7 | app: spark-master 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | spec: 10 | ports: 11 | - name: master 12 | port: 7077 13 | targetPort: master 14 | - name: master-webui 15 | port: 18080 16 | targetPort: master-webui 17 | - name: block-manager 18 | port: 7100 19 | targetPort: block-manager 20 | - name: broadcast 21 | port: 7105 22 | targetPort: broadcast 23 | - name: driver 24 | port: 7110 25 | targetPort: driver 26 | - name: executor 27 | port: 7115 28 | targetPort: executor 29 | - name: fileserver 30 | port: 7120 31 | targetPort: fileserver 32 | selector: 33 | app: spark-master 34 | 35 | -------------------------------------------------------------------------------- /spark/templates/spark-worker-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | #namespace: monitoring 5 | name: spark-worker-config 6 | data: 7 | spark-defaults.conf: | 8 | spark.blockManager.port {{ .Values.spark_worker.config.ports.blockManager }} 9 | spark.broadcast.port {{ .Values.spark_worker.config.ports.broadcast }} 10 | spark.cleaner.ttl 900 11 | spark.cores.max 1 12 | spark.driver.extraClassPath {{ .Values.spark_worker.config.driver.extraClassPath }} 13 | spark.driver.extraJavaOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_driver.log -Xmx512m 14 | spark.driver.memory 512m 15 | spark.driver.port {{ .Values.spark_worker.config.ports.driver }} 16 | spark.eventLog.dir {{ .Values.spark_worker.config.eventLog_dir }} 17 | spark.executor.cores 1 18 | spark.executor.extraClassPath {{ .Values.spark_worker.config.executor.extraClassPath }} 19 | spark.executor.extraJavaOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_executor.log 20 | spark.executor.memory 512m 21 | spark.executor.port {{ .Values.spark_worker.config.ports.executor }} 22 | spark.fileserver.port {{ .Values.spark_worker.config.ports.fileserver }} 23 | spark.history.fs.logDirectory {{ .Values.spark_worker.config.history_fs_logDirectory }} 24 | spark.history.ui.port {{ .Values.spark_worker.config.ports.history_ui }} 25 | spark.python.worker.memory 16m 26 | spark.speculation {{ .Values.spark_worker.config.speculation }} 27 | spark.speculation.interval {{ .Values.spark_worker.config.speculation_interval }} 28 | spark.sql.shuffle.partitions 32 29 | spark.sql.ui.retainedExecutions 10 30 | spark.streaming.ui.retainedBatches 10 31 | spark.ui.retainedJobs 10 32 | spark.ui.retainedStages 10 33 | spark.worker.cleanup.enabled True 34 | spark.worker.ui.retainedDrivers 10 35 | spark.worker.ui.retainedExecutors 10 36 | 37 | 38 | spark-env.sh: | 39 | #!/usr/bin/env bash 40 | export SPARK_WORKER_PORT={{ .Values.spark_worker.config.ports.worker }} 41 | export SPARK_WORKER_WEBUI_PORT={{ .Values.spark_worker.config.ports.worker_web_ui }} 42 | export SPARK_WORKER_DIR={{ .Values.spark_worker.config.worker_dir }} 43 | export SPARK_WORKER_MEMORY={{ .Values.spark_worker.config.worker_memory }} 44 | export SPARK_WORKER_CORES={{ .Values.spark_worker.config.worker_cores }} 45 | export SPARK_LOG_DIR={{ .Values.spark_worker.config.log_dir }} 46 | export SPARK_DAEMON_JAVA_OPTS={{ .Values.spark_worker.config.daemon_java_opts }} 47 | start_spark_worker.sh: | 48 | #!/usr/bin/env bash 49 | . /etc/config/spark-env.sh 50 | export EXEC_CLASS=org.apache.spark.deploy.worker.Worker 51 | export INSTANCE_ID=1 52 | export SPARK_CLASSPATH=/opt/spark/current/conf/:/opt/spark/current/lib/spark-assembly-1.6.1-hadoop2.6.0.jar:/opt/spark/current/lib/datanucleus-core-3.2.10.jar:/opt/spark/current/lib/datanucleus-rdbms-3.2.9.jar:/opt/spark/current/lib/datanucleus-api-jdo-3.2.6.jar 53 | export log="$SPARK_LOG_DIR/spark-spark-"$EXEC_CLASS"-"$INSTANCE_ID"-${SPARK_LOCAL_IP}.out" 54 | export SPARK_HOME=/opt/spark/current 55 | 56 | /usr/bin/java -cp $SPARK_CLASSPATH $SPARK_DAEMON_JAVA_OPTS -Xms1g -Xmx1g "$EXEC_CLASS" --webui-port "$SPARK_WORKER_WEBUI_PORT" --port $SPARK_WORKER_PORT spark-master-svc:7077 2>&1 | tee $log 57 | 58 | -------------------------------------------------------------------------------- /spark/templates/spark-worker-rc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: spark-worker 5 | #namespace: monitoring 6 | labels: 7 | app: spark-worker 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | spec: 10 | replicas: {{ .Values.spark_worker.replicaCount }} 11 | selector: 12 | app: spark-worker 13 | template: 14 | metadata: 15 | labels: 16 | app: spark-worker 17 | spec: 18 | containers: 19 | - name: {{ .Values.spark_worker.containerName }} 20 | image: "{{ .Values.spark_worker.image.repository }}/{{ .Values.spark_worker.image.tag }}" 21 | command: 22 | - "/bin/bash" 23 | - "/etc/config/start_spark_worker.sh" 24 | env: 25 | - name: SPARK_LOCAL_IP 26 | valueFrom: 27 | fieldRef: 28 | fieldPath: status.podIP 29 | ports: 30 | - name: master 31 | containerPort: 7077 32 | - name: master-webui 33 | containerPort: 18080 34 | - name: block-manager 35 | containerPort: 7100 36 | - name: broadcast 37 | containerPort: 7105 38 | - name: driver 39 | containerPort: 7110 40 | - name: executor 41 | containerPort: 7115 42 | - name: fileserver 43 | containerPort: 7120 44 | volumeMounts: 45 | - name: config-volume 46 | mountPath: /etc/config 47 | volumes: 48 | - name: config-volume 49 | configMap: 50 | name: spark-worker-config 51 | 52 | -------------------------------------------------------------------------------- /spark/templates/spark-worker-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Values.spark_worker.service.name }} 5 | #namespace: monitoring 6 | labels: 7 | app: spark-worker 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | spec: 10 | ports: 11 | - name: master 12 | port: 7077 13 | targetPort: master 14 | - name: master-webui 15 | port: 18080 16 | targetPort: master-webui 17 | - name: block-manager 18 | port: 7100 19 | targetPort: block-manager 20 | - name: broadcast 21 | port: 7105 22 | targetPort: broadcast 23 | - name: driver 24 | port: 7110 25 | targetPort: driver 26 | - name: executor 27 | port: 7115 28 | targetPort: executor 29 | - name: fileserver 30 | port: 7120 31 | targetPort: fileserver 32 | selector: 33 | app: spark-worker 34 | 35 | -------------------------------------------------------------------------------- /spark/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for spark-chart. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | spark_master: 5 | replicaCount: 1 6 | containerName: spark-master 7 | pod_ip: status.podIP 8 | image: 9 | repository: ncsmm 10 | tag: spark:v1 11 | pullPolicy: IfNotPresent 12 | service: 13 | name: spark-master-svc 14 | type: ClusterIP 15 | config: 16 | driver: 17 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 18 | executor: 19 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 20 | ports: 21 | master: 7077 22 | master_web_ui: 18085 23 | worker: 7078 24 | worker_web_ui: 18086 25 | blockManager: 7100 26 | broadcast: 7105 27 | driver: 7110 28 | executor: 7115 29 | fileserver: 7120 30 | history_ui: 18082 31 | speculation: true 32 | speculation_interval: 200 33 | eventLog_dir: /var/log/spark/events 34 | history_fs_logDirectory: file://var/log/spark/events 35 | log_dir: /var/log/spark 36 | daemon_java_opts: "\"$SPARK_DAEMON_JAVA_OPTS -Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=zookeeper:2181 -Dspark.deploy.zookeeper.dir=/var/run/spark -Dorg.xerial.snappy.tempdir=/var/run/spark/\"" 37 | 38 | spark_worker: 39 | replicaCount: 4 40 | containerName: spark-worker 41 | pod_ip: status.podIP 42 | image: 43 | repository: ncsmm 44 | tag: spark:v1 45 | pullPolicy: IfNotPresent 46 | service: 47 | name: spark-worker-svc 48 | type: ClusterIP 49 | config: 50 | driver: 51 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 52 | extraJavaOptions: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_driver.log -Xmx512m 53 | memory: 512m 54 | executor: 55 | cores: 1 56 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 57 | ports: 58 | master: 7077 59 | master_web_ui: 18085 60 | worker: 7078 61 | worker_web_ui: 18086 62 | blockManager: 7100 63 | broadcast: 7105 64 | driver: 7110 65 | executor: 7115 66 | fileserver: 7120 67 | history_ui: 18082 68 | python: 69 | worker_memory: 16m 70 | speculation: true 71 | speculation_interval: 200 72 | sql: 73 | shuffle_partitions: 32 74 | eventLog_dir: /var/log/spark/events 75 | worker_dir: /var/run/spark/work 76 | worker_memory: 2g 77 | worker_cores: 2 78 | history_fs_logDirectory: file://var/log/spark/events 79 | log_dir: /var/log/spark 80 | daemon_java_opts: "\"$SPARK_DAEMON_JAVA_OPTS -Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=zookeeper:2181 -Dspark.deploy.zookeeper.dir=/var/run/spark -Dorg.xerial.snappy.tempdir=/var/run/spark/\"" 81 | -------------------------------------------------------------------------------- /storm/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /storm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Apache Storm configured for Monasca 3 | name: storm 4 | version: 0.5.3 5 | -------------------------------------------------------------------------------- /storm/README.md: -------------------------------------------------------------------------------- 1 | `monasca/storm` Chart 2 | ===================== 3 | 4 | This chart deploys the [`monasca/storm`][1] container to a Kubernetes cluster. 5 | 6 | Configuration 7 | ------------- 8 | 9 | Parameter | Description | Default 10 | --------- | ----------- | ------- 11 | `storm.name` | Storm container name | `storm` 12 | `storm.image.repository` | Storm container image repository | `monasca/storm` 13 | `storm.image.tag` | Storm container image tag | `1.0.3` 14 | `storm.image.pullPolicy` | Storm container image pull policy | `Always` 15 | `storm.persistence.storageClass` | Zookeeper storage class | `default` 16 | `storm.persistence.enabled` | Zookeeper persistent storage enabled flag | `false` 17 | `storm.persistence.accessMode` | Zookeeper persistent storage accessMode | `ReadWriteOnce` 18 | `storm.persistence.size` | Zookeeper persistent storage size | `10Gi` 19 | `storm.service.port` | Storm nimbus service port | `6627` 20 | `storm.service.type` | Storm nimbus service type | `ClusterIP` 21 | `storm.supervisor_ports` | Storm Supervisor ports (number of workers) | `6701,6702` 22 | `storm.nimbus_resources.requests.memory` | Memory request per Storm container | `512Mi` 23 | `storm.nimbus_resources.requests.cpu` | CPU request per Storm container | `100m` 24 | `storm.nimbus_resources.limits.memory` | Memory limit per Storm container | `2Gi` 25 | `storm.nimbus_resources.limits.cpu` | Memory limit per Storm container | `500m` 26 | `storm.supervisor_resources.requests.memory` | Memory request per Storm container | `2Gi` 27 | `storm.supervisor_resources.requests.cpu` | CPU request per Storm container | `500m` 28 | `storm.supervisor_resources.limits.memory` | Memory limit per Storm container | `4Gi` 29 | `storm.supervisor_resources.limits.cpu` | Memory limit per Storm container | `2000m` 30 | 31 | Additional options are available when deployed alongside [`monasca-thresh`][2]: 32 | 33 | Parameter | Description | Default 34 | --------- | ----------- | ------- 35 | `kafka.service.port` | Kafka port | `9092` 36 | `kafka.zookeeper.service.port` | ZooKeeper port to use | `2181` 37 | `thresh.spout.metricSpoutThreads` | Number of metric spout threads | `2` 38 | `thresh.spout.metricSpoutTasks` | Number of metric spout tasks | `2` 39 | 40 | [1]: https://github.com/hpcloud-mon/monasca-docker/tree/master/storm 41 | [2]: https://github.com/hpcloud-mon/monasca-helm/tree/master/monasca#threshold-engine 42 | -------------------------------------------------------------------------------- /storm/templates/NOTES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monasca/monasca-helm/65529892127e600eefd8e360a6b850c3c79583b8/storm/templates/NOTES.txt -------------------------------------------------------------------------------- /storm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | Create a fully qualified storm-nimbus name. 20 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 21 | */}} 22 | {{- define "storm.fullname" -}} 23 | {{- printf "%s-%s" .Release.Name "storm" | trunc 63 -}} 24 | {{- end -}} 25 | -------------------------------------------------------------------------------- /storm/templates/nimbus-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "storm.fullname" . }}-nimbus 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.name }}-nimbus" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: 1 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.name }}-nimbus" 19 | spec: 20 | containers: 21 | - name: {{ template "name" . }}-{{ .Values.name }}-nimbus 22 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 23 | imagePullPolicy: {{ .Values.image.pullPolicy }} 24 | args: ["storm", "nimbus"] 25 | resources: 26 | {{ toYaml .Values.nimbus_resources | indent 12 }} 27 | ports: 28 | - containerPort: {{ .Values.service.port }} 29 | name: nimbus 30 | env: 31 | - name: STORM_LOCAL_HOSTNAME 32 | value: "{{ .Release.Name }}-storm-nimbus" 33 | - name: ZOOKEEPER_SERVERS 34 | value: "{{ .Release.Name }}-zookeeper" 35 | - name: STORM_ZOOKEEPER_PORT 36 | value: "2181" 37 | - name: NIMBUS_SEEDS 38 | value: "{{ template "storm.fullname" . }}-nimbus" 39 | volumeMounts: 40 | - name: data 41 | mountPath: /data 42 | volumes: 43 | - name: data 44 | {{- if .Values.persistence.enabled }} 45 | persistentVolumeClaim: 46 | claimName: {{ template "storm.fullname" . }}-nimbus 47 | {{- else }} 48 | emptyDir: {} 49 | {{- end -}} 50 | {{- end}} 51 | -------------------------------------------------------------------------------- /storm/templates/nimbus-pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.enabled }} 2 | {{- if .Values.persistence.enabled }} 3 | apiVersion: v1 4 | kind: PersistentVolumeClaim 5 | metadata: 6 | name: {{ template "storm.fullname" . }}-nimbus 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | component: "{{ .Values.name }}-nimbus" 11 | release: "{{ .Release.Name }}" 12 | heritage: "{{ .Release.Service }}" 13 | spec: 14 | accessModes: 15 | - {{ .Values.persistence.accessMode | quote }} 16 | storageClassName: {{ .Values.persistence.storageClass | quote }} 17 | resources: 18 | requests: 19 | storage: {{ .Values.persistence.size | quote }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /storm/templates/nimbus-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ template "storm.fullname" . }}-nimbus 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.name }}-nimbus" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | type: {{ .Values.service.type }} 14 | ports: 15 | - name: nimbus 16 | port: {{ .Values.service.port }} 17 | selector: 18 | app: {{ template "fullname" . }} 19 | component: "{{ .Values.name }}-nimbus" 20 | {{- end}} 21 | -------------------------------------------------------------------------------- /storm/templates/supervisor-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.enabled }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "storm.fullname" . }}-supervisor 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | component: "{{ .Values.name }}-supervisor" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | spec: 13 | replicas: 1 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ template "fullname" . }} 18 | component: "{{ .Values.name }}-supervisor" 19 | spec: 20 | containers: 21 | - name: {{ template "name" . }}-{{ .Values.name }} 22 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 23 | imagePullPolicy: {{ .Values.image.pullPolicy }} 24 | args: ["storm", "supervisor"] 25 | resources: 26 | {{ toYaml .Values.supervisor_resources | indent 12 }} 27 | env: 28 | - name: STORM_HOSTNAME_FROM_IP 29 | value: "true" 30 | - name: ZOOKEEPER_SERVERS 31 | value: "{{ .Release.Name }}-zookeeper" 32 | - name: STORM_ZOOKEEPER_PORT 33 | value: "2181" 34 | - name: NIMBUS_SEEDS 35 | value: "{{ template "storm.fullname" . }}-nimbus" 36 | - name: SUPERVISOR_SLOTS_PORTS 37 | value: {{ .Values.supervisor_ports | join "," | quote }} 38 | - name: METRIC_SPOUT_THREADS 39 | value: "{{ .Values.thresh.spout.metricSpoutThreads }}" 40 | - name: METRIC_SPOUT_TASKS 41 | value: "{{ .Values.thresh.spout.metricSpoutTasks }}" 42 | - name: KAFKA_URI 43 | value: "{{ .Release.Name }}-kafka:9092" 44 | - name: MYSQL_DB_HOST 45 | value: "{{ .Release.Name }}-mysql" 46 | - name: MYSQL_DB_PORT 47 | value: "3306" 48 | - name: MYSQL_DB_DATABASE 49 | value: "mon" 50 | - name: MYSQL_DB_USERNAME 51 | valueFrom: 52 | secretKeyRef: 53 | name: "{{ .Release.Name }}-{{ .Values.thresh.secretSuffix }}" 54 | key: username 55 | - name: MYSQL_DB_PASSWORD 56 | valueFrom: 57 | secretKeyRef: 58 | name: "{{ .Release.Name }}-{{ .Values.thresh.secretSuffix }}" 59 | key: password 60 | {{- end}} 61 | -------------------------------------------------------------------------------- /storm/values.yaml: -------------------------------------------------------------------------------- 1 | name: storm 2 | enabled: true 3 | image: 4 | repository: monasca/storm 5 | tag: 1.1.1-1.0.11 6 | pullPolicy: Always 7 | persistence: 8 | storageClass: default 9 | enabled: false 10 | accessMode: ReadWriteOnce 11 | size: 4Gi 12 | service: 13 | type: ClusterIP 14 | port: 6627 15 | supervisor_ports: [ 6701, 6702 ] 16 | nimbus_resources: 17 | requests: 18 | memory: 512Mi 19 | cpu: 100m 20 | limits: 21 | memory: 2Gi 22 | cpu: 500m 23 | supervisor_resources: 24 | requests: 25 | memory: 2Gi 26 | cpu: 250m 27 | limits: 28 | memory: 4Gi 29 | cpu: 2000m 30 | 31 | thresh: 32 | secretSuffix: mysql-thresh-secret 33 | spout: 34 | metricSpoutThreads: 2 35 | metricSpoutTasks: 2 36 | -------------------------------------------------------------------------------- /transform/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /transform/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Transform provides aggregation for monasca metrics 3 | name: transform 4 | version: 0.2.0 5 | sources: 6 | - https://github.com/openstack/monasca-transform 7 | maintainers: 8 | - name: David C Kennedy 9 | email: david.c.kennedy@hpe.com 10 | -------------------------------------------------------------------------------- /transform/requirements.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - condition: "" 3 | enabled: false 4 | import-values: null 5 | name: spark 6 | repository: http://monasca.io/monasca-helm/ 7 | tags: null 8 | version: 0.2.0 9 | digest: sha256:c9b41d3ce2c858385409b9ddbe6b18dd948f084bc9056ff2e72ccd7c2e75cfc5 10 | generated: 2017-05-22T12:07:41.400858432-06:00 11 | -------------------------------------------------------------------------------- /transform/requirements.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: spark 3 | version: 0.2.0 4 | repository: http://monasca.io/monasca-helm/ 5 | -------------------------------------------------------------------------------- /transform/specs/README.md: -------------------------------------------------------------------------------- 1 | # Monasca-transform specs 2 | 3 | Monasca transform aggregates metrics based on the pre-transform and transform specs stored in the database. 4 | 5 | NCS requirements of aggregation differ from those of the upstream openstack repo so generating and maintaining our own database population scripts is essential. 6 | 7 | ####Generating sql 8 | 9 | Our maintained json specs files are here. To generate sql for the database the scripts/generate_ddl.sh script in the monascat-transform repo may be used and the generated sql file copied here alongside the source json files. -------------------------------------------------------------------------------- /transform/sql/monasca-transform_mysql.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `monasca_transform` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 2 | USE `monasca_transform`; 3 | 4 | SET foreign_key_checks = 0; 5 | 6 | CREATE TABLE IF NOT EXISTS `kafka_offsets` ( 7 | `id` INTEGER AUTO_INCREMENT NOT NULL, 8 | `topic` varchar(128) NOT NULL, 9 | `until_offset` BIGINT NULL, 10 | `from_offset` BIGINT NULL, 11 | `app_name` varchar(128) NOT NULL, 12 | `partition` integer NOT NULL, 13 | `batch_time` varchar(20) NOT NULL, 14 | `last_updated` varchar(20) NOT NULL, 15 | `revision` integer NOT NULL, 16 | PRIMARY KEY (`id`, `app_name`, `topic`, `partition`, `revision`) 17 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 18 | 19 | 20 | CREATE TABLE IF NOT EXISTS `transform_specs` ( 21 | `metric_id` varchar(128) NOT NULL, 22 | `transform_spec` varchar(2048) NOT NULL, 23 | PRIMARY KEY (`metric_id`) 24 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 25 | 26 | CREATE TABLE IF NOT EXISTS `pre_transform_specs` ( 27 | `event_type` varchar(128) NOT NULL, 28 | `pre_transform_spec` varchar(2048) NOT NULL, 29 | PRIMARY KEY (`event_type`) 30 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 31 | 32 | GRANT ALL ON monasca_transform.* TO 'm-transform'@'%' IDENTIFIED BY 'password'; 33 | 34 | GRANT ALL ON monasca_transform.* TO 'm-transform'@'localhost' IDENTIFIED BY 'password'; 35 | -------------------------------------------------------------------------------- /transform/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /transform/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /transform/templates/monasca-transform-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: monasca-transform-config 5 | data: 6 | monasca-transform.conf: | 7 | [DEFAULTS] 8 | 9 | [repositories] 10 | offsets = monasca_transform.mysql_offset_specs:MySQLOffsetSpecs 11 | data_driven_specs = monasca_transform.data_driven_specs.mysql_data_driven_specs_repo:MySQLDataDrivenSpecsRepo 12 | offsets_max_revisions = 10 13 | 14 | [database] 15 | server_type = mysql:thin 16 | host = {{ .Values.config.db.host }} 17 | database_name = monasca_transform 18 | username = {{ .Values.config.db.user }} 19 | password = {{ .Values.config.db.password }} 20 | 21 | [messaging] 22 | adapter = monasca_transform.messaging.adapter:KafkaMessageAdapter 23 | topic = {{ .Values.config.messaging.metrics_topic }} 24 | brokers={{ .Values.config.messaging.broker }} 25 | publish_kafka_project_id=d2cb21079930415a9f2a33588b9f2bb6 26 | adapter_pre_hourly = monasca_transform.messaging.adapter:KafkaMessageAdapterPreHourly 27 | topic_pre_hourly = {{ .Values.config.messaging.metrics_pre_hourly_topic }} 28 | 29 | [stage_processors] 30 | pre_hourly_processor_enabled = True 31 | 32 | [pre_hourly_processor] 33 | late_metric_slack_time = {{ .Values.config.late_metric_slack_time }} 34 | enable_instance_usage_df_cache = True 35 | instance_usage_df_cache_storage_level = MEMORY_ONLY_SER_2 36 | enable_batch_time_filtering = True 37 | data_provider=monasca_transform.processor.pre_hourly_processor:PreHourlyProcessorDataProvider 38 | 39 | # 40 | # Configurable values for the monasca-transform service 41 | # 42 | [service] 43 | 44 | # The address of the mechanism being used for election coordination 45 | coordinator_address = kazoo://{{ .Values.config.election.host }}:{{ .Values.config.election.port }} 46 | 47 | # The name of the coordination/election group 48 | coordinator_group = monasca-transform 49 | 50 | # How long the candidate should sleep between election result 51 | # queries (in seconds) 52 | election_polling_frequency = 15 53 | 54 | # Whether debug-level log entries should be included in the application 55 | # log. If this setting is false, info-level will be used for logging. 56 | enable_debug_log_entries = true 57 | 58 | # The path for the monasca-transform Spark driver 59 | spark_driver = /opt/monasca/transform/lib/driver.py 60 | 61 | # the location for the transform-service log 62 | service_log_path=/var/log/monasca/transform/ 63 | 64 | # the filename for the transform-service log 65 | service_log_filename=monasca-transform.log 66 | 67 | # Whether Spark event logging should be enabled (true/false) 68 | spark_event_logging_enabled = true 69 | 70 | # A list of jars which Spark should use 71 | spark_jars_list = /opt/spark/current/lib/spark-streaming-kafka_2.10-1.6.1.jar,/opt/spark/current/lib/scala-library-2.10.1.jar,/opt/spark/current/lib/kafka_2.10-0.8.1.1.jar,/opt/spark/current/lib/metrics-core-2.2.0.jar,/opt/spark/current/lib/drizzle-jdbc-1.3.jar 72 | 73 | # A list of where the Spark master(s) should run 74 | spark_master_list = spark://{{ .Values.spark_config.spark_master_ip }}:{{ .Values.spark_config.ports.master }} 75 | 76 | # spark_home for the environment 77 | spark_home = /opt/spark/current 78 | 79 | # Python files for Spark to use 80 | spark_python_files = /opt/monasca/transform/lib/monasca-transform.zip 81 | 82 | # How often the stream should be read (in seconds) 83 | stream_interval = {{ .Values.config.stream_interval }} 84 | 85 | # The working directory for monasca-transform 86 | work_dir = /var/run/monasca/transform 87 | 88 | # enable caching of record store df 89 | enable_record_store_df_cache = True 90 | 91 | # set spark storage level for record store df cache 92 | record_store_df_cache_storage_level = MEMORY_ONLY_SER_2 93 | service_runner.py: | 94 | # Copyright 2016 Hewlett Packard Enterprise Development Company LP 95 | # 96 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 97 | # not use this file except in compliance with the License. You may obtain 98 | # a copy of the License at 99 | # 100 | # http://www.apache.org/licenses/LICENSE-2.0 101 | # 102 | # Unless required by applicable law or agreed to in writing, software 103 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 104 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 105 | # License for the specific language governing permissions and limitations 106 | # under the License. 107 | 108 | import sys 109 | 110 | from monasca_transform.service.transform_service import main_service 111 | 112 | 113 | def main(): 114 | main_service() 115 | 116 | 117 | if __name__ == "__main__": 118 | main() 119 | sys.exit(0) 120 | 121 | driver.py: | 122 | # Copyright 2016 Hewlett Packard Enterprise Development Company LP 123 | # 124 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 125 | # not use this file except in compliance with the License. You may obtain 126 | # a copy of the License at 127 | # 128 | # http://www.apache.org/licenses/LICENSE-2.0 129 | # 130 | # Unless required by applicable law or agreed to in writing, software 131 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 132 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 133 | # License for the specific language governing permissions and limitations 134 | # under the License. 135 | from monasca_transform.driver.mon_metrics_kafka import invoke 136 | 137 | invoke() 138 | -------------------------------------------------------------------------------- /transform/templates/monasca-transform-spark-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: monasca-transform-spark-config 5 | data: 6 | spark-defaults.conf: | 7 | spark.blockManager.port {{ .Values.spark_config.ports.blockManager }} 8 | spark.broadcast.port {{ .Values.spark_config.ports.broadcast }} 9 | spark.cleaner.ttl 900 10 | spark.cores.max 1 11 | spark.driver.extraClassPath {{ .Values.spark_config.driver.extraClassPath }} 12 | spark.driver.extraJavaOptions {{ .Values.spark_config.driver.extraJavaOptions }} 13 | spark.driver.memory {{ .Values.spark_config.driver.memory }} 14 | spark.driver.port {{ .Values.spark_config.ports.driver }} 15 | spark.eventLog.dir {{ .Values.spark_config.eventLog_dir }} 16 | spark.executor.cores {{ .Values.spark_config.executor.cores }} 17 | spark.executor.extraClassPath {{ .Values.spark_config.executor.extraClassPath }} 18 | spark.executor.extraJavaOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_executor.log 19 | spark.executor.memory 512m 20 | spark.executor.port {{ .Values.spark_config.ports.executor }} 21 | spark.fileserver.port {{ .Values.spark_config.ports.fileserver }} 22 | spark.python.worker.memory {{ .Values.spark_config.python.worker_memory }} 23 | spark.speculation {{ .Values.spark_config.speculation }} 24 | spark.speculation.interval {{ .Values.spark_config.speculation_interval }} 25 | spark.sql.shuffle.partitions {{ .Values.spark_config.sql.shuffle_partitions }} 26 | spark.sql.ui.retainedExecutions 10 27 | spark.streaming.ui.retainedBatches 10 28 | spark.ui.retainedJobs 10 29 | spark.ui.retainedStages 10 30 | spark.worker.cleanup.enabled True 31 | spark.worker.ui.retainedDrivers 10 32 | spark.worker.ui.retainedExecutors 10 33 | 34 | 35 | spark-env.sh: | 36 | #!/usr/bin/env bash 37 | export SPARK_MASTER_IP={{ .Values.spark_config.spark_master_ip }} 38 | export SPARK_MASTER_PORT={{ .Values.spark_config.ports.master }} 39 | export SPARK_MASTERS=${SPARK_MASTER_IP}:${SPARK_MASTER_PORT} 40 | export SPARK_LOG_DIR={{ .Values.spark_config.log_dir }} 41 | export SPARK_DAEMON_JAVA_OPTS="$SPARK_DAEMON_JAVA_OPTS -Xmx512m" 42 | 43 | 44 | -------------------------------------------------------------------------------- /transform/templates/monasca-transform.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: monasca-transform 5 | labels: 6 | app: monasca-transform 7 | spec: 8 | replicas: {{ .Values.replication_count }} 9 | selector: 10 | app: monasca-transform 11 | template: 12 | metadata: 13 | labels: 14 | app: monasca-transform 15 | spec: 16 | containers: 17 | - name: {{ .Values.container_name }} 18 | image: {{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }} 19 | resources: 20 | limits: 21 | memory: 2000Mi 22 | volumeMounts: 23 | - name: config-volume 24 | mountPath: /etc/config 25 | - name: spark-config 26 | mountPath: /opt/spark/current/conf 27 | volumes: 28 | - name: config-volume 29 | configMap: 30 | name: monasca-transform-config 31 | - name: spark-config 32 | configMap: 33 | name: monasca-transform-spark-config 34 | 35 | -------------------------------------------------------------------------------- /transform/templates/mysql-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: monasca-transform-mysql-config 5 | data: 6 | {{ (.Files.Glob "sql/*.sql").AsConfig | indent 2 }} 7 | 8 | {{ (.Files.Glob "specs/*.sql").AsConfig | indent 2 }} 9 | -------------------------------------------------------------------------------- /transform/templates/mysql-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: m-t-mysql 6 | labels: 7 | app: m-t-mysql 8 | spec: 9 | type: NodePort 10 | ports: 11 | - name: m-t-mysql 12 | port: 3306 13 | protocol: TCP 14 | targetPort: m-t-mysql 15 | selector: 16 | app: m-t-mysql 17 | 18 | -------------------------------------------------------------------------------- /transform/templates/mysql.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ReplicationController 4 | metadata: 5 | name: monasca-transform-sql-controller 6 | spec: 7 | replicas: 1 8 | selector: 9 | app: m-t-mysql 10 | template: 11 | metadata: 12 | labels: 13 | app: m-t-mysql 14 | spec: 15 | containers: 16 | - name: m-t-mysql 17 | image: mysql:5.5 18 | ports: 19 | - containerPort: 3306 20 | name: m-t-mysql 21 | env: 22 | - name: MYSQL_ROOT_PASSWORD 23 | value: "secretmysql" 24 | - name: MYSQL_DATABASE 25 | value: "m-transform" 26 | volumeMounts: 27 | - name: sql-volume 28 | mountPath: /docker-entrypoint-initdb.d 29 | volumes: 30 | - name: sql-volume 31 | configMap: 32 | name: monasca-transform-mysql-config 33 | -------------------------------------------------------------------------------- /transform/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for transform. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | replicaCount: 1 5 | container_name: transform 6 | namespace: monitoring 7 | replication_count: 1 8 | image: 9 | repository: ncsmm 10 | name: monasca-transform 11 | tag: v6 12 | pullPolicy: IfNotPresent 13 | service: 14 | name: nginx 15 | type: ClusterIP 16 | externalPort: 80 17 | internalPort: 80 18 | resources: 19 | limits: 20 | cpu: 100m 21 | memory: 128Mi 22 | requests: 23 | cpu: 100m 24 | memory: 128Mi 25 | config: 26 | db: 27 | host: m-t-mysql 28 | user: m-transform 29 | password: password 30 | messaging: 31 | metrics_topic: metrics 32 | metrics_pre_hourly_topic: metrics_pre_hourly 33 | broker: kafka:9092 34 | election: 35 | host: zookeeper 36 | port: 2181 37 | stream_interval: 600 38 | late_metric_slack_time: 600 39 | spark_config: 40 | driver: 41 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 42 | extraJavaOptions: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/gc_driver.log -Xmx512m 43 | memory: 512m 44 | executor: 45 | cores: 1 46 | extraClassPath: /opt/spark/current/lib/drizzle-jdbc-1.3.jar 47 | ports: 48 | master: 7077 49 | master_web_ui: 18085 50 | worker: 7078 51 | worker_web_ui: 18086 52 | blockManager: 7100 53 | broadcast: 7105 54 | driver: 7110 55 | executor: 7115 56 | fileserver: 7120 57 | history_ui: 18082 58 | python: 59 | worker_memory: 16m 60 | speculation: true 61 | speculation_interval: 200 62 | sql: 63 | shuffle_partitions: 32 64 | eventLog_dir: /var/log/spark/events 65 | history_fs_logDirectory: file://var/log/spark/events 66 | log_dir: /var/log/spark 67 | spark_master_ip: spark-master-svc 68 | -------------------------------------------------------------------------------- /zookeeper/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /zookeeper/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: A Helm chart for Zookeeper 3 | name: zookeeper 4 | version: 0.3.8 5 | -------------------------------------------------------------------------------- /zookeeper/README.md: -------------------------------------------------------------------------------- 1 | ### Zookeeper Configurations 2 | 3 | Parameter | Description | Default 4 | --------- | ----------- | ------- 5 | `image.repository` | Zookeeper container image repository | `zookeeper` 6 | `image.tag` | Zookeeper container image tag | `3.3` 7 | `image.pullPolicy` | Zookeeper container image pull policy | `IfNotPresent` 8 | `service.type` | Zookeeper service type | `ClusterIP` 9 | `persistence.storageClass` | Zookeeper storage class | `default` 10 | `persistence.enabled` | Zookeeper persistent storage enabled flag | `false` 11 | `persistence.accessMode` | Zookeeper persistent storage accessMode | `ReadWriteOnce` 12 | `persistence.size` | Zookeeper persistent storage size | `10Gi` 13 | `persistence.purge_interval` | Number of hours between disk purge | `1` 14 | `persistence.snap_retain_count` | Number of snapshots to retain in dataDir | `3` 15 | `resources.requests.memory` | Memory request per zookeeper pod | `256Mi` 16 | `resources.requests.cpu` | CPU request per zookeeper pod | `100m` 17 | `resources.limits.cpu` | Memory limit per zookeeper pod | `1000m` 18 | `resources.limits.memory` | Memory limit per zookeeper pod | `512Mi` 19 | `java.max_ram_fraction` | Fraction of Ram to deveote to Heap (1/n) | `2` 20 | `watcher.enabled` | Zookeeper watcher enabled flag | `false` 21 | `watcher.image.repository` | Zookeeper watcher container image repository | `monasca/zookeeper-watcher` 22 | `watcher.image.tag` | Zookeeper watcher container image tag | `latest` 23 | `watcher.image.pullPolicy` | Zookeeper watcher container image pull policy | `IfNotPresent` 24 | `watcher.health_check_path` | Zookeeper watcher health check path | `zookeeper-health-check` 25 | `watcher.watcher_period` | Zookeeper watcher period | `600` 26 | `watcher.watcher_timeout` | Zookeeper watcher read/write timeout | `60` 27 | `watcher.stay_alive_on_failure` | If `true`, watcher container stays alive for 2 hours after watcher exits | `false` 28 | `watcher.port` | Zookeeper watcher port to expose Promethues metrics on | `8080` 29 | -------------------------------------------------------------------------------- /zookeeper/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /zookeeper/templates/zookeeper-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | data: 11 | zoo.cfg: | 12 | clientPort=2181 13 | dataDir=/data 14 | dataLogDir=/data 15 | tickTime=2000 16 | initLimit=5 17 | syncLimit=2 18 | maxClientCnxns=1000 19 | autopurge.snapRetainCount={{ .Values.persistence.snap_retain_count }} 20 | autopurge.purgeInterval={{ .Values.persistence.purge_interval }} 21 | log4j.properties: | 22 | # Root logger option 23 | log4j.rootLogger=INFO, stdout 24 | 25 | # Direct log messages to stdout 26 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 27 | log4j.appender.stdout.Target=System.out 28 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 29 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 30 | -------------------------------------------------------------------------------- /zookeeper/templates/zookeeper-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "fullname" . }} 16 | {{- if .Values.watcher.enabled }} 17 | annotations: 18 | prometheus.io/scrape: "true" 19 | prometheus.io/port: "{{ .Values.watcher.port }}" 20 | monasca.io/usek8slabels: "false" 21 | monasca.io/whitelist: | 22 | - zookeeper_average_round_trip_time 23 | - zookeeper_dropped_message_count 24 | - zookeeper_max_round_trip_time 25 | - zookeeper_min_round_trip_time 26 | - zookeeper_read_failure_count 27 | - zookeeper_running_average_round_trip_time 28 | - zookeeper_watcher_status 29 | - zookeeper_write_failure_count 30 | - go_memstats_heap_objects 31 | - go_memstats_heap_inuse_bytes 32 | {{- end }} 33 | spec: 34 | containers: 35 | - name: {{ .Chart.Name }} 36 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 37 | imagePullPolicy: {{ .Values.image.pullPolicy }} 38 | resources: 39 | {{ toYaml .Values.resources | indent 12 }} 40 | env: 41 | - name: SERVER_JVMFLAGS 42 | value: "-XX:MaxRAMFraction={{ .Values.java.max_ram_fraction }} -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XshowSettings:vm" 43 | ports: 44 | - name: client 45 | containerPort: 2181 46 | - name: peer 47 | containerPort: 2888 48 | - name: leader-election 49 | containerPort: 3888 50 | volumeMounts: 51 | - name: data-volume 52 | mountPath: /data 53 | - name: config-volume 54 | mountPath: /conf 55 | {{- if .Values.watcher.enabled }} 56 | - name: watcher 57 | image: "{{ .Values.watcher.image.repository }}:{{ .Values.watcher.image.tag }}" 58 | imagePullPolicy: {{ .Values.watcher.image.pullPolicy }} 59 | resources: 60 | {{ toYaml .Values.watcher.resources | indent 12 }} 61 | env: 62 | - name: HEALTH_CHECK_PATH 63 | value: {{ .Values.watcher.health_check_path | quote }} 64 | - name: ZOOKEEPER_SERVERS 65 | value: "localhost" 66 | - name: PROMETHEUS_ENDPOINT 67 | value: "0.0.0.0:{{ .Values.watcher.port }}" 68 | - name: WATCHER_PERIOD 69 | value: {{ .Values.watcher.watcher_period | quote }} 70 | - name: WATCHER_TIMEOUT 71 | value: {{ .Values.watcher.watcher_timeout | quote }} 72 | - name: STAY_ALIVE_ON_FAILURE 73 | value: {{ .Values.watcher.stay_alive_on_failure | quote }} 74 | ports: 75 | - name: metrics 76 | containerPort: {{ .Values.watcher.port }} 77 | {{- end }} 78 | volumes: 79 | - name: config-volume 80 | configMap: 81 | name: {{ template "fullname" . }} 82 | - name: data-volume 83 | {{- if .Values.persistence.enabled }} 84 | persistentVolumeClaim: 85 | claimName: {{ template "fullname" . }} 86 | {{- else }} 87 | emptyDir: {} 88 | {{- end -}} 89 | -------------------------------------------------------------------------------- /zookeeper/templates/zookeeper-pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | spec: 12 | accessModes: 13 | - {{ .Values.persistence.accessMode | quote }} 14 | storageClassName: {{ .Values.persistence.storageClass | quote }} 15 | resources: 16 | requests: 17 | storage: {{ .Values.persistence.size | quote }} 18 | {{- end }} 19 | -------------------------------------------------------------------------------- /zookeeper/templates/zookeeper-static-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.static_service.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | heritage: "{{ .Release.Service }}" 9 | release: "{{ .Release.Name }}" 10 | name: {{ .Values.static_service.name }} 11 | spec: 12 | type: {{ .Values.static_service.type }} 13 | ports: 14 | - name: client 15 | port: 2181 16 | - name: peer 17 | port: 2888 18 | - name: leader-election 19 | port: 3888 20 | selector: 21 | app: {{ template "fullname" . }} 22 | {{- end }} 23 | -------------------------------------------------------------------------------- /zookeeper/templates/zookeeper-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | ports: 12 | - name: client 13 | port: 2181 14 | - name: peer 15 | port: 2888 16 | - name: leader-election 17 | port: 3888 18 | type: {{ .Values.service.type }} 19 | selector: 20 | app: {{ template "fullname" . }} 21 | -------------------------------------------------------------------------------- /zookeeper/values.yaml: -------------------------------------------------------------------------------- 1 | name: zookeeper 2 | image: 3 | repository: zookeeper 4 | tag: 3.4.10 5 | pullPolicy: IfNotPresent 6 | service: 7 | type: ClusterIP 8 | persistence: 9 | storageClass: default 10 | enabled: false 11 | accessMode: ReadWriteOnce 12 | size: 10Gi 13 | purge_interval: 1 14 | snap_retain_count: 3 15 | resources: 16 | requests: 17 | memory: 256Mi 18 | cpu: 100m 19 | limits: 20 | cpu: 1000m 21 | memory: 512Mi 22 | java: 23 | max_ram_fraction: 2 24 | watcher: 25 | enabled: false 26 | image: 27 | repository: monasca/zookeeper-watcher 28 | tag: 0.0.2 29 | pullPolicy: IfNotPresent 30 | resources: 31 | requests: 32 | memory: 32Mi 33 | cpu: 25m 34 | limits: 35 | memory: 64Mi 36 | cpu: 50m 37 | port: 8080 38 | health_check_path: zookeeper-health-check 39 | watcher_period: 600 40 | watcher_timeout: 60 41 | stay_alive_on_failure: false 42 | static_service: 43 | enabled: false 44 | type: ClusterIP 45 | name: zookeeper 46 | --------------------------------------------------------------------------------