diff --git a/README.md b/README.md index f9740d78f..3270d29f9 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ $ helm search bitnami - [Parse](https://github.com/helm/charts/tree/master/stable/parse) - [Phabricator](https://github.com/helm/charts/tree/master/stable/phabricator) - [phpBB](https://github.com/helm/charts/tree/master/stable/phpbb) +- [PostgreSQL](https://github.com/helm/charts/tree/master/stable/postgresql) - [PrestaShop](https://github.com/helm/charts/tree/master/stable/prestashop) - [RabbitMQ](https://github.com/helm/charts/tree/master/stable/rabbitmq) - [Redis](https://github.com/helm/charts/tree/master/stable/redis) - [Redmine](https://github.com/helm/charts/tree/master/stable/redmine) -- [SugarCRM](https://github.com/helm/charts/tree/master/stable/sugarcrm) - [SuiteCRM](https://github.com/helm/charts/tree/master/stable/suitecrm) - [TestLink](https://github.com/helm/charts/tree/master/stable/testlink) - [WordPress](https://github.com/helm/charts/tree/master/stable/wordpress) @@ -41,7 +41,7 @@ $ helm search bitnami ## Bitnami charts - [Apache](https://github.com/bitnami/charts/tree/master/bitnami/apache) -- [Consul](https://github.com/bitnami/charts/tree/master/bitnami/consul) +- [HashiCorp Consul](https://github.com/bitnami/charts/tree/master/bitnami/consul) - [Elasticsearch](https://github.com/bitnami/charts/tree/master/bitnami/elasticsearch) - [etcd](https://github.com/bitnami/charts/tree/master/bitnami/etcd) - [Jenkins](https://github.com/bitnami/charts/tree/master/bitnami/jenkins) @@ -51,7 +51,6 @@ $ helm search bitnami - [MySQL](https://github.com/bitnami/charts/tree/master/bitnami/mysql) - [nginx](https://github.com/bitnami/charts/tree/master/bitnami/nginx) - [NodeJS](https://github.com/bitnami/charts/tree/master/bitnami/node) -- [PostgreSQL](https://github.com/bitnami/charts/tree/master/bitnami/postgresql) - [TensorFlow Inception](https://github.com/bitnami/charts/tree/master/bitnami/tensorflow-inception) - [Tomcat](https://github.com/bitnami/charts/tree/master/bitnami/tomcat) - [WildFly](https://github.com/bitnami/charts/tree/master/bitnami/wildfly) diff --git a/bitnami/apache/Chart.yaml b/bitnami/apache/Chart.yaml index 6c97d0279..a254df2ad 100644 --- a/bitnami/apache/Chart.yaml +++ b/bitnami/apache/Chart.yaml @@ -1,6 +1,6 @@ name: apache -version: 2.0.2 -appVersion: 2.4.35 +version: 3.0.0 +appVersion: 2.4.37 description: Chart for Apache HTTP Server keywords: - apache diff --git a/bitnami/apache/README.md b/bitnami/apache/README.md index aba86f002..a1c08cfa1 100644 --- a/bitnami/apache/README.md +++ b/bitnami/apache/README.md @@ -46,11 +46,20 @@ The following tables lists the configurable parameters of the Apache chart and t | Parameter | Description | Default | | --------------------------------- | ------------------------------------- | --------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Apache image registry | `docker.io` | | `image.repository` | Apache Image name | `bitnami/apache` | | `image.tag` | Apache Image tag | `{VERSION}` | | `image.pullPolicy` | Apache image pull policy | `Always` | | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/apache/templates/_helpers.tpl b/bitnami/apache/templates/_helpers.tpl index 234480de7..567171186 100644 --- a/bitnami/apache/templates/_helpers.tpl +++ b/bitnami/apache/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} {{- end -}} + +{{/* +Return the proper Apache image name +*/}} +{{- define "apache.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/apache/templates/deployment.yaml b/bitnami/apache/templates/deployment.yaml index 029999f9b..7a0d10b42 100644 --- a/bitnami/apache/templates/deployment.yaml +++ b/bitnami/apache/templates/deployment.yaml @@ -29,7 +29,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "apache.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} ports: - name: http diff --git a/bitnami/apache/templates/svc.yaml b/bitnami/apache/templates/svc.yaml index a52501f96..2c712f3f2 100644 --- a/bitnami/apache/templates/svc.yaml +++ b/bitnami/apache/templates/svc.yaml @@ -8,13 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: LoadBalancer + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/apache/values.yaml b/bitnami/apache/values.yaml index 8c5030de1..26db8be64 100644 --- a/bitnami/apache/values.yaml +++ b/bitnami/apache/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Apache image version ## ref: https://hub.docker.com/r/bitnami/apache/tags/ ## image: registry: docker.io repository: bitnami/apache - tag: 2.4.35-debian-9 + tag: 2.4.37 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## @@ -14,4 +20,23 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName \ No newline at end of file + # - myRegistrKeySecretName + +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + ## loadBalancerIP: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster diff --git a/bitnami/cassandra/.helmignore b/bitnami/cassandra/.helmignore new file mode 100644 index 000000000..5e03def0c --- /dev/null +++ b/bitnami/cassandra/.helmignore @@ -0,0 +1,17 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +OWNERS diff --git a/bitnami/cassandra/Chart.yaml b/bitnami/cassandra/Chart.yaml new file mode 100644 index 000000000..dbc19bc05 --- /dev/null +++ b/bitnami/cassandra/Chart.yaml @@ -0,0 +1,12 @@ +name: cassandra +version: 1.0.0 +appVersion: 3.11.3 +description: Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients. +icon: https://d33np9n32j53g7.cloudfront.net/assets/stacks/cassandra/img/cassandra-stack-220x234-071ca9e210d165c3972d41ff9f96bd60.png +sources: +- https://github.com/bitnami/bitnami-docker-cassandra +home: http://cassandra.apache.org +maintainers: +- name: Bitnami + email: containers@bitnami.com +engine: gotpl diff --git a/bitnami/cassandra/README.md b/bitnami/cassandra/README.md new file mode 100644 index 000000000..d760f1f6e --- /dev/null +++ b/bitnami/cassandra/README.md @@ -0,0 +1,139 @@ +# cassandra + +[cassandra](https://cassandra.apache.org) Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers or datacenters. + +## TL;DR; + +```console +$ helm repo add bitnami https://charts.bitnami.com/bitnami +$ helm install bitnami/cassandra +``` + +## Introduction + +This chart bootstraps a [Cassandra](https://github.com/bitnami/bitnami-docker-cassandra) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. + +## Prerequisites + +- Kubernetes 1.8+ +- PV provisioner support in the underlying infrastructure + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release bitnami/cassandra +``` + +The command deploys one node with Cassandra on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` release: + +```console +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following tables lists the configurable parameters of the cassandra chart and their default values. + +| Parameter | Description | Default | +|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------| +| `global.imageRegistry` | Global Docker Image registry | `nil` | +| `image.registry` | Cassandra Image registry | `docker.io` | +| `image.repository` | Cassandra Image name | `bitnami/cassandra` | +| `image.tag` | Cassandra Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.pullSecrets` | Specify `docker-registry` secret names as an array | `nil` | +| `service.type` | Kubernetes Service type | `ClusterIP` | +| `service.nodePort` | Kubernetes Service nodePort | `nil` | +| `service.loadBalancerIP` | LoadBalancerIP if service type is `LoadBalancer` | `nil` | +| `service.annotations` | Annotations for the service | {} | +| `persistence.enabled` | Use PVCs to persist data | `true` | +| `persistence.storageClass` | Persistent Volume Storage Class | `generic` | +| `persistence.annotations` | Persistent Volume Claim annotations Annotations | {} | +| `persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | +| `persistence.size` | Persistent Volume Size | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `cluster.name` | Cassandra cluster name | `cassandra` | +| `cluster.replicaCount` | Number of Cassandra nodes | `1` | +| `cluster.seedCount` | Number of seed nodes (note: must be greater or equal than 1 and less or equal to `cluster.replicaCount`) | `1` | +| `cluster.numTokens` | Number of tokens for each node | `256` | +| `cluster.datacenter` | Datacenter name | `dc1` | +| `cluster.rack` | Rack name | `rack1` | +| `cluster.enableRPC` | Enable Thrift RPC endpoint | `true` | +| `cluster.jvm.extraOpts` | Set the value for Java Virtual Machine extra optinos (JVM_EXTRA_OPTS) | `nil` | +| `cluster.jvm.maxHeapSize` | Set Java Virtual Machine maximum heap size (MAX_HEAP_SIZE). Calculated automatically if `nil` | `nil` | +| `cluster.jvm.newHeapSize` | Set Java Virtual Machine new heap size (HEAP_NEWSIZE). Calculated automatically if `nil` | `nil` | +| `service.port` | CQL Port for the Kubernetes service | `9042` | +| `service.thriftPort` | Thrift Port for the Kubernetes service | `9160` | +| `dbUser.user` | Cassandra admin user | `cassandra` | +| `dbUser.forcePassword` | Force the user to provide a non-empty password for `dbUser.user` | `false` | +| `dbUser.password` | Password for `dbUser.user`. Randomly generated if empty | (Random generated) | +| `dbUser.existingSecret` | Use an existing secret object for `dbUser.user` password (will ignore `dbUser.password`) | `nil` | +| `startupCQL` | Startup CQL commands (done in the first node). Useful for creating keyspaces at startup, for instance | `nil` | +| `livenessProbe.enabled` | Turn on and off liveness probe | `true` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `30` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `readinessProbe.enabled` | Turn on and off readiness probe | `true` | +| `readinessProbe.initialDelaySeconds`| Delay before readiness probe is initiated | `5` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `podAnnotations` | Additional pod annotations | `{}` | +| `podLabels` | Additional pod labels | `{}` | +| `statefulset.updateStrategy` | Update strategy for StatefulSet | onDelete | +| `statefulset.rollingUpdatePartition` | Partition update strategy | `nil` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `affinity` | Enable node/pod affinity | {} | +| `tolerations` | Toleration labels for pod assignment | [] | +| `networkPolicy.enabled` | Enable NetworkPolicy | `false` | +| `networkPolicy.allowExternal` | Don't require client label for connections | `true` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Cassandra exporter Image registry | `docker.io` | +| `metrics.image.repository` | Cassandra exporter Image name | `criteo/cassandra_exporter` | +| `metrics.image.tag` | Cassandra exporter Image tag | `2.0.4` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify `docker-registry` secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter | `{prometheus.io/scrape: "true", prometheus.io/port: "8080"}` | +| `metrics.resources` | Exporter resource requests/limit | `{}` | + +The above parameters map to the env variables defined in [bitnami/cassandra](http://github.com/bitnami/bitnami-docker-cassandra). For more information please refer to the [bitnami/cassandra](http://github.com/bitnami/bitnami-docker-cassandra) image documentation. + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```console +$ helm install --name my-release \ + --set dbUser.user=admin,dbUser.password=password\ + bitnami/cassandra +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, + +```console +$ helm install --name my-release -f values.yaml bitnami/cassandra +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +## Persistence + +The [Bitnami cassandra](https://github.com/bitnami/bitnami-docker-cassandra) image stores the cassandra data at the `/bitnami/cassandra` path of the container. + +Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +See the [Configuration](#configuration) section to configure the PVC or to disable persistence. diff --git a/bitnami/cassandra/templates/NOTES.txt b/bitnami/cassandra/templates/NOTES.txt new file mode 100644 index 000000000..46a81bd26 --- /dev/null +++ b/bitnami/cassandra/templates/NOTES.txt @@ -0,0 +1,59 @@ +** Please be patient while the chart is being deployed ** + +Cassandra can be accessed through the following URLs from within the cluster: + + - CQL: {{ template "cassandra.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }} + - Thrift: {{ template "cassandra.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.thriftPort }} + +To get your password run: + + export CASSANDRA_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "cassandra.fullname" . }} -o jsonpath="{.data.cassandra-password}" | base64 --decode) + +Check the cluster status by running: + + kubectl exec -it --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "cassandra.name" . }},release={{ .Release.Name }} -o jsonpath='{.items[0].metadata.name}') nodetool status + +To connect to your Cassandra cluster using CQL: + +1. Run a Cassandra pod that you can use as a client: + + kubectl run --namespace {{ .Release.Namespace }} {{ template "cassandra.fullname" . }}-client --rm --tty -i \ + --env CASSANDRA_PASSWORD=$CASSANDRA_PASSWORD \ + {{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "cassandra.name" . }}-client=true"{{ end }} \ + --image {{ template "cassandra.image" . }} -- bash + +2. Connect using the cqlsh client: + + cqlsh -u {{ .Values.dbUser.user }} -p $CASSANDRA_PASSWORD {{ template "cassandra.fullname" . }} + +{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} +Note: Since NetworkPolicy is enabled, only pods with label +"{{ template "cassandra.fullname" . }}-client=true" +will be able to connect to Cassandra. +{{- else -}} + +To connect to your database from outside the cluster execute the following commands: + +{{- if contains "NodePort" .Values.service.type }} + + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "cassandra.fullname" . }}) + + cqlsh -u {{ .Values.dbUser.user }} -p $CASSANDRA_PASSWORD $NODE_IP $NODE_PORT + +{{- else if contains "LoadBalancer" .Values.service.type }} + + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "redis.fullname" . }}' + + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "redis.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + cqlsh -u {{ .Values.dbUser.user }} -p $CASSANDRA_PASSWORD $SERVICE_IP + +{{- else if contains "ClusterIP" .Values.service.type }} + + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "cassandra.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} & + cqlsh -u {{ .Values.dbUser.user }} -p $CASSANDRA_PASSWORD 127.0.0.1 {{ .Values.service.port }} + +{{- end }} +{{- end }} + diff --git a/bitnami/cassandra/templates/_helpers.tpl b/bitnami/cassandra/templates/_helpers.tpl new file mode 100644 index 000000000..c4bfbbce4 --- /dev/null +++ b/bitnami/cassandra/templates/_helpers.tpl @@ -0,0 +1,77 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "cassandra.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for networkpolicy. +*/}} +{{- define "networkPolicy.apiVersion" -}} +{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "networking.k8s.io/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "cassandra.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "cassandra.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Return the proper Cassandra image name +*/}} +{{- define "cassandra.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + + +{{/* +Return the proper metrics image name +*/}} +{{- define "cassandra.metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/bitnami/cassandra/templates/cassandra-secret.yaml b/bitnami/cassandra/templates/cassandra-secret.yaml new file mode 100644 index 000000000..b7904437c --- /dev/null +++ b/bitnami/cassandra/templates/cassandra-secret.yaml @@ -0,0 +1,20 @@ +{{- if (not .Values.dbUser.existingSecret) -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "cassandra.fullname" . }} + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + {{- if .Values.dbUser.password }} + cassandra-password: {{ .Values.dbUser.password | b64enc | quote }} + {{- else if (not .Values.dbUser.forcePassword) }} + cassandra-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ else }} + cassandra-password: {{ required "A Cassandra Password is required!" .Values.dbUser.password }} + {{- end }} +{{- end }} diff --git a/bitnami/cassandra/templates/headless-svc.yaml b/bitnami/cassandra/templates/headless-svc.yaml new file mode 100644 index 000000000..065108692 --- /dev/null +++ b/bitnami/cassandra/templates/headless-svc.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "cassandra.fullname" . }}-headless + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + clusterIP: None + publishNotReadyAddresses: true + ports: + - name: intra + port: 7000 + targetPort: intra + - name: tls + port: 7001 + targetPort: tls + - name: jmx + port: 7199 + targetPort: jmx + - name: cql + port: {{ .Values.service.port }} + targetPort: cql +{{- if .Values.cluster.enableRPC }} + - name: thrift + port: {{ .Values.service.thriftPort }} + targetPort: thrift +{{- end }} + selector: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} diff --git a/bitnami/cassandra/templates/networkPolicy.yaml b/bitnami/cassandra/templates/networkPolicy.yaml new file mode 100644 index 000000000..eb5655f29 --- /dev/null +++ b/bitnami/cassandra/templates/networkPolicy.yaml @@ -0,0 +1,35 @@ +{{- if .Values.networkPolicy.enabled }} +kind: NetworkPolicy +apiVersion: {{ template "networkPolicy.apiVersion" . }} +metadata: + name: {{ template "cassandra.fullname" . }} + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + podSelector: + matchLabels: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} + ingress: + # Allow inbound connections + - ports: + - port: {{ .Values.service.port }} + {{- if not .Values.networkPolicy.allowExternal }} + from: + - podSelector: + matchLabels: + {{ template "cassandra.fullname" . }}-client: "true" + {{- end }} + - podSelector: + matchLabels: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} + {{- if .Values.metrics.enabled }} + # Allow prometheus scrapes for metrics + - ports: + - port: 8080 + {{- end }} +{{- end }} diff --git a/bitnami/cassandra/templates/service.yaml b/bitnami/cassandra/templates/service.yaml new file mode 100644 index 000000000..393c170e8 --- /dev/null +++ b/bitnami/cassandra/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "cassandra.fullname" . }} + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: +{{- if .Values.service.nodePort }} + nodePort: {{ .Values.service.nodePort }} +{{- end }} +{{ if eq .Values.service.type "LoadBalancer" -}} {{ if .Values.service.loadBalancerIP -}} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end -}} {{- end }} + type: {{ .Values.service.type }} + ports: + - name: cql + port: {{ .Values.service.port }} + targetPort: cql +{{- if .Values.cluster.enableRPC }} + - name: thrift + port: {{ .Values.service.thriftPort }} + targetPort: thrift +{{- end }} + selector: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} diff --git a/bitnami/cassandra/templates/statefulset.yaml b/bitnami/cassandra/templates/statefulset.yaml new file mode 100644 index 000000000..4d8de929f --- /dev/null +++ b/bitnami/cassandra/templates/statefulset.yaml @@ -0,0 +1,212 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ template "cassandra.fullname" . }} + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + matchLabels: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} + serviceName: {{ template "cassandra.fullname" . }}-headless + replicas: {{ .Values.cluster.replicaCount }} + updateStrategy: + type: {{ .Values.statefulset.updateStrategy }} + {{- if .Values.statefulset.rollingUpdatePartition }} + rollingUpdate: + partition: {{ .Values.statefulset.rollingUpdatePartition }} + {{- end }} + template: + metadata: + labels: + app: {{ template "cassandra.name" . }} + release: {{ .Release.Name }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} +{{- end }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.enabled }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} + spec: +{{- if .Values.selector }} +{{ toYaml .Values.selector | indent 6 }} +{{- end }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} +{{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} +{{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} + containers: + - name: cassandra + command: + - bash + - -ec + # Node 0 is the password seeder + - | + if [[ $HOSTNAME =~ (.*)-0$ ]]; then + echo "Setting node as password seeder" + export CASSANDRA_PASSWORD_SEEDER=yes + fi + /app-entrypoint.sh /run.sh + + image: {{ template "cassandra.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + resources: +{{ toYaml .Values.resources | indent 10 }} + env: + - name: CASSANDRA_CLUSTER_NAME + value: {{ .Values.cluster.name }} + - name: CASSANDRA_SEEDS + {{- $global := . }} + {{- $replicas := .Values.cluster.seedCount | int }} + value: "{{- range $i, $e := until $replicas }}{{ template "cassandra.fullname" $global }}-{{ $i }}.{{ template "cassandra.fullname" $global }}-headless.{{ $global.Release.Namespace }}.svc.cluster.local{{- if (lt ( add1 $i ) $replicas ) }},{{- end }}{{- end }}" + - name: CASSANDRA_PASSWORD + valueFrom: + secretKeyRef: + name: {{ if .Values.dbUser.existingSecret }}{{ .Values.dbUser.existingSecret }}{{- else }}{{ template "cassandra.fullname" . }}{{- end }} + key: cassandra-password + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: CASSANDRA_NUM_TOKENS + value: {{ .Values.cluster.numTokens | quote }} + - name: CASSANDRA_DATACENTER + value: {{ .Values.cluster.datacenter }} + - name: CASSANDRA_ENDPOINT_SNITCH + value: {{ .Values.cluster.endpointSnitch }} + - name: CASSANDRA_RACK + value: {{ .Values.cluster.rack }} + {{- if .Values.jvm.maxHeapSize }} + - name: MAX_HEAP_SIZE + value: {{ .Values.jvm.maxHeapSize | quote }} + {{- end }} + {{- if .Values.jvm.newHeapSize }} + - name: HEAP_NEWSIZE + value: {{ .Values.jvm.newHeapSize | quote }} + {{- end }} + {{- if .Values.jvm.extraOpts }} + - name: JVM_EXTRA_OPTS + value: {{ .Values.jvm.extraOpts | quote }} + {{- end }} + {{- if .Values.startupCQL }} + - name: CASSANDRA_STARTUP_CQL + value: {{ .Values.startupCQL | quote }} + {{- end }} + - name: CASSANDRA_ENABLE_RPC + value: {{ .Values.cluster.enableRPC | quote }} +{{- if .Values.livenessProbe.enabled }} + livenessProbe: + exec: + command: [ "/bin/sh", "-c", "nodetool status" ] + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} +{{- end }} +{{- if .Values.readinessProbe.enabled }} + readinessProbe: + exec: + command: [ "/bin/sh", "-c", "nodetool status | grep -E \"^UN\\s+${POD_IP}\"" ] + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} +{{- end }} + ports: + - name: intra + containerPort: 7000 + - name: tls + containerPort: 7001 + - name: jmx + containerPort: 7199 + - name: cql + containerPort: 9042 +{{- if .Values.cluster.enableRPC }} + - name: thrift + containerPort: 9160 +{{- end }} + volumeMounts: + - name: data + mountPath: /bitnami/cassandra + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + - name: {{ .Values.image.pullSecrets }} + {{- end }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "cassandra.metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + {{- if .Values.metrics.image.pullSecrets }} + imagePullSecrets: + - name: {{ .Values.metrics.image.pullSecrets }} + {{- end }} + ports: + - name: metrics + containerPort: 8080 + protocol: TCP + - name: jmx + containerPort: 5555 + livenessProbe: + tcpSocket: + port: metrics + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 20 + timeoutSeconds: 45 +{{- end }} +{{- if not .Values.persistence.enabled }} + volumes: + - name: data + emptyDir: {} +{{- else }} + volumeClaimTemplates: + - metadata: + name: data + labels: + app: {{ template "cassandra.name" . }} + chart: {{ template "cassandra.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 8 }} +{{- end }} + spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.persistence.storageClass | quote }} + {{- end }} + {{- end }} +{{- end }} diff --git a/bitnami/cassandra/values-production.yaml b/bitnami/cassandra/values-production.yaml new file mode 100644 index 000000000..dd24d3d7a --- /dev/null +++ b/bitnami/cassandra/values-production.yaml @@ -0,0 +1,206 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + +## Bitnami Cassandra image version +## ref: https://hub.docker.com/r/bitnami/cassandra/tags/ +## +image: + registry: docker.io + repository: bitnami/cassandra + ## Bitnami Cassandra image tag + ## ref: https://github.com/bitnami/bitnami-docker-cassandra#supported-tags-and-respective-dockerfile-links + ## + tag: 3.11.3 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + +## Specify a service type +## ref: http://kubernetes.io/docs/user-guide/services/ +## +service: + type: ClusterIP + ## CQL Port + port: 9042 + thriftPort: 9160 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: 30001 + # loadBalancerIP: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + ## If true, use a Persistent Volume Claim, If false, use emptyDir + ## + enabled: true + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + ## Persistent Volume Claim annotations + ## + annotations: + ## Persistent Volume Access Mode + ## + accessModes: + - ReadWriteOnce + ## Persistent Volume size + ## + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## Minimum memory for development is 4GB and 2 CPU cores +## Minimum memory for production is 8GB and 4 CPU cores +## ref: http://docs.datastax.com/en/archived/cassandra/2.0/cassandra/architecture/architecturePlanningHardware_c.html +## +resources: {} + # requests: + # memory: 4Gi + # cpu: 2 + # limits: + # memory: 4Gi + # cpu: 2 + +## Cluster parameters +## +cluster: + name: cassandra + replicaCount: 3 + seedCount: 2 + numTokens: 256 + endpointSnitch: SimpleSnitch + datacenter: dc1 + rack: rack1 + enableRPC: true + +jvm: + ## Extra JVM Settings + ## + extraOpts: + + ## Memory settings: These are calculated automatically + ## unless specified otherwise + ## + # maxHeapSize: 4G + # newHeapSize: 800M + +## Database credentials +## +dbUser: + user: cassandra + forcePassword: true + # password: + # existingSecret: + +## Startup CQL commands. Useful for creating a keyspace +## and pre-populating data +## +# startupCQL: "CREATE KEYSPACE IF NOT EXISTS example_keyspace WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};" + +## Liveness and Readiness probe values. +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ +## +livenessProbe: + enabled: true + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 +readinessProbe: + enabled: true + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + +## Additional pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Additional pod labels +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +## +podLabels: {} + +## StatefulSet settings +## +statefulset: + updateStrategy: OnDelete + # rollingUpdatePartition: + +## Pod Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +## +securityContext: + enabled: true + fsGroup: 1001 + runAsUser: 1001 + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Network policies +## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/ +## +networkPolicy: + ## Specifies whether a NetworkPolicy should be created + ## + enabled: true + + ## The Policy model to apply. When set to false, only pods with the correct + ## client label will have network access to the port Redis is listening + ## on. When true, Redis will accept connections from any source + ## (with the correct destination port). + ## + # allowExternal: true + +## Cassandra exporter configuration +## Ref: https://github.com/criteo/cassandra_exporter +## +metrics: + enabled: true + image: + registry: docker.io + pullPolicy: IfNotPresent + repository: criteord/cassandra_exporter + tag: 2.0.4 + # pullSecrets: + resources: {} + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8080" diff --git a/bitnami/cassandra/values.yaml b/bitnami/cassandra/values.yaml new file mode 100644 index 000000000..6964d4596 --- /dev/null +++ b/bitnami/cassandra/values.yaml @@ -0,0 +1,206 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + +## Bitnami Cassandra image version +## ref: https://hub.docker.com/r/bitnami/cassandra/tags/ +## +image: + registry: docker.io + repository: bitnami/cassandra + ## Bitnami Cassandra image tag + ## ref: https://github.com/bitnami/bitnami-docker-cassandra#supported-tags-and-respective-dockerfile-links + ## + tag: 3.11.3 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + +## Specify a service type +## ref: http://kubernetes.io/docs/user-guide/services/ +## +service: + type: ClusterIP + ## CQL Port + port: 9042 + thriftPort: 9160 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: 30001 + # loadBalancerIP: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + ## If true, use a Persistent Volume Claim, If false, use emptyDir + ## + enabled: true + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + ## Persistent Volume Claim annotations + ## + annotations: + ## Persistent Volume Access Mode + ## + accessModes: + - ReadWriteOnce + ## Persistent Volume size + ## + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## Minimum memory for development is 4GB and 2 CPU cores +## Minimum memory for production is 8GB and 4 CPU cores +## ref: http://docs.datastax.com/en/archived/cassandra/2.0/cassandra/architecture/architecturePlanningHardware_c.html +## +resources: {} + # requests: + # memory: 4Gi + # cpu: 2 + # limits: + # memory: 4Gi + # cpu: 2 + +## Cluster parameters +## +cluster: + name: cassandra + replicaCount: 1 + seedCount: 1 + numTokens: 256 + datacenter: dc1 + rack: rack1 + enableRPC: true + endpointSnitch: SimpleSnitch + +jvm: + ## Extra JVM Settings + ## + extraOpts: + + ## Memory settings: These are calculated automatically + ## unless specified otherwise + ## + # maxHeapSize: 4G + # newHeapSize: 800M + +## Database credentials +## +dbUser: + user: cassandra + forcePassword: false + # password: + # existingSecret: + +## Startup CQL commands. Useful for creating a keyspace +## and pre-populating data +## +# startupCQL: "CREATE KEYSPACE IF NOT EXISTS example_keyspace WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};" + +## Liveness and Readiness probe values. +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ +## +livenessProbe: + enabled: true + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 +readinessProbe: + enabled: true + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + +## Additional pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Additional pod labels +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +## +podLabels: {} + +## StatefulSet settings +## +statefulset: + updateStrategy: OnDelete + # rollingUpdatePartition: + +## Pod Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +## +securityContext: + enabled: true + fsGroup: 1001 + runAsUser: 1001 + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Network policies +## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/ +## +networkPolicy: + ## Specifies whether a NetworkPolicy should be created + ## + enabled: false + + ## The Policy model to apply. When set to false, only pods with the correct + ## client label will have network access to the port Redis is listening + ## on. When true, Redis will accept connections from any source + ## (with the correct destination port). + ## + # allowExternal: true + +## Cassandra exporter configuration +## Ref: https://github.com/criteo/cassandra_exporter +## +metrics: + enabled: false + image: + registry: docker.io + pullPolicy: IfNotPresent + repository: criteord/cassandra_exporter + tag: 2.0.4 + # pullSecrets: + resources: {} + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8080" diff --git a/bitnami/consul/Chart.yaml b/bitnami/consul/Chart.yaml index 07e20ed09..a3fcf3a35 100755 --- a/bitnami/consul/Chart.yaml +++ b/bitnami/consul/Chart.yaml @@ -1,9 +1,6 @@ name: consul -home: https://www.consul.io/ -sources: -- https://github.com/bitnami/consul -version: 2.3.0 -appVersion: 1.3.0 +version: 3.0.0 +appVersion: 1.4.0 description: Highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy. diff --git a/bitnami/consul/README.md b/bitnami/consul/README.md index 430a6aefe..8cd924947 100644 --- a/bitnami/consul/README.md +++ b/bitnami/consul/README.md @@ -1,6 +1,6 @@ -# Consul Helm Chart +# HashiCorp Consul Helm Chart -[Consul](https://www.consul.io/) has multiple components, but as a whole, it is a tool for discovering and configuring services in your infrastructure +[HashiCorp Consul](https://www.consul.io/) has multiple components, but as a whole, it is a tool for discovering and configuring services in your infrastructure ## TL;DR @@ -11,7 +11,7 @@ $ helm install bitnami/consul ## Introduction -This chart bootstraps a [Consul](https://github.com/bitnami/bitnami-docker-consul) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +This chart bootstraps a [HashiCorp Consul](https://github.com/bitnami/bitnami-docker-consul) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. @@ -28,7 +28,7 @@ To install the chart with the release name `my-release`: $ helm install --name my-release bitnami/consul ``` -The command deploys Consul on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. +The command deploys HashiCorp Consul on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. > **Tip**: List all releases using `helm list` @@ -47,62 +47,63 @@ $ helm delete --purge my-release ## Configuration -The following tables lists the configurable parameters of the Consul chart and their default values. +The following tables lists the configurable parameters of the HashiCorp Consul chart and their default values. -| Parameter | Description | Default | -| ------------------------------------ | ------------------------------------------------------ | ---------------------------------------------------------- | -| `image.registry` | Consul image registry | `docker.io` | -| `image.repository` | Consul image name | `bitnami/consul` | -| `image.tag` | Consul image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `replicas` | Number of replicas | `3` | -| `httpPort` | Consul http listening port | `8500` | -| `rpcPort` | Consul rpc listening port | `8400` | -| `serflanPort` | Container serf lan listening port | `8301` | -| `serverPort` | Container server listening port | `8300` | -| `consulDnsPort` | Container dns listening port | `8600` | -| `uiPort` | Consul UI port | `80` | -| `datacenterName` | Consul datacenter name | `dc1` | -| `gossipKey` | Gossip key for all members | `nil` | -| `domain` | Consul domain | `consul` | -| `clientAddress` | Address in which Consul will bind client interfaces | `0.0.0.0` | -| `serflanAddress` | Address used for Serf LAN communications | `0.0.0.0` | -| `raftMultiplier` | Multiplier used to scale key Raft timing parameters | `10Gi` | -| `persistence.enabled` | Use a PVC to persist data | `true` | -| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | -| `persistence.size` | Size of data volume | `8Gi` | -| `persistence.annotations` | Annotations for the persistent volume | `nil` | -| `resources` | Container resource requests and limits | `{}` | -| `maxUnavailable` | Pod disruption Budget maxUnavailable | `1` | -| `nodeAffinity` | Consul pod node-affinity setting | `nil` | -| `antiAffinity` | Consul pod anti-affinity setting | `soft` | -| `ui.service.enabled` | Use a service to access Consul Ui | `true` | -| `ui.service.type` | Kubernetes Service Type | `ClusterIP` | -| `ui.service.annotations` | Annotations for Consul UI service | {} | -| `ui.service.loadBalancerIP` | IP if Consul UI service type is `LoadBalancer` | `nil` | -| `ui.ingress.enabled` | Enable ingress controller resource | `false` | -| `ui.ingress.hosts[0].name` | Hostname to your Consul installation | `consul-ui.local` | -| `ui.ingress.hosts[0].path` | Path within the url structure | `/` | -| `ui.ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | -| `ui.ingress.hosts[0].certManager` | Add annotations for cert-manager | `false` | -| `ui.ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `consul-ui.local-tls` | -| `ui.ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | -| `ui.ingress.secrets[0].name` | TLS Secret Name | `nil` | -| `ui.ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | -| `ui.ingress.secrets[0].key` | TLS Secret Key | `nil` | -| `configmap` | Consul configuration to be injected as ConfigMap | `nil` | -| `metrics.enabled` | Start a side-car prometheus exporter | `false` | -| `metrics.image` | Exporter image | `prom/consul-exporter` | -| `metrics.imageTag` | Exporter image tag | `v0.3.0` | -| `metrics.imagePullPolicy` | Exporter image pull policy | `IfNotPresent` | -| `metrics.resources` | Exporter resource requests/limit | `{}` | -| `metrics.podAnnotations` | Exporter annotations | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | -| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | -| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | +| Parameter | Description | Default | +| ------------------------------------ | ---------------------------------------------------------------- | ---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | HashiCorp Consul image registry | `docker.io` | +| `image.repository` | HashiCorp Consul image name | `bitnami/consul` | +| `image.tag` | HashiCorp Consul image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `replicas` | Number of replicas | `3` | +| `port` | HashiCorp Consul http listening port | `8500` | +| `service.rpcPort` | HashiCorp Consul rpc listening port | `8400` | +| `service.serflanPort` | Container serf lan listening port | `8301` | +| `service.serverPort` | Container server listening port | `8300` | +| `service.consulDnsPort` | Container dns listening port | `8600` | +| `service.uiPort` | HashiCorp Consul UI port | `80` | +| `datacenterName` | HashiCorp Consul datacenter name | `dc1` | +| `gossipKey` | Gossip key for all members | `nil` | +| `domain` | HashiCorp Consul domain | `consul` | +| `clientAddress` | Address in which HashiCorp Consul will bind client interfaces | `0.0.0.0` | +| `serflanAddress` | Address used for Serf LAN communications | `0.0.0.0` | +| `raftMultiplier` | Multiplier used to scale key Raft timing parameters | `10Gi` | +| `persistence.enabled` | Use a PVC to persist data | `true` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | +| `persistence.annotations` | Annotations for the persistent volume | `nil` | +| `resources` | Container resource requests and limits | `{}` | +| `maxUnavailable` | Pod disruption Budget maxUnavailable | `1` | +| `nodeAffinity` | HashiCorp Consul pod node-affinity setting | `nil` | +| `antiAffinity` | HashiCorp Consul pod anti-affinity setting | `soft` | +| `ui.service.enabled` | Use a service to access HashiCorp Consul Ui | `true` | +| `ui.service.type` | Kubernetes Service Type | `ClusterIP` | +| `ui.service.annotations` | Annotations for HashiCorp Consul UI service | {} | +| `ui.service.loadBalancerIP` | IP if HashiCorp Consul UI service type is `LoadBalancer` | `nil` | +| `ui.ingress.enabled` | Enable ingress controller resource | `false` | +| `ui.ingress.hosts[0].name` | Hostname to your HashiCorp Consul installation | `consul-ui.local` | +| `ui.ingress.hosts[0].path` | Path within the url structure | `/` | +| `ui.ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ui.ingress.hosts[0].certManager` | Add annotations for cert-manager | `false` | +| `ui.ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `consul-ui.local-tls` | +| `ui.ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | +| `ui.ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ui.ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ui.ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `configmap` | HashiCorp Consul configuration to be injected as ConfigMap | `nil` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image` | Exporter image | `prom/consul-exporter` | +| `metrics.imageTag` | Exporter image tag | `v0.3.0` | +| `metrics.imagePullPolicy` | Exporter image pull policy | `IfNotPresent` | +| `metrics.resources` | Exporter resource requests/limit | `{}` | +| `metrics.podAnnotations` | Exporter annotations | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | +| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | +| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | | `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | | `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `podAnnotations` | Pod annotations | `{}` | @@ -117,7 +118,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console $ helm install --name my-release --set domain=consul-domain,gossipKey=secretkey bitnami/consul ``` -The above command sets the Consul domain to `consul-domain` and sets the gossip key to `secretkey`. +The above command sets the HashiCorp Consul domain to `consul-domain` and sets the gossip key to `secretkey`. Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, @@ -129,7 +130,7 @@ $ helm install --name my-release -f values.yaml bitnami/consul ## Persistence -The [Bitnami Consul](https://github.com/bitnami/bitnami-docker-consul) image stores the Consul data at the `/bitnami` path of the container. +The [Bitnami HashiCorp Consul](https://github.com/bitnami/bitnami-docker-consul) image stores the HashiCorp Consul data at the `/bitnami` path of the container. Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the [Configuration](#configuration) section to configure the PVC or to disable persistence. @@ -139,20 +140,20 @@ See the [Configuration](#configuration) section to configure the PVC or to disab This chart provides support for ingress resources. If you have an ingress controller installed on your cluster, such as [nginx-ingress](https://kubeapps.com/charts/stable/nginx-ingress) or [traefik](https://kubeapps.com/charts/stable/traefik) you can utilize -the ingress controller to service your Consul UI application. +the ingress controller to service your HashiCorp Consul UI application. To enable ingress integration, please set `ingress.enabled` to `true` ### Hosts Most likely you will only want to have one hostname that maps to this -Consul installation, however it is possible to have more than one +HashiCorp Consul installation, however it is possible to have more than one host. To facilitate this, the `ingress.hosts` object is an array. For each item, please indicate a `name`, `tls`, `tlsSecret`, and any `annotations` that you may want the ingress controller to know about. -Indicating TLS will cause Consul to generate HTTPS urls, and -Consul will be connected to at port 443. The actual secret that +Indicating TLS will cause HashiCorp Consul to generate HTTPS urls, and +HashiCorp Consul will be connected to at port 443. The actual secret that `tlsSecret` references does not have to be generated by this chart. However, please note that if TLS is enabled, the ingress record will not work until this secret exists. @@ -221,7 +222,7 @@ kubectl create secret generic consul-tls-encryption \ > Take into account that you will need to create a config map with the proper configuration. -If the secret is specified, the chart will locate those files at `/opt/bitnami/consul/certs/`, so you will want to use the below snippet to configure Consul TLS encryption in your config map: +If the secret is specified, the chart will locate those files at `/opt/bitnami/consul/certs/`, so you will want to use the below snippet to configure HashiCorp Consul TLS encryption in your config map: ``` "ca_file": "/opt/bitnami/consul/certs/ca.pem", diff --git a/bitnami/consul/templates/NOTES.txt b/bitnami/consul/templates/NOTES.txt index bec369dde..24752199b 100644 --- a/bitnami/consul/templates/NOTES.txt +++ b/bitnami/consul/templates/NOTES.txt @@ -1,6 +1,6 @@ ** Please be patient while the chart is being deployed ** - Consul can be accessed within the cluster on port {{ .Values.serverPort }} at {{ template "consul.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + Consul can be accessed within the cluster on port {{ .Values.service.serverPort }} at {{ template "consul.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local {{- if .Values.ui.service.enabled }} @@ -25,12 +25,12 @@ In order to access to the Consul Web UI: export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "consul.fullname" . }}-ui --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Consul URL: http://$SERVICE_IP:{{ .Values.uiPort }}/" + echo "Consul URL: http://$SERVICE_IP:{{ .Values.service.uiPort }}/" {{- else if contains "ClusterIP" .Values.ui.service.type }} - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "consul.fullname" . }}-ui {{ .Values.uiPort }}:{{ .Values.uiPort }} - echo "Consul URL: http://127.0.0.1:{{ .Values.uiPort }}" + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "consul.fullname" . }}-ui {{ .Values.service.uiPort }}:{{ .Values.service.uiPort }} + echo "Consul URL: http://127.0.0.1:{{ .Values.service.uiPort }}" {{- end }} diff --git a/bitnami/consul/templates/_helpers.tpl b/bitnami/consul/templates/_helpers.tpl index 8b25e9ca8..6a1ac0a7e 100644 --- a/bitnami/consul/templates/_helpers.tpl +++ b/bitnami/consul/templates/_helpers.tpl @@ -26,7 +26,21 @@ Create chart name and version as used by the chart label. Return the proper Consul image name */}} {{- define "consul.image" -}} -{{- $registryName := default "docker.io" .Values.image.registry -}} -{{- $tag := default "latest" .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} diff --git a/bitnami/consul/templates/consul-service.yaml b/bitnami/consul/templates/consul-service.yaml index 17d413fb0..ee5e203f3 100644 --- a/bitnami/consul/templates/consul-service.yaml +++ b/bitnami/consul/templates/consul-service.yaml @@ -12,22 +12,22 @@ metadata: spec: ports: - name: http - port: {{ .Values.httpPort }} + port: {{ .Values.service.port }} - name: rpc - port: {{ .Values.rpcPort }} + port: {{ .Values.service.rpcPort }} - name: serflan-tcp protocol: "TCP" - port: {{ .Values.serflanPort }} + port: {{ .Values.service.serflanPort }} - name: serflan-udp protocol: "UDP" - port: {{ .Values.serflanPort }} + port: {{ .Values.service.serflanPort }} - name: server - port: {{.Values.serverPort}} + port: {{.Values.service.serverPort}} - name: consuldns-tcp - port: {{.Values.consulDnsPort}} + port: {{.Values.service.consulDnsPort}} - name: consuldns-udp protocol: "UDP" - port: {{.Values.consulDnsPort}} + port: {{.Values.service.consulDnsPort}} clusterIP: None selector: app: "{{ template "consul.name" . }}" diff --git a/bitnami/consul/templates/statefulset.yaml b/bitnami/consul/templates/statefulset.yaml index 57c74c1b7..69830ebef 100644 --- a/bitnami/consul/templates/statefulset.yaml +++ b/bitnami/consul/templates/statefulset.yaml @@ -79,22 +79,22 @@ spec: imagePullPolicy: "{{ .Values.image.pullPolicy }}" ports: - name: http - containerPort: {{ .Values.httpPort }} + containerPort: {{ .Values.service.port }} - name: rpc - containerPort: {{ .Values.rpcPort }} + containerPort: {{ .Values.service.rpcPort }} - name: serflan-tcp protocol: "TCP" - containerPort: {{ .Values.serflanPort }} + containerPort: {{ .Values.service.serflanPort }} - name: serflan-udp protocol: "UDP" - containerPort: {{ .Values.serflanPort }} + containerPort: {{ .Values.service.serflanPort }} - name: server - containerPort: {{ .Values.serverPort }} + containerPort: {{ .Values.service.serverPort }} - name: consuldns-tcp - containerPort: {{ .Values.consulDnsPort }} + containerPort: {{ .Values.service.consulDnsPort }} - name: consuldns-udp protocol: "UDP" - containerPort: {{ .Values.consulDnsPort }} + containerPort: {{ .Values.service.consulDnsPort }} resources: {{ toYaml .Values.Resources | indent 10 }} env: @@ -127,13 +127,13 @@ spec: - name: CONSUL_UI value: "{{ .Values.ui.service.enabled }}" - name: CONSUL_HTTP_PORT_NUMBER - value: {{ .Values.httpPort | quote}} + value: {{ .Values.port | quote}} - name: CONSUL_DNS_PORT_NUMBER - value: {{ .Values.consulDnsPort | quote }} + value: {{ .Values.service.consulDnsPort | quote }} - name: CONSUL_RPC_PORT_NUMBER - value: {{ .Values.serverPort | quote }} + value: {{ .Values.service.serverPort | quote }} - name: CONSUL_SERF_LAN_PORT_NUMBER - value: {{ .Values.serflanPort | quote }} + value: {{ .Values.service.serflanPort | quote }} {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: @@ -189,7 +189,7 @@ spec: image: "{{ .Values.metrics.image.registry }}/{{ .Values.metrics.image.repository }}:{{ .Values.metrics.image.tag }}" imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} env: - command: [ '/bin/consul_exporter' , '--consul.server={{ template "consul.fullname" . }}:{{ .Values.httpPort }}'] + command: [ '/bin/consul_exporter' , '--consul.server={{ template "consul.fullname" . }}:{{ .Values.port }}'] ports: - name: metrics containerPort: 9107 diff --git a/bitnami/consul/templates/ui-service.yaml b/bitnami/consul/templates/ui-service.yaml index 44514a882..acc013dbc 100644 --- a/bitnami/consul/templates/ui-service.yaml +++ b/bitnami/consul/templates/ui-service.yaml @@ -16,7 +16,7 @@ metadata: spec: ports: - name: http - port: {{ .Values.uiPort }} + port: {{ .Values.service.uiPort }} targetPort: http type: "{{ .Values.ui.service.type }}" {{- if and (eq .Values.ui.service.type "LoadBalancer") .Values.ui.service.loadBalancerIP }} diff --git a/bitnami/consul/values-production.yaml b/bitnami/consul/values-production.yaml index 931ee6388..1341ffac9 100644 --- a/bitnami/consul/values-production.yaml +++ b/bitnami/consul/values-production.yaml @@ -1,10 +1,16 @@ -## Bitnami Consul image version +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + +## Bitnami HashiCorp Consul image version ## ref: https://hub.docker.com/r/bitnami/consul/tags/ ## image: registry: docker.io repository: bitnami/consul - tag: 1.3.0-debian-9 + tag: 1.4.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -20,13 +26,14 @@ image: ## Consul replicas replicas: 3 -## Consul service ports -httpPort: 8500 -rpcPort: 8400 -serflanPort: 8301 -serverPort: 8300 -consulDnsPort: 8600 -uiPort: 80 +service: + ## Consul service ports + port: 8500 + rpcPort: 8400 + serflanPort: 8301 + serverPort: 8300 + consulDnsPort: 8600 + uiPort: 80 ## Datacenter name for consul. If not supplied, will use the consul ## default 'dc1' diff --git a/bitnami/consul/values.yaml b/bitnami/consul/values.yaml index 7f0e8e7dd..b771c84ee 100644 --- a/bitnami/consul/values.yaml +++ b/bitnami/consul/values.yaml @@ -1,10 +1,16 @@ -## Bitnami Consul image version +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + +## Bitnami HashiCorp Consul image version ## ref: https://hub.docker.com/r/bitnami/consul/tags/ ## image: registry: docker.io repository: bitnami/consul - tag: 1.3.0-debian-9 + tag: 1.4.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -20,13 +26,14 @@ image: ## Consul replicas replicas: 3 -## Consul service ports -httpPort: 8500 -rpcPort: 8400 -serflanPort: 8301 -serverPort: 8300 -consulDnsPort: 8600 -uiPort: 80 +service: + ## Consul service ports + port: 8500 + rpcPort: 8400 + serflanPort: 8301 + serverPort: 8300 + consulDnsPort: 8600 + uiPort: 80 ## Datacenter name for consul. If not supplied, will use the consul ## default 'dc1' diff --git a/bitnami/elasticsearch/Chart.yaml b/bitnami/elasticsearch/Chart.yaml index 4ef13fa89..8e0dd71b4 100644 --- a/bitnami/elasticsearch/Chart.yaml +++ b/bitnami/elasticsearch/Chart.yaml @@ -1,6 +1,6 @@ name: elasticsearch -version: 4.0.3 -appVersion: 6.4.2 +version: 4.2.2 +appVersion: 6.5.1 description: A highly scalable open-source full-text search and analytics engine keywords: - elasticsearch diff --git a/bitnami/elasticsearch/README.md b/bitnami/elasticsearch/README.md index 83189f4ad..841b1d46c 100644 --- a/bitnami/elasticsearch/README.md +++ b/bitnami/elasticsearch/README.md @@ -49,107 +49,122 @@ $ helm delete --purge my-release The following table lists the configurable parameters of the Elasticsearch chart and their default values. -| Parameter | Description | Default | -|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------| -| `image.registry` | Elasticsearch image registry | `docker.io` | -| `image.repository` | Elasticsearch image repository | `bitnami/elasticsearch` | -| `image.tag` | Elasticsearch image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `name` | Elasticsearch cluster name | `elastic` | -| `config` | Elasticsearch node custom configuration | `` | -| `master.name` | Master-eligible node pod name | `master` | -| `master.replicas` | Desired number of Elasticsearch master-eligible nodes | `2` | -| `master.heapSize` | Master-eligible node heap size | `128m` | -| `master.antiAffinity` | Master-eligible node pod anti-affinity policy | `soft` | -| `master.resources` | CPU/Memory resource requests/limits for master-eligible nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | -| `master.livenessProbe.enabled` | Enable/disable the liveness probe (master-eligible nodes pod) | `true` | -| `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (master-eligible nodes pod) | `90` | -| `master.livenessProbe.periodSeconds` | How often to perform the probe (master-eligible nodes pod) | `10` | -| `master.livenessProbe.timeoutSeconds` | When the probe times out (master-eligible nodes pod) | `5` | -| `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (master-eligible nodes pod) | `1` | -| `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `master.readinessProbe.enabled` | Enable/disable the readiness probe (master-eligible nodes pod) | `true` | -| `master.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (master-eligible nodes pod) | `90` | -| `master.readinessProbe.periodSeconds` | How often to perform the probe (master-eligible nodes pod) | `10` | -| `master.readinessProbe.timeoutSeconds` | When the probe times out (master-eligible nodes pod) | `5` | -| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (master-eligible nodes pod) | `1` | -| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` -| `discovery.name` | Discover node pod name | `discovery` | -| `coordinating.name` | Coordinating-only node pod name | `coordinating-only` | -| `coordinating.replicas` | Desired number of Elasticsearch coordinating-only nodes | `2` | -| `coordinating.heapSize` | Coordinating-only node heap size | `128m` | -| `coordinating.antiAffinity` | Coordinating-only node pod anti-affinity policy | `soft` | -| `coordinating.service.type` | Coordinating-only node kubernetes service type | `ClusterIP` | -| `coordinating.service.port` | Elasticsearch REST API port | `9200` | -| `coordinating.resources` | CPU/Memory resource requests/limits for coordinating-only nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | -| `coordinating.livenessProbe.enabled` | Enable/disable the liveness probe (coordinating-only nodes pod) | `true` | -| `coordinating.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (coordinating-only nodes pod) | `90` | -| `coordinating.livenessProbe.periodSeconds` | How often to perform the probe (coordinating-only nodes pod) | `10` | -| `coordinating.livenessProbe.timeoutSeconds` | When the probe times out (coordinating-only nodes pod) | `5` | -| `coordinating.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (coordinating-only nodes pod) | `1` | -| `coordinating.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `coordinating.readinessProbe.enabled` | Enable/disable the readiness probe (coordinating-only nodes pod) | `true` | -| `coordinating.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (coordinating-only nodes pod) | `90` | -| `coordinating.readinessProbe.periodSeconds` | How often to perform the probe (coordinating-only nodes pod) | `10` | -| `coordinating.readinessProbe.timeoutSeconds` | When the probe times out (coordinating-only nodes pod) | `5` | -| `coordinating.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (coordinating-only nodes pod) | `1` | -| `coordinating.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `data.name` | Data node pod name | `data` | -| `data.replicas` | Desired number of Elasticsearch data nodes nodes | `3` | -| `data.heapSize` | Data node heap size | `1024m` | -| `data.antiAffinity` | Data pod anti-affinity policy | `soft` | -| `data.resources` | CPU/Memory resource requests/limits for data nodes | `requests: { cpu: "25m", memory: "1152Mi" }` | -| `data.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | -| `data.persistence.annotations` | Persistent Volume Claim annotations | `{}` | -| `data.persistence.storageClass` | Persistent Volume Storage Class | `` | -| `data.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | -| `data.persistence.size` | Persistent Volume Size | `8Gi` | -| `data.livenessProbe.enabled` | Enable/disable the liveness probe (data nodes pod) | `true` | -| `data.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (data nodes pod) | `90` | -| `data.livenessProbe.periodSeconds` | How often to perform the probe (data nodes pod) | `10` | -| `data.livenessProbe.timeoutSeconds` | When the probe times out (data nodes pod) | `5` | -| `data.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (data nodes pod) | `1` | -| `data.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `data.readinessProbe.enabled` | Enable/disable the readiness probe (data nodes pod) | `true` | -| `data.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (data nodes pod) | `90` | -| `data.readinessProbe.periodSeconds` | How often to perform the probe (data nodes pod) | `10` | -| `data.readinessProbe.timeoutSeconds` | When the probe times out (data nodes pod) | `5` | -| `data.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (data nodes pod) | `1` | -| `data.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `ingest.enabled` | Enable ingest nodes | `false` | -| `ingest.name` | Ingest node pod name | `ingest` | -| `ingest.replicas` | Desired number of Elasticsearch ingest nodes | `2` | -| `ingest.heapSize` | Ingest node heap size | `128m` | -| `ingest.antiAffinity` | Ingest node pod anti-affinity policy | `soft` | -| `ingest.resources` | CPU/Memory resource requests/limits for ingest nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | -| `ingest.livenessProbe.enabled` | Enable/disable the liveness probe (ingest nodes pod) | `true` | -| `ingest.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (ingest nodes pod) | `90` | -| `ingest.livenessProbe.periodSeconds` | How often to perform the probe (ingest nodes pod) | `10` | -| `ingest.livenessProbe.timeoutSeconds` | When the probe times out (ingest nodes pod) | `5` | -| `ingest.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (ingest nodes pod) | `1` | -| `ingest.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `ingest.readinessProbe.enabled` | Enable/disable the readiness probe (ingest nodes pod) | `true` | -| `ingest.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (ingest nodes pod) | `90` | -| `ingest.readinessProbe.periodSeconds` | How often to perform the probe (ingest nodes pod) | `10` | -| `ingest.readinessProbe.timeoutSeconds` | When the probe times out (ingest nodes pod) | `5` | -| `ingest.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (ingest nodes pod) | `1` | -| `ingest.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | -| `metrics.enabled` | Enable prometheus exporter | `false` | -| `metrics.name` | Metrics pod name | `metrics` | -| `metrics.image.registry` | Metrics exporter image registry | `docker.io` | -| `metrics.image.repository` | Metrics exporter image repository | `bitnami/elasticsearch-exporter` | -| `metrics.image.tag` | Metrics exporter image tag | `latest` | -| `metrics.image.pullPolicy` | Metrics exporter image pull policy | `Always` | -| `metrics.service.type` | Metrics exporter endpoint service type | `ClusterIP` | -| `metrics.resources` | Metrics exporter resource requests/limit | `requests: { cpu: "25m" }` | -| `sysctlImage.registry` | Kernel settings modifier image registry | `docker.io` | -| `sysctlImage.repository` | Kernel settings modifier image repository | `busybox` | -| `sysctlImage.tag` | Kernel settings modifier image tag | `latest` | -| `sysctlImage.pullPolicy` | Kernel settings modifier image pull policy | `Always` | +| Parameter | Description | Default | +|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | Elasticsearch image registry | `docker.io` | +| `image.repository` | Elasticsearch image repository | `bitnami/elasticsearch` | +| `image.tag` | Elasticsearch image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `name` | Elasticsearch cluster name | `elastic` | +| `config` | Elasticsearch node custom configuration | `` | +| `master.name` | Master-eligible node pod name | `master` | +| `master.replicas` | Desired number of Elasticsearch master-eligible nodes | `2` | +| `master.heapSize` | Master-eligible node heap size | `128m` | +| `master.antiAffinity` | Master-eligible node pod anti-affinity policy | `soft` | +| `master.service.type` | Kubernetes Service type (master-eligible nodes) | `ClusterIP` | +| `master.service.port` | Kubernetes Service port for Elasticsearch transport port (master-eligible nodes) | `9300` | +| `master.service.nodePort` | Kubernetes Service nodePort (master-eligible nodes) | `nil` | +| `master.service.annotations` | Annotations for master-eligible nodes service | {} | +| `master.service.loadBalancerIP` | loadBalancerIP if master-eligible nodes service type is `LoadBalancer` | `nil` | +| `master.resources` | CPU/Memory resource requests/limits for master-eligible nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | +| `master.livenessProbe.enabled` | Enable/disable the liveness probe (master-eligible nodes pod) | `true` | +| `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (master-eligible nodes pod) | `90` | +| `master.livenessProbe.periodSeconds` | How often to perform the probe (master-eligible nodes pod) | `10` | +| `master.livenessProbe.timeoutSeconds` | When the probe times out (master-eligible nodes pod) | `5` | +| `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (master-eligible nodes pod) | `1` | +| `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `master.readinessProbe.enabled` | Enable/disable the readiness probe (master-eligible nodes pod) | `true` | +| `master.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (master-eligible nodes pod) | `90` | +| `master.readinessProbe.periodSeconds` | How often to perform the probe (master-eligible nodes pod) | `10` | +| `master.readinessProbe.timeoutSeconds` | When the probe times out (master-eligible nodes pod) | `5` | +| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (master-eligible nodes pod) | `1` | +| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `discovery.name` | Discover node pod name | `discovery` | +| `coordinating.name` | Coordinating-only node pod name | `coordinating-only` | +| `coordinating.replicas` | Desired number of Elasticsearch coordinating-only nodes | `2` | +| `coordinating.heapSize` | Coordinating-only node heap size | `128m` | +| `coordinating.antiAffinity` | Coordinating-only node pod anti-affinity policy | `soft` | +| `coordinating.service.type` | Kubernetes Service type (coordinating-only nodes) | `ClusterIP` | +| `coordinating.service.port` | Kubernetes Service port for REST API (coordinating-only nodes) | `9200` | +| `coordinating.service.nodePort` | Kubernetes Service nodePort (coordinating-only nodes) | `nil` | +| `coordinating.service.annotations` | Annotations for coordinating-only nodes service | {} | +| `coordinating.service.loadBalancerIP` | loadBalancerIP if coordinating-only nodes service type is `LoadBalancer` | `nil` | +| `coordinating.resources` | CPU/Memory resource requests/limits for coordinating-only nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | +| `coordinating.livenessProbe.enabled` | Enable/disable the liveness probe (coordinating-only nodes pod) | `true` | +| `coordinating.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (coordinating-only nodes pod) | `90` | +| `coordinating.livenessProbe.periodSeconds` | How often to perform the probe (coordinating-only nodes pod) | `10` | +| `coordinating.livenessProbe.timeoutSeconds` | When the probe times out (coordinating-only nodes pod) | `5` | +| `coordinating.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (coordinating-only nodes pod) | `1` | +| `coordinating.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `coordinating.readinessProbe.enabled` | Enable/disable the readiness probe (coordinating-only nodes pod) | `true` | +| `coordinating.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (coordinating-only nodes pod) | `90` | +| `coordinating.readinessProbe.periodSeconds` | How often to perform the probe (coordinating-only nodes pod) | `10` | +| `coordinating.readinessProbe.timeoutSeconds` | When the probe times out (coordinating-only nodes pod) | `5` | +| `coordinating.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (coordinating-only nodes pod) | `1` | +| `coordinating.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `data.name` | Data node pod name | `data` | +| `data.replicas` | Desired number of Elasticsearch data nodes nodes | `3` | +| `data.heapSize` | Data node heap size | `1024m` | +| `data.antiAffinity` | Data pod anti-affinity policy | `soft` | +| `data.resources` | CPU/Memory resource requests/limits for data nodes | `requests: { cpu: "25m", memory: "1152Mi" }` | +| `data.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | +| `data.persistence.annotations` | Persistent Volume Claim annotations | `{}` | +| `data.persistence.storageClass` | Persistent Volume Storage Class | `` | +| `data.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | +| `data.persistence.size` | Persistent Volume Size | `8Gi` | +| `data.livenessProbe.enabled` | Enable/disable the liveness probe (data nodes pod) | `true` | +| `data.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (data nodes pod) | `90` | +| `data.livenessProbe.periodSeconds` | How often to perform the probe (data nodes pod) | `10` | +| `data.livenessProbe.timeoutSeconds` | When the probe times out (data nodes pod) | `5` | +| `data.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (data nodes pod) | `1` | +| `data.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `data.readinessProbe.enabled` | Enable/disable the readiness probe (data nodes pod) | `true` | +| `data.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (data nodes pod) | `90` | +| `data.readinessProbe.periodSeconds` | How often to perform the probe (data nodes pod) | `10` | +| `data.readinessProbe.timeoutSeconds` | When the probe times out (data nodes pod) | `5` | +| `data.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (data nodes pod) | `1` | +| `data.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `ingest.enabled` | Enable ingest nodes | `false` | +| `ingest.name` | Ingest node pod name | `ingest` | +| `ingest.replicas` | Desired number of Elasticsearch ingest nodes | `2` | +| `ingest.heapSize` | Ingest node heap size | `128m` | +| `ingest.antiAffinity` | Ingest node pod anti-affinity policy | `soft` | +| `ingest.service.type` | Kubernetes Service type (ingest nodes) | `ClusterIP` | +| `ingest.service.port` | Kubernetes Service port Elasticsearch transport port (ingest nodes) | `9300` | +| `ingest.service.nodePort` | Kubernetes Service nodePort (ingest nodes) | `nil` | +| `ingest.service.annotations` | Annotations for ingest nodes service | {} | +| `ingest.service.loadBalancerIP` | loadBalancerIP if ingest nodes service type is `LoadBalancer` | `nil` | +| `ingest.resources` | CPU/Memory resource requests/limits for ingest nodes pods | `requests: { cpu: "25m", memory: "256Mi" }` | +| `ingest.livenessProbe.enabled` | Enable/disable the liveness probe (ingest nodes pod) | `true` | +| `ingest.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (ingest nodes pod) | `90` | +| `ingest.livenessProbe.periodSeconds` | How often to perform the probe (ingest nodes pod) | `10` | +| `ingest.livenessProbe.timeoutSeconds` | When the probe times out (ingest nodes pod) | `5` | +| `ingest.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (ingest nodes pod) | `1` | +| `ingest.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `ingest.readinessProbe.enabled` | Enable/disable the readiness probe (ingest nodes pod) | `true` | +| `ingest.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated (ingest nodes pod) | `90` | +| `ingest.readinessProbe.periodSeconds` | How often to perform the probe (ingest nodes pod) | `10` | +| `ingest.readinessProbe.timeoutSeconds` | When the probe times out (ingest nodes pod) | `5` | +| `ingest.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (ingest nodes pod) | `1` | +| `ingest.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | `5` | +| `metrics.enabled` | Enable prometheus exporter | `false` | +| `metrics.name` | Metrics pod name | `metrics` | +| `metrics.image.registry` | Metrics exporter image registry | `docker.io` | +| `metrics.image.repository` | Metrics exporter image repository | `bitnami/elasticsearch-exporter` | +| `metrics.image.tag` | Metrics exporter image tag | `1.0.2` | +| `metrics.image.pullPolicy` | Metrics exporter image pull policy | `Always` | +| `metrics.service.type` | Metrics exporter endpoint service type | `ClusterIP` | +| `metrics.resources` | Metrics exporter resource requests/limit | `requests: { cpu: "25m" }` | +| `sysctlImage.enabled` | Enable kernel settings modifier image | `false` | +| `sysctlImage.registry` | Kernel settings modifier image registry | `docker.io` | +| `sysctlImage.repository` | Kernel settings modifier image repository | `bitnami/minideb` | +| `sysctlImage.tag` | Kernel settings modifier image tag | `latest` | +| `sysctlImage.pullPolicy` | Kernel settings modifier image pull policy | `Always` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, @@ -175,6 +190,21 @@ The [Bitnami Elasticsearch](https://github.com/bitnami/bitnami-docker-elasticsea By default, the chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) at this location. The volume is created using dynamic volume provisioning. See the [Configuration](#configuration) section to configure the PVC. +## Troubleshooting + +Currently, Elasticsearch requires some changes in the kernel of the host machine to work as expected. If those values are not set in the underlying operating system, the ES containers fail to boot with ERROR messages. More information about these requirements can be found in the links below: + +- [File Descriptor requirements](https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html) +- [Virtual memory requirements](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html) + +You can use a **privileged** initContainer to changes those settings in the Kernel by enabling the `sysctlImage.enabled`: + +```console +$ helm install --name my-release \ + --set sysctlImage.enabled=true \ + bitnami/elasticsearch +``` + ## Upgrading ### To 3.0.0 diff --git a/bitnami/elasticsearch/templates/NOTES.txt b/bitnami/elasticsearch/templates/NOTES.txt index b55f5601e..00441ae0b 100644 --- a/bitnami/elasticsearch/templates/NOTES.txt +++ b/bitnami/elasticsearch/templates/NOTES.txt @@ -11,6 +11,34 @@ suggest that you switch to "ClusterIP" or "NodePort". ------------------------------------------------------------------------------- {{- end }} +{{- if not .Values.sysctlImage.enabled }} + +------------------------------------------------------------------------------- + WARNING + + Elasticsearch requires some changes in the kernel of the host machine to + work as expected. If those values are not set in the underlying operating + system, the ES containers fail to boot with ERROR messages. + + To check whether the host machine meets the requirements, run the command + below: + + kubectl logs --namespace {{ .Release.Namespace }} $(kubectl get --namespace {{ .Release.Namespace }} \ + pods -l app={{ template "elasticsearch.name" . }},role=master -o jsonpath='{.items[0].metadata.name}') \ + elasticsearch + + You can adapt the Kernel parameters on you cluster as described in the + official documentation: + + https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster + + As an alternative, you can specify "sysctlImage.enabled=true" to use a + privileged initContainer to change those settings in the Kernel: + + helm upgrade {{ .Release.Name }} bitnami/elasticsearch \ + --set sysctlImage.enabled=true + +{{- end }} ** Please be patient while the chart is being deployed ** diff --git a/bitnami/elasticsearch/templates/_helpers.tpl b/bitnami/elasticsearch/templates/_helpers.tpl index 3d22577fb..46cad9df9 100644 --- a/bitnami/elasticsearch/templates/_helpers.tpl +++ b/bitnami/elasticsearch/templates/_helpers.tpl @@ -26,9 +26,23 @@ Create chart name and version as used by the chart label. Return the proper ES image name */}} {{- define "elasticsearch.image" -}} -{{- $registryName := default "docker.io" .Values.image.registry -}} -{{- $tag := default "latest" .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/bitnami/elasticsearch/templates/coordinating-deploy.yaml b/bitnami/elasticsearch/templates/coordinating-deploy.yaml index 2668d0a9c..62fc927f9 100644 --- a/bitnami/elasticsearch/templates/coordinating-deploy.yaml +++ b/bitnami/elasticsearch/templates/coordinating-deploy.yaml @@ -13,7 +13,7 @@ spec: matchLabels: app: {{ template "elasticsearch.name" . }} release: "{{ .Release.Name }}" - role: "coordinating-only" + role: "coordinating-only" replicas: {{ .Values.coordinating.replicas }} template: metadata: @@ -55,15 +55,18 @@ spec: - name: {{ . }} {{- end}} {{- end }} + {{- if .Values.sysctlImage.enabled }} + ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: - name: sysctl image: {{ template "sysctl.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - command: ["sysctl", "-w", "vm.max_map_count=262144"] + command: ['sh', '-c', 'install_packages systemd && sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536'] securityContext: privileged: true + {{- end }} containers: - - name: {{ template "elasticsearch.coordinating.fullname" . }} + - name: "elasticsearch" {{- if .Values.securityContext.enabled }} securityContext: runAsUser: {{ .Values.securityContext.runAsUser }} diff --git a/bitnami/elasticsearch/templates/coordinating-svc.yaml b/bitnami/elasticsearch/templates/coordinating-svc.yaml index bd66610ad..35c64ef1a 100644 --- a/bitnami/elasticsearch/templates/coordinating-svc.yaml +++ b/bitnami/elasticsearch/templates/coordinating-svc.yaml @@ -8,12 +8,22 @@ metadata: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} role: "coordinating-only" +{{- with .Values.coordinating.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.coordinating.service.type | quote }} + {{- if and (eq .Values.coordinating.service.type "LoadBalancer") .Values.coordinating.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.coordinating.service.loadBalancerIP }} + {{- end }} ports: - name: http port: {{ .Values.coordinating.service.port }} targetPort: http + {{- if .Values.coordinating.service.nodePort }} + nodePort: {{ .Values.coordinating.service.nodePort }} + {{- end }} selector: app: {{ template "elasticsearch.name" . }} release: {{ .Release.Name | quote }} diff --git a/bitnami/elasticsearch/templates/data-statefulset.yaml b/bitnami/elasticsearch/templates/data-statefulset.yaml index d0ecac398..3490056db 100644 --- a/bitnami/elasticsearch/templates/data-statefulset.yaml +++ b/bitnami/elasticsearch/templates/data-statefulset.yaml @@ -51,15 +51,18 @@ spec: release: {{ .Release.Name | quote }} role: "data" {{- end }} + {{- if .Values.sysctlImage.enabled }} + ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: - name: sysctl image: {{ template "sysctl.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - command: ["sysctl", "-w", "vm.max_map_count=262144"] + command: ['sh', '-c', 'install_packages systemd && sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536'] securityContext: privileged: true + {{- end }} containers: - - name: {{ template "elasticsearch.data.fullname" . }} + - name: "elasticsearch" image: {{ template "elasticsearch.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} {{- if .Values.securityContext.enabled }} diff --git a/bitnami/elasticsearch/templates/ingest-deploy.yaml b/bitnami/elasticsearch/templates/ingest-deploy.yaml index 97bafd9a5..e4506942e 100644 --- a/bitnami/elasticsearch/templates/ingest-deploy.yaml +++ b/bitnami/elasticsearch/templates/ingest-deploy.yaml @@ -14,7 +14,7 @@ spec: matchLabels: app: {{ template "elasticsearch.name" . }} release: "{{ .Release.Name }}" - role: "ingest" + role: "ingest" replicas: {{ .Values.ingest.replicas }} template: metadata: @@ -56,15 +56,18 @@ spec: - name: {{ . }} {{- end}} {{- end }} + {{- if .Values.sysctlImage.enabled }} + ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: - name: sysctl image: {{ template "sysctl.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - command: ["sysctl", "-w", "vm.max_map_count=262144"] + command: ['sh', '-c', 'install_packages systemd && sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536'] securityContext: privileged: true + {{- end }} containers: - - name: {{ template "elasticsearch.ingest.fullname" . }} + - name: "elasticsearch" image: {{ template "elasticsearch.image" . }} {{- if .Values.securityContext.enabled }} securityContext: diff --git a/bitnami/elasticsearch/templates/ingest-svc.yaml b/bitnami/elasticsearch/templates/ingest-svc.yaml index deb117a5b..4f62c66ac 100644 --- a/bitnami/elasticsearch/templates/ingest-svc.yaml +++ b/bitnami/elasticsearch/templates/ingest-svc.yaml @@ -9,11 +9,22 @@ metadata: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} role: "ingest" +{{- with .Values.ingest.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: + type: {{ .Values.ingest.service.type | quote }} + {{- if and (eq .Values.ingest.service.type "LoadBalancer") .Values.ingest.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.ingest.service.loadBalancerIP }} + {{- end }} ports: - name: transport - port: 9300 + port: {{ .Values.ingest.service.port }} targetPort: transport + {{- if .Values.ingest.service.nodePort }} + nodePort: {{ .Values.ingest.service.nodePort }} + {{- end }} selector: app: {{ template "elasticsearch.name" . }} release: {{ .Release.Name | quote }} diff --git a/bitnami/elasticsearch/templates/master-deploy.yaml b/bitnami/elasticsearch/templates/master-deploy.yaml index 7beec84a9..80800b75c 100644 --- a/bitnami/elasticsearch/templates/master-deploy.yaml +++ b/bitnami/elasticsearch/templates/master-deploy.yaml @@ -13,7 +13,7 @@ spec: matchLabels: app: {{ template "elasticsearch.name" . }} release: "{{ .Release.Name }}" - role: "master" + role: "master" replicas: {{ .Values.master.replicas }} template: metadata: @@ -56,15 +56,18 @@ spec: - name: {{ . }} {{- end}} {{- end }} + {{- if .Values.sysctlImage.enabled }} + ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: - name: sysctl image: {{ template "sysctl.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - command: ["sysctl", "-w", "vm.max_map_count=262144"] + command: ['sh', '-c', 'install_packages systemd && sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536'] securityContext: privileged: true + {{- end }} containers: - - name: {{ template "elasticsearch.master.fullname" . }} + - name: "elasticsearch" image: {{ template "elasticsearch.image" . }} {{- if .Values.securityContext.enabled }} securityContext: diff --git a/bitnami/elasticsearch/templates/master-svc.yaml b/bitnami/elasticsearch/templates/master-svc.yaml index e63cdab41..a8ad0123d 100644 --- a/bitnami/elasticsearch/templates/master-svc.yaml +++ b/bitnami/elasticsearch/templates/master-svc.yaml @@ -8,11 +8,22 @@ metadata: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} role: "master" +{{- with .Values.master.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: + type: {{ .Values.master.service.type | quote }} + {{- if and (eq .Values.master.service.type "LoadBalancer") .Values.master.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.master.service.loadBalancerIP }} + {{- end }} ports: - name: transport - port: 9300 + port: {{ .Values.master.service.port }} targetPort: transport + {{- if .Values.master.service.nodePort }} + nodePort: {{ .Values.master.service.nodePort }} + {{- end }} selector: app: {{ template "elasticsearch.name" . }} release: {{ .Release.Name | quote }} diff --git a/bitnami/elasticsearch/templates/metrics-deploy.yaml b/bitnami/elasticsearch/templates/metrics-deploy.yaml index 818ec95ee..f1349713e 100644 --- a/bitnami/elasticsearch/templates/metrics-deploy.yaml +++ b/bitnami/elasticsearch/templates/metrics-deploy.yaml @@ -34,7 +34,7 @@ spec: - name: {{ template "elasticsearch.metrics.fullname" . }} image: {{ template "metrics.image" . }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} - args: [ "-es.uri=http://{{ template "coordinating.fullname" . }}:{{ .Values.coordinating.service.port }}", "-es.all=true" ] + args: [ "-es.uri=http://{{ template "elasticsearch.coordinating.fullname" . }}:{{ .Values.coordinating.service.port }}", "-es.all=true" ] ports: - name: metrics containerPort: 9108 diff --git a/bitnami/elasticsearch/values-production.yaml b/bitnami/elasticsearch/values-production.yaml index 244b4a4cb..33358978a 100644 --- a/bitnami/elasticsearch/values-production.yaml +++ b/bitnami/elasticsearch/values-production.yaml @@ -1,15 +1,21 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Elasticsearch image version ## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ ## image: registry: docker.io repository: bitnami/elasticsearch - tag: 6.4.2-debian-9 + tag: 6.5.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## - pullPolicy: Always + pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ @@ -33,6 +39,23 @@ master: replicas: 3 heapSize: 128m antiAffinity: "soft" + service: + ## master-eligible service type + type: ClusterIP + ## Elasticsearch transport port + port: 9300 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -58,15 +81,17 @@ master: failureThreshold: 5 ## Image that performs the sysctl operation +## sysctlImage: + enabled: false registry: docker.io - repository: busybox + repository: bitnami/minideb tag: latest ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## - pullPolicy: Always + pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ @@ -95,9 +120,22 @@ coordinating: heapSize: 128m antiAffinity: "soft" service: + ## coordinating-only service type type: ClusterIP - ## Externally accessible elasticsearch REST API port + ## Elasticsearch REST API port port: 9200 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -189,6 +227,23 @@ ingest: replicas: 2 heapSize: 128m antiAffinity: "soft" + service: + ## ingest service type + type: ClusterIP + ## Elasticsearch transport port + port: 9300 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -219,8 +274,8 @@ metrics: image: registry: docker.io repository: bitnami/elasticsearch-exporter - tag: latest - pullPolicy: Always + tag: 1.0.2 + pullPolicy: IfNotPresent annotations: prometheus.io/scrape: "true" prometheus.io/port: "9108" diff --git a/bitnami/elasticsearch/values.yaml b/bitnami/elasticsearch/values.yaml index 34939af6f..d34dccabe 100644 --- a/bitnami/elasticsearch/values.yaml +++ b/bitnami/elasticsearch/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Elasticsearch image version ## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ ## image: registry: docker.io repository: bitnami/elasticsearch - tag: 6.4.2-debian-9 + tag: 6.5.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -18,9 +24,11 @@ image: # - myRegistrKeySecretName ## Image that performs the sysctl operation +## sysctlImage: + enabled: false registry: docker.io - repository: busybox + repository: bitnami/minideb tag: latest ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' @@ -50,6 +58,26 @@ master: replicas: 2 heapSize: 128m antiAffinity: "soft" + service: + ## master-eligible service type + type: ClusterIP + ## Elasticsearch transport port + port: 9300 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -95,9 +123,22 @@ coordinating: heapSize: 128m antiAffinity: "soft" service: + ## coordinating-only service type type: ClusterIP - ## Externally accessible elasticsearch REST API port + ## Elasticsearch REST API port port: 9200 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -189,6 +230,23 @@ ingest: replicas: 2 heapSize: 128m antiAffinity: "soft" + service: + ## ingest service type + type: ClusterIP + ## Elasticsearch transport port + port: 9300 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + # loadBalancerIP: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -219,7 +277,7 @@ metrics: image: registry: docker.io repository: bitnami/elasticsearch-exporter - tag: latest + tag: 1.0.2 pullPolicy: Always annotations: prometheus.io/scrape: "true" diff --git a/bitnami/etcd/Chart.yaml b/bitnami/etcd/Chart.yaml index f6b6513ad..ecead1217 100644 --- a/bitnami/etcd/Chart.yaml +++ b/bitnami/etcd/Chart.yaml @@ -1,5 +1,5 @@ name: etcd -version: 1.1.6 +version: 1.3.0 appVersion: 3.3.10 description: etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines keywords: diff --git a/bitnami/etcd/README.md b/bitnami/etcd/README.md index 574dc68e4..7424c84f9 100644 --- a/bitnami/etcd/README.md +++ b/bitnami/etcd/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the etcd chart and the | Parameter | Description | Default | |---------------------------------------|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | etcd image registry | `docker.io` | | `image.repository` | etcd Image name | `bitnami/etcd` | | `image.tag` | etcd Image tag | `{VERSION}` | @@ -101,6 +102,10 @@ The following tables lists the configurable parameters of the etcd chart and the | `readinessProbe.timeoutSeconds` | When the probe times out | 5 | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | +| `podAnnotations` | Annotations to be added to pods | {} | +| `metrics.enabled` | Enable prometheus to access etcd metrics endpoint | `false` | +| `metrics.podAnnotations` | Annotations for enabling prometheus to access the metrics endpoint | {`prometheus.io/scrape: "true",prometheus.io/port: "2379"`} | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/etcd/templates/_helpers.tpl b/bitnami/etcd/templates/_helpers.tpl index 23bf93b72..7477526cb 100644 --- a/bitnami/etcd/templates/_helpers.tpl +++ b/bitnami/etcd/templates/_helpers.tpl @@ -27,10 +27,23 @@ Return the proper etcd image name */}} {{- define "etcd.image" -}} {{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} -{{- end -}} {{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} {{/* Return the proper etcd peer protocol @@ -81,4 +94,4 @@ Return the proper etcdctl authentication options {{- if .Values.auth.client.enableAuthentication -}} {{- printf "%s" $caOption -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/bitnami/etcd/templates/statefulset.yaml b/bitnami/etcd/templates/statefulset.yaml index 31cd7ab2a..4574d3d93 100644 --- a/bitnami/etcd/templates/statefulset.yaml +++ b/bitnami/etcd/templates/statefulset.yaml @@ -21,12 +21,6 @@ spec: rollingUpdate: partition: {{ .Values.statefulset.rollingUpdatePartition }} {{- end }} - selector: - matchLabels: - app: {{ template "etcd.name" . }} - chart: {{ template "etcd.chart" . }} - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} template: metadata: name: "{{ template "etcd.fullname" . }}" @@ -35,6 +29,15 @@ spec: chart: {{ template "etcd.chart" . }} release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: +{{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} +{{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} +{{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: diff --git a/bitnami/etcd/values-production.yaml b/bitnami/etcd/values-production.yaml index e00caf201..fe039ac4a 100644 --- a/bitnami/etcd/values-production.yaml +++ b/bitnami/etcd/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami etcd image version ## ref: https://hub.docker.com/r/bitnami/etcd/tags/ ## image: registry: docker.io repository: bitnami/etcd - tag: 3.3.10-debian-9 + tag: 3.3.10 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -165,4 +171,15 @@ readinessProbe: periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6 - successThreshold: 1 \ No newline at end of file + successThreshold: 1 + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +metrics: + enabled: true + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "2379" diff --git a/bitnami/etcd/values.yaml b/bitnami/etcd/values.yaml index edf8ee6ec..96542a2e3 100644 --- a/bitnami/etcd/values.yaml +++ b/bitnami/etcd/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami etcd image version ## ref: https://hub.docker.com/r/bitnami/etcd/tags/ ## image: registry: docker.io repository: bitnami/etcd - tag: 3.3.10-debian-9 + tag: 3.3.10 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -165,4 +171,15 @@ readinessProbe: periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6 - successThreshold: 1 \ No newline at end of file + successThreshold: 1 + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +metrics: + enabled: false + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "2379" diff --git a/bitnami/external-dns/Chart.yaml b/bitnami/external-dns/Chart.yaml index 031302034..d90bcccbf 100644 --- a/bitnami/external-dns/Chart.yaml +++ b/bitnami/external-dns/Chart.yaml @@ -1,6 +1,6 @@ name: external-dns -version: 1.0.4 -appVersion: 0.5.7 +version: 1.1.2 +appVersion: 0.5.8 description: ExternalDNS is a Kubernetes addon that configures public DNS servers with information about exposed Kubernetes services to make them discoverable. keywords: - external-dns diff --git a/bitnami/external-dns/README.md b/bitnami/external-dns/README.md index 6eaa1efe1..653f60f37 100644 --- a/bitnami/external-dns/README.md +++ b/bitnami/external-dns/README.md @@ -48,6 +48,7 @@ The following table lists the configurable parameters of the external-dns chart | Parameter | Description | Default | | ------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | ExternalDNS image registry | `docker.io` | | `image.repository` | ExternalDNS Image name | `bitnami/external-dns` | | `image.tag` | ExternalDNS Image tag | `{VERSION}` | @@ -124,7 +125,23 @@ $ helm install --name my-release -f values.yaml bitnami/external-dns Find information about the requirements for each DNS provider on the link below: - - [ExternalDNS Tutorials](https://github.com/kubernetes-incubator/external-dns/tree/master/docs/tutorials) +- [ExternalDNS Tutorials](https://github.com/kubernetes-incubator/external-dns/tree/master/docs/tutorials) + +For instance, to install ExternalDNS on AWS, you need to: + +- Provide the K8s worker node which runs the cluster autoscaler with a minimum IAM policy (check [IAM permissions docs](https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/aws.md#iam-permissions) for more information). +- Setup a hosted zone on Route53 and annotate the Hosted Zone ID and its associated "nameservers" as described on [these docs](https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/aws.md#set-up-a-hosted-zone). +- Install ExternalDNS chart using the command below: + +> Note: replace the placeholder HOSTED_ZONE_NAME with your hosted zoned name. + +```bash +$ helm install --name my-release \ + --set provider=aws \ + --set aws.zoneType=public \ + --set domainFilters=HOSTED_ZONE_NAME \ + bitnami/external-dns +``` ## Upgrading diff --git a/bitnami/external-dns/templates/_helpers.tpl b/bitnami/external-dns/templates/_helpers.tpl index da4540e0e..739a89496 100644 --- a/bitnami/external-dns/templates/_helpers.tpl +++ b/bitnami/external-dns/templates/_helpers.tpl @@ -27,8 +27,22 @@ Return the proper external-dns image name */}} {{- define "external-dns.image" -}} {{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/bitnami/external-dns/values.yaml b/bitnami/external-dns/values.yaml index f1b613913..578bdfd9d 100755 --- a/bitnami/external-dns/values.yaml +++ b/bitnami/external-dns/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami external-dns image version ## ref: https://hub.docker.com/r/bitnami/external-dns/tags/ ## image: registry: docker.io repository: bitnami/external-dns - tag: 0.5.7-debian-9 + tag: 0.5.8 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -117,7 +123,7 @@ rbac: ## serviceAccountName: default ## RBAC API version - apiVersion: v1beta1 + apiVersion: v1beta1 ## Kubernetes Security Context ## https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ diff --git a/bitnami/jenkins/Chart.yaml b/bitnami/jenkins/Chart.yaml index f500bb0e5..a195d088f 100644 --- a/bitnami/jenkins/Chart.yaml +++ b/bitnami/jenkins/Chart.yaml @@ -1,6 +1,6 @@ name: jenkins -version: 1.1.3 -appVersion: 2.138.2 +version: 2.0.0 +appVersion: 2.138.3 description: The leading open source automation server keywords: - jenkins diff --git a/bitnami/jenkins/README.md b/bitnami/jenkins/README.md index d2eb1ca56..abd46d53a 100644 --- a/bitnami/jenkins/README.md +++ b/bitnami/jenkins/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Jenkins chart and | Parameter | Description | Default | |----------------------------|----------------------------------------|---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Jenkins image registry | `docker.io` | | `image.repository` | Jenkins Image name | `bitnami/jenkins` | | `image.tag` | Jenkins Image tag | `{VERSION}` | @@ -57,7 +58,13 @@ The following tables lists the configurable parameters of the Jenkins chart and | `jenkinsHome` | Jenkins home directory | `/opt/bitnami/jenkins/jenkins_home` | | `disableInitialization` | Allows to disable the initial Bitnami configuration for Jenkins | `no` | | `javaOpts` | Customize JVM parameters | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.storageClass` | PVC Storage Class for Jenkins volume | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | PVC Access Mode for Jenkins volume | `ReadWriteOnce` | diff --git a/bitnami/jenkins/templates/NOTES.txt b/bitnami/jenkins/templates/NOTES.txt index fb68e75d3..b9e6d5f51 100644 --- a/bitnami/jenkins/templates/NOTES.txt +++ b/bitnami/jenkins/templates/NOTES.txt @@ -3,23 +3,25 @@ 1. Get the Jenkins URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "Jenkins URL: http://$NODE_IP:$NODE_PORT/" -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Jenkins URL: http://$SERVICE_IP/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "Jenkins URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + +{{- else if contains "ClusterIP" .Values.service.type }} echo "Jenkins URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:{{ .Values.service.port }} {{- end }} diff --git a/bitnami/jenkins/templates/_helpers.tpl b/bitnami/jenkins/templates/_helpers.tpl index f0d83d2ed..c20d44cd3 100644 --- a/bitnami/jenkins/templates/_helpers.tpl +++ b/bitnami/jenkins/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Jenkins image name +*/}} +{{- define "jenkins.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/jenkins/templates/deployment.yaml b/bitnami/jenkins/templates/deployment.yaml index 4f48cba70..3c06e9136 100644 --- a/bitnami/jenkins/templates/deployment.yaml +++ b/bitnami/jenkins/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "jenkins.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: JENKINS_USERNAME diff --git a/bitnami/jenkins/templates/svc.yaml b/bitnami/jenkins/templates/svc.yaml index 6736e0476..2c712f3f2 100644 --- a/bitnami/jenkins/templates/svc.yaml +++ b/bitnami/jenkins/templates/svc.yaml @@ -8,13 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/jenkins/values.yaml b/bitnami/jenkins/values.yaml index 1783fa7fc..d0cdb8279 100644 --- a/bitnami/jenkins/values.yaml +++ b/bitnami/jenkins/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Jenkins image version ## ref: https://hub.docker.com/r/bitnami/jenkins/tags/ ## image: registry: docker.io repository: bitnami/jenkins - tag: 2.138.2-debian-9 + tag: 2.138.3 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -43,7 +49,24 @@ disableInitialization: no ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ diff --git a/bitnami/kafka/Chart.yaml b/bitnami/kafka/Chart.yaml index 9fcf01928..ff873a113 100644 --- a/bitnami/kafka/Chart.yaml +++ b/bitnami/kafka/Chart.yaml @@ -1,6 +1,6 @@ name: kafka -version: 1.0.3 -appVersion: 2.0.0 +version: 1.2.0 +appVersion: 2.0.1 description: Apache Kafka is a distributed streaming platform. keywords: - kafka diff --git a/bitnami/kafka/README.md b/bitnami/kafka/README.md index a201726f0..ced6bab9b 100644 --- a/bitnami/kafka/README.md +++ b/bitnami/kafka/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Kafka chart and th | Parameter | Description | Default | |----------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Kafka image registry | `docker.io` | | `image.repository` | Kafka Image name | `bitnami/kafka` | | `image.tag` | Kafka Image tag | `{VERSION}` | @@ -57,8 +58,8 @@ The following tables lists the configurable parameters of the Kafka chart and th | `replicaCount` | Number of Kafka nodes | `1` | | `config` | Configuration file for Kafka | `nil` | | `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` | -| `listeners` | The address the socket server listens on. | `nil` | -| `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` | +| `listeners` | The address the socket server listens on. | `nil` | +| `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` | | `brokerId` | ID of the Kafka node | `-1` | | `deleteTopicEnable` | Switch to enable topic deletion or not. | `false` | | `heapOpts` | Kafka's Java Heap size. | `-Xmx1024m -Xms1024m` | diff --git a/bitnami/kafka/requirements.lock b/bitnami/kafka/requirements.lock index bed78e475..ecce16c86 100644 --- a/bitnami/kafka/requirements.lock +++ b/bitnami/kafka/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: zookeeper repository: https://charts.bitnami.com/bitnami - version: 0.0.1 -digest: sha256:5de3747cef6f8cc34f166277b81f8ccea2c8849caadf133c1d9bc7da5fe71607 -generated: 2018-06-14T16:25:45.420195607+02:00 + version: 1.1.0 +digest: sha256:eacfe6cdc916044d9b3594d6a9b2f265593c50f41565df0689f6e0f612d9dec6 +generated: 2018-10-16T08:55:34.669048+02:00 diff --git a/bitnami/kafka/requirements.yaml b/bitnami/kafka/requirements.yaml index 6dd090905..68a6d6fb6 100644 --- a/bitnami/kafka/requirements.yaml +++ b/bitnami/kafka/requirements.yaml @@ -1,5 +1,5 @@ dependencies: - name: zookeeper - version: 0.x.x + version: 1.x.x repository: https://charts.bitnami.com/bitnami condition: zookeeper.enabled diff --git a/bitnami/kafka/templates/_helpers.tpl b/bitnami/kafka/templates/_helpers.tpl index a4f76155e..611dfeb9e 100644 --- a/bitnami/kafka/templates/_helpers.tpl +++ b/bitnami/kafka/templates/_helpers.tpl @@ -27,8 +27,22 @@ Return the proper Kafka image name */}} {{- define "kafka.image" -}} {{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -55,5 +69,5 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this */}} {{- define "kafka.zookeeper.fullname" -}} {{- $name := default "zookeeper" .Values.zookeeper.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} +{{- end -}} diff --git a/bitnami/kafka/values-production.yaml b/bitnami/kafka/values-production.yaml index 2d1d7ede6..8bd766a2a 100644 --- a/bitnami/kafka/values-production.yaml +++ b/bitnami/kafka/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Kafka image version ## ref: https://hub.docker.com/r/bitnami/kafka/tags/ ## image: registry: docker.io repository: bitnami/kafka - tag: 2.0.0-debian-9 + tag: 2.0.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -319,6 +325,11 @@ metrics: - kafka.network:* - kafka.log:* +## +## Zookeeper chart configuration +## +## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml +## zookeeper: enabled: true metrics: diff --git a/bitnami/kafka/values.yaml b/bitnami/kafka/values.yaml index 471975df2..dfff300cf 100644 --- a/bitnami/kafka/values.yaml +++ b/bitnami/kafka/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Kafka image version ## ref: https://hub.docker.com/r/bitnami/kafka/tags/ ## image: registry: docker.io repository: bitnami/kafka - tag: 2.0.0-debian-9 + tag: 2.0.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -319,6 +325,11 @@ metrics: - kafka.network:* - kafka.log:* +## +## Zookeeper chart configuration +## +## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml +## zookeeper: enabled: true diff --git a/bitnami/kubeapps/Chart.yaml b/bitnami/kubeapps/Chart.yaml index 791872643..e5adf176d 100644 --- a/bitnami/kubeapps/Chart.yaml +++ b/bitnami/kubeapps/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: kubeapps -version: 0.6.1 -appVersion: v1.0.0-beta.2 +version: 1.0.0 +appVersion: v1.0.0 description: Kubeapps is a dashboard for your Kubernetes cluster that makes it easy to deploy and manage applications in your cluster using Helm icon: https://raw.githubusercontent.com/kubeapps/kubeapps/master/docs/img/logo.png keywords: @@ -17,3 +17,5 @@ maintainers: email: containers@bitnami.com - name: prydonius email: adnan@bitnami.com +# 2.10+ required because we need the install-crd hook type +tillerVersion: ">=2.10.0" diff --git a/bitnami/kubeapps/README.md b/bitnami/kubeapps/README.md index a49e06fcd..3abf2d372 100644 --- a/bitnami/kubeapps/README.md +++ b/bitnami/kubeapps/README.md @@ -27,7 +27,7 @@ It also packages the [Bitnami MongoDB chart](https://github.com/helm/charts/tree ## Prerequisites - Kubernetes 1.8+ (tested with Azure Kubernetes Service, Google Kubernetes Engine, minikube and Docker for Desktop Kubernetes) -- Helm 2.9.1+ +- Helm 2.10.0+ - PV provisioner support in the underlying infrastructure - Administrative access to the cluster to create and update RBAC ClusterRoles @@ -115,6 +115,7 @@ apprepository: EOF $ helm install --name kubeapps --namespace kubeapps bitnami/kubeapps -f custom-values.yaml ``` + ### Configuring connection to a custom namespace Tiller instance By default, Kubeapps connects to the Tiller Service in the `kube-system` namespace, the default install location for Helm. @@ -170,7 +171,7 @@ To enable ingress integration, please set `ingress.enabled` to `true` ##### Hosts -Most likely you will only want to have one hostname that maps to this Kubeapps installation, however, it is possible to have more than one host. To facilitate this, the `ingress.hosts` object is an array. +Most likely you will only want to have one hostname that maps to this Kubeapps installation, however, it is possible to have more than one host. To facilitate this, the `ingress.hosts` object is an array. ##### Annotations @@ -178,7 +179,18 @@ For annotations, please see [this document](https://github.com/kubernetes/ingres ##### TLS -TLS can be configured using the `ingress.tls` object in the same format that the Kubernetes Ingress requests. Please see [this example](https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tls) for more information. +TLS can be configured using setting the `ingress.hosts[].tls` boolean of the corresponding hostname to true, then you can choose the TLS secret name setting `ingress.hosts[].tlsSecret`. Please see [this example](https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tls) for more information. + +You can provide your own certificates using the `ingress.secrets` object. If your cluster has a [cert-manager](https://github.com/jetstack/cert-manager) add-on to automate the management and issuance of TLS certificates, set `ingress.hosts[].certManager` boolean to true to enable the corresponding annotations for cert-manager as shown in the example below: + +```console +helm install --name kubeapps --namespace kubeapps bitnami/kubeapps \ + --set ingress.enabled=true \ + --set ingress.certManager=true \ + --set ingress.hosts[0].name=kubeapps.custom.domain \ + --set ingress.hosts[0].tls=true \ + --set ingress.hosts[0].tlsSecret=kubeapps-tls +``` ## Troubleshooting @@ -190,7 +202,15 @@ If during installation you run into an error similar to: Error: release kubeapps failed: clusterroles.rbac.authorization.k8s.io "kubeapps-apprepository-controller" is forbidden: attempt to grant extra privileges: [{[get] [batch] [cronjobs] [] []... ``` -It is possible that your cluster does not have Role Based Access Control (RBAC) fully configured. In which case you should perform the chart installation by setting `rbac.create=false`: +This usually is an indication that Tiller was not installed with enough permissions to create the resources by Kubeapps. In order to install Kubeapps, you will need to install Tiller with elevated permissions (e.g. as a cluster-admin). For example: + +``` +kubectl -n kube-system create sa tiller +kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller +helm init --service-account tiller +``` + +It is also possible, though less common, that your cluster does not have Role Based Access Control (RBAC) enabled. If this is the case you should perform the chart installation by setting `rbac.create=false`: ```console $ helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set rbac.create=false diff --git a/bitnami/kubeapps/requirements.lock b/bitnami/kubeapps/requirements.lock index 861eb9fe7..fda687ef0 100644 --- a/bitnami/kubeapps/requirements.lock +++ b/bitnami/kubeapps/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mongodb repository: https://kubernetes-charts.storage.googleapis.com - version: 4.3.7 + version: 4.9.0 digest: sha256:415440e73af7d4b02a10a15f28bb2fc095cbdffdc2e1676d76e0f0eaa1632d50 -generated: 2018-09-28T12:48:52.725939266+02:00 +generated: 2018-11-14T11:54:24.338893216Z diff --git a/bitnami/kubeapps/templates/NOTES.txt b/bitnami/kubeapps/templates/NOTES.txt index e3ca5b433..9cdd3f4be 100644 --- a/bitnami/kubeapps/templates/NOTES.txt +++ b/bitnami/kubeapps/templates/NOTES.txt @@ -14,11 +14,11 @@ To access Kubeapps from outside your K8s cluster, follow the steps below: 1. Get the Kubeapps URL and associate Kubeapps hostname to your cluster external IP: -{{- range .Values.ingress.hosts }} export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters - echo "Kubeapps URL: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}" - echo "$CLUSTER_IP {{ . }}" | sudo tee -a /etc/hosts -{{- end }} + {{- range .Values.ingress.hosts }} + echo "Kubeapps URL: http{{ if .tls }}s{{ end }}://{{ .name }}{{ default "/" .path }}" + echo "$CLUSTER_IP {{ .name }}" | sudo tee -a /etc/hosts + {{- end }} {{- else }} diff --git a/bitnami/kubeapps/templates/_helpers.tpl b/bitnami/kubeapps/templates/_helpers.tpl index 7f8b5037b..b632ae049 100644 --- a/bitnami/kubeapps/templates/_helpers.tpl +++ b/bitnami/kubeapps/templates/_helpers.tpl @@ -28,7 +28,22 @@ If release name contains chart name it will be used as a full name. Render image reference */}} {{- define "kubeapps.image" -}} -{{ .registry }}/{{ .repository }}:{{ .tag }} +{{- $image := index . 0 -}} +{{- $global := index . 1 -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if $global -}} + {{- if $global.imageRegistry -}} + {{ $global.imageRegistry }}/{{ $image.repository }}:{{ $image.tag }} + {{- else -}} + {{ $image.registry }}/{{ $image.repository }}:{{ $image.tag }} + {{- end -}} +{{- else -}} + {{ $image.registry }}/{{ $image.repository }}:{{ $image.tag }} +{{- end -}} {{- end -}} {{/* diff --git a/bitnami/kubeapps/templates/apprepositories.yaml b/bitnami/kubeapps/templates/apprepositories.yaml new file mode 100644 index 000000000..d279fd9be --- /dev/null +++ b/bitnami/kubeapps/templates/apprepositories.yaml @@ -0,0 +1,17 @@ +{{- range .Values.apprepository.initialRepos }} +apiVersion: kubeapps.com/v1alpha1 +kind: AppRepository +metadata: + name: {{ .name }} + labels: + app: {{ template "kubeapps.apprepository.fullname" $ }} + chart: {{ template "kubeapps.chart" $ }} + release: {{ $.Release.Name }} + heritage: {{ $.Release.Service }} +annotations: + helm.sh/hook: pre-install +spec: + type: helm + url: {{ .url }} +--- +{{ end -}} diff --git a/bitnami/kubeapps/templates/apprepository-crd.yaml b/bitnami/kubeapps/templates/apprepository-crd.yaml index 36aeeb8fa..8f4132481 100644 --- a/bitnami/kubeapps/templates/apprepository-crd.yaml +++ b/bitnami/kubeapps/templates/apprepository-crd.yaml @@ -6,7 +6,7 @@ kind: CustomResourceDefinition metadata: name: apprepositories.kubeapps.com annotations: - "helm.sh/resource-policy": keep + "helm.sh/hook": crd-install labels: app: {{ template "kubeapps.apprepository.fullname" . }} chart: {{ template "kubeapps.chart" . }} diff --git a/bitnami/kubeapps/templates/apprepository-deployment.yaml b/bitnami/kubeapps/templates/apprepository-deployment.yaml index b5f090fc1..579a11c07 100644 --- a/bitnami/kubeapps/templates/apprepository-deployment.yaml +++ b/bitnami/kubeapps/templates/apprepository-deployment.yaml @@ -22,12 +22,13 @@ spec: serviceAccountName: {{ template "kubeapps.apprepository.fullname" . }} containers: - name: controller - image: {{ template "kubeapps.image" .Values.apprepository.image }} + image: {{ template "kubeapps.image" (list .Values.apprepository.image .Values.global) }} command: - /apprepository-controller args: - --logtostderr - - --repo-sync-image={{ template "kubeapps.image" .Values.apprepository.syncImage }} + - --user-agent-comment=kubeapps/{{ .Chart.AppVersion }} + - --repo-sync-image={{ template "kubeapps.image" (list .Values.apprepository.syncImage .Values.global) }} - --namespace={{ .Release.Namespace }} - --mongo-url={{ template "kubeapps.mongodb.fullname" . }} - --mongo-secret-name={{ .Values.mongodb.existingSecret }} diff --git a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-config.yaml b/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-config.yaml deleted file mode 100644 index 400eabe58..000000000 --- a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-config.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - annotations: - helm.sh/hook: post-install - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - apprepositories.yaml: |- - {{- range .Values.apprepository.initialRepos }} - apiVersion: kubeapps.com/v1alpha1 - kind: AppRepository - metadata: - name: {{ .name }} - labels: - app: {{ template "kubeapps.apprepository.fullname" $ }} - chart: {{ template "kubeapps.chart" $ }} - release: {{ $.Release.Name }} - heritage: {{ $.Release.Service }} - spec: - type: helm - url: {{ .url }} - --- - {{ end -}} diff --git a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-rbac.yaml b/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-rbac.yaml deleted file mode 100644 index dd1d7fcc2..000000000 --- a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-rbac.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: Role -metadata: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - annotations: - helm.sh/hook: post-install - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -rules: -- apiGroups: - - kubeapps.com - resources: - - apprepositories - verbs: - - get - - create - - delete ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: RoleBinding -metadata: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - annotations: - helm.sh/hook: post-install - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} -subjects: -- kind: ServiceAccount - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - namespace: {{ .Release.Namespace }} -{{- end -}} diff --git a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-serviceaccount.yaml b/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-serviceaccount.yaml deleted file mode 100644 index fb5527f58..000000000 --- a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap-serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - annotations: - helm.sh/hook: post-install - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} diff --git a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap.yaml b/bitnami/kubeapps/templates/apprepository-jobs-bootstrap.yaml deleted file mode 100644 index 91a1d3fd0..000000000 --- a/bitnami/kubeapps/templates/apprepository-jobs-bootstrap.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - annotations: - helm.sh/hook: post-install - helm.sh/hook-delete-policy: hook-succeeded - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - template: - metadata: - labels: - app: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - release: {{ .Release.Name }} - spec: - containers: - - name: kubectl - image: {{ template "kubeapps.image" .Values.hooks.image }} - command: - - kubectl - - apply - - -f - - /tmp/apprepositories/apprepositories.yaml - volumeMounts: - - mountPath: /tmp/apprepositories - name: apprepositories-config - volumes: - - name: apprepositories-config - configMap: - name: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - restartPolicy: OnFailure - serviceAccountName: {{ template "kubeapps.apprepository-jobs-bootstrap.fullname" . }} - {{- with .Values.hooks.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.hooks.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with.Values.hooks.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} diff --git a/bitnami/kubeapps/templates/apprepository-jobs-cleanup.yaml b/bitnami/kubeapps/templates/apprepository-jobs-cleanup.yaml index 179a54bd6..abe37f071 100644 --- a/bitnami/kubeapps/templates/apprepository-jobs-cleanup.yaml +++ b/bitnami/kubeapps/templates/apprepository-jobs-cleanup.yaml @@ -20,13 +20,13 @@ spec: spec: containers: - name: kubectl - image: {{ template "kubeapps.image" .Values.hooks.image }} + image: {{ template "kubeapps.image" (list .Values.hooks.image .Values.global) }} command: - kubectl - delete - apprepositories.kubeapps.com - -n - - {{ .Release.Namespace }} + - {{ .Release.Namespace }} - --all restartPolicy: OnFailure serviceAccountName: {{ template "kubeapps.apprepository-jobs-cleanup.fullname" . }} diff --git a/bitnami/kubeapps/templates/apprepository-rbac.yaml b/bitnami/kubeapps/templates/apprepository-rbac.yaml index 3646b2c24..8e65e8bf9 100644 --- a/bitnami/kubeapps/templates/apprepository-rbac.yaml +++ b/bitnami/kubeapps/templates/apprepository-rbac.yaml @@ -1,44 +1,4 @@ {{- if .Values.rbac.create -}} -# Need a cluster role because client-go v5.0.1 does not support namespaced -# informers -# TODO: remove when we update to client-go v6.0.0 -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: {{ template "kubeapps.apprepository.fullname" . }} - labels: - app: {{ template "kubeapps.apprepository.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -rules: -- apiGroups: - - batch - resources: - - cronjobs - verbs: - - get - - list - - watch ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: {{ template "kubeapps.apprepository.fullname" . }} - labels: - app: {{ template "kubeapps.apprepository.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "kubeapps.apprepository.fullname" . }} -subjects: -- kind: ServiceAccount - name: {{ template "kubeapps.apprepository.fullname" . }} - namespace: {{ .Release.Namespace }} ---- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: Role metadata: diff --git a/bitnami/kubeapps/templates/chartsvc-deployment.yaml b/bitnami/kubeapps/templates/chartsvc-deployment.yaml index d25a726df..9d17dcff4 100644 --- a/bitnami/kubeapps/templates/chartsvc-deployment.yaml +++ b/bitnami/kubeapps/templates/chartsvc-deployment.yaml @@ -21,7 +21,7 @@ spec: spec: containers: - name: chartsvc - image: {{ template "kubeapps.image" .Values.chartsvc.image }} + image: {{ template "kubeapps.image" (list .Values.chartsvc.image .Values.global) }} command: - /chartsvc args: diff --git a/bitnami/kubeapps/templates/dashboard-deployment.yaml b/bitnami/kubeapps/templates/dashboard-deployment.yaml index 58ba21536..0635626fc 100644 --- a/bitnami/kubeapps/templates/dashboard-deployment.yaml +++ b/bitnami/kubeapps/templates/dashboard-deployment.yaml @@ -23,7 +23,7 @@ spec: spec: containers: - name: dashboard - image: {{ template "kubeapps.image" .Values.dashboard.image }} + image: {{ template "kubeapps.image" (list .Values.dashboard.image .Values.global) }} livenessProbe: {{ toYaml .Values.dashboard.livenessProbe | indent 10 }} readinessProbe: diff --git a/bitnami/kubeapps/templates/ingress.yaml b/bitnami/kubeapps/templates/ingress.yaml index b78a7ad58..3d184924b 100644 --- a/bitnami/kubeapps/templates/ingress.yaml +++ b/bitnami/kubeapps/templates/ingress.yaml @@ -1,38 +1,37 @@ {{- if .Values.ingress.enabled -}} -{{- $fullName := include "kubeapps.fullname" . -}} -{{- $ingressPath := .Values.ingress.path -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: {{ $fullName }} + name: {{ template "kubeapps.fullname" . }} labels: - app: {{ include "kubeapps.name" . }} - chart: {{ include "kubeapps.chart" . }} + app: {{ template "kubeapps.name" . }} + chart: {{ template "kubeapps.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- if .Values.ingress.certManager }} + kubernetes.io/tls-acme: "true" + {{- end }} + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} rules: {{- range .Values.ingress.hosts }} - - host: {{ . | quote }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $fullName }} - servicePort: http + - host: {{ .name }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: {{ template "kubeapps.fullname" $ }} + servicePort: http + {{- end }} + tls: + {{- range .Values.ingress.hosts }} + {{- if .tls }} + - hosts: + - {{ .name }} + secretName: {{ .tlsSecret }} + {{- end }} {{- end }} {{- end }} diff --git a/bitnami/kubeapps/templates/kubeapps-frontend-config.yaml b/bitnami/kubeapps/templates/kubeapps-frontend-config.yaml index 1ddbadfd9..c40747ab2 100644 --- a/bitnami/kubeapps/templates/kubeapps-frontend-config.yaml +++ b/bitnami/kubeapps/templates/kubeapps-frontend-config.yaml @@ -38,6 +38,12 @@ data: # Hide Www-Authenticate to prevent it triggering a basic auth prompt in # the browser with some clusters proxy_hide_header Www-Authenticate; + + # Keep the connection open with the API server even if idle (the default is 60 seconds) + # Setting it to 1 hour which should be enough for our current use case of deploying/upgrading apps + # If we enable other use-cases in the future we might need to bump this value + # More info here https://github.com/kubeapps/kubeapps/issues/766 + proxy_read_timeout 1h; } location /api/chartsvc { diff --git a/bitnami/kubeapps/templates/kubeapps-frontend-deployment.yaml b/bitnami/kubeapps/templates/kubeapps-frontend-deployment.yaml index 99b1ac3ce..c8fc58133 100644 --- a/bitnami/kubeapps/templates/kubeapps-frontend-deployment.yaml +++ b/bitnami/kubeapps/templates/kubeapps-frontend-deployment.yaml @@ -23,7 +23,7 @@ spec: spec: containers: - name: nginx - image: {{ template "kubeapps.image" .Values.frontend.image }} + image: {{ template "kubeapps.image" (list .Values.frontend.image .Values.global) }} livenessProbe: {{ toYaml .Values.frontend.livenessProbe | indent 10 }} readinessProbe: diff --git a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-rbac.yaml b/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-rbac.yaml deleted file mode 100644 index 73880ffe2..000000000 --- a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-rbac.yaml +++ /dev/null @@ -1,57 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: Role -metadata: - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - annotations: - helm.sh/hook: post-upgrade - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -rules: -- apiGroups: - - kubeapps.com - resources: - - apprepositories - verbs: - - get - - create - - patch - - delete -- apiGroups: - - "" - resources: - - secrets - - pods - verbs: - - get - - list - - create - - delete ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: RoleBinding -metadata: - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - annotations: - helm.sh/hook: post-upgrade - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} -subjects: -- kind: ServiceAccount - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - namespace: {{ .Release.Namespace }} -{{- end -}} diff --git a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-serviceaccount.yaml b/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-serviceaccount.yaml deleted file mode 100644 index db65cc157..000000000 --- a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade-serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - annotations: - helm.sh/hook: post-upgrade - helm.sh/hook-delete-policy: hook-succeeded - helm.sh/hook-weight: "-10" - labels: - app: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} diff --git a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade.yaml b/bitnami/kubeapps/templates/kubeapps-jobs-upgrade.yaml deleted file mode 100644 index 885320284..000000000 --- a/bitnami/kubeapps/templates/kubeapps-jobs-upgrade.yaml +++ /dev/null @@ -1,58 +0,0 @@ -# This is a temporary upgrade hook for installating a version prior -# to 0.6 since the process of creating the mongodb secret changed -# It should be removed at https://github.com/kubeapps/kubeapps/issues/699 -# This Job creates the mongodb credentials secret if it doesn't exists -# and it resyncs the existing apprepositories. -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - annotations: - helm.sh/hook: post-upgrade - helm.sh/hook-delete-policy: hook-succeeded - labels: - app: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - chart: {{ template "kubeapps.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - template: - metadata: - labels: - app: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - release: {{ .Release.Name }} - spec: - containers: - - name: kubectl - image: {{ template "kubeapps.image" .Values.hooks.image }} - command: - - /bin/sh - - -c - args: - - |- - # Recreate MongoDB secret if doesn't exists (happens for chart versions < 0.5.2) - if kubectl get secrets -n {{ .Release.Namespace }} {{ .Values.mongodb.existingSecret }}; then - # Secret exists, do nothing - echo "MongoDB secret found" - else - # Secret doesn't exists, create it and restart mongodb - kubectl create secret generic -n {{ .Release.Namespace }} {{ .Values.mongodb.existingSecret }} --from-literal mongodb-root-password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1` - kubectl delete pods -n {{ .Release.Namespace }} -l app=mongodb,release={{ .Release.Name }} - kubectl rollout status -n {{ .Release.Namespace }} deployment/{{ .Release.Name }}-mongodb - # Re-sync repositories reseting resyncRequests - kubectl get apprepositories -o=name -n kubeapps {{ .Release.Namespace }} | xargs kubectl patch $1 -n {{ .Release.Namespace }} --type merge -p '{ "spec": { "resyncRequests": 0 } }' - fi - restartPolicy: OnFailure - serviceAccountName: {{ template "kubeapps.kubeapps-jobs-upgrade.fullname" . }} - {{- with .Values.hooks.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.hooks.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.hooks.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} diff --git a/bitnami/kubeapps/templates/mongodb-jobs-cleanup.yaml b/bitnami/kubeapps/templates/mongodb-jobs-cleanup.yaml index 2214c9548..2701d036d 100644 --- a/bitnami/kubeapps/templates/mongodb-jobs-cleanup.yaml +++ b/bitnami/kubeapps/templates/mongodb-jobs-cleanup.yaml @@ -19,7 +19,7 @@ spec: spec: containers: - name: kubectl - image: {{ template "kubeapps.image" .Values.hooks.image }} + image: {{ template "kubeapps.image" (list .Values.hooks.image .Values.global) }} command: - /bin/sh args: diff --git a/bitnami/kubeapps/templates/tiller-proxy-deployment.yaml b/bitnami/kubeapps/templates/tiller-proxy-deployment.yaml index e690f9570..70ac060b1 100644 --- a/bitnami/kubeapps/templates/tiller-proxy-deployment.yaml +++ b/bitnami/kubeapps/templates/tiller-proxy-deployment.yaml @@ -22,11 +22,12 @@ spec: serviceAccountName: {{ template "kubeapps.tiller-proxy.fullname" . }} containers: - name: proxy - image: {{ template "kubeapps.image" .Values.tillerProxy.image }} + image: {{ template "kubeapps.image" (list .Values.tillerProxy.image .Values.global) }} command: - /proxy args: - --host={{ .Values.tillerProxy.host }} + - --user-agent-comment=kubeapps/{{ .Chart.AppVersion }} {{- if .Values.tillerProxy.tls }} - --tls {{- if .Values.tillerProxy.tls.verify }} @@ -53,7 +54,7 @@ spec: {{- if .Values.tillerProxy.tls }} volumes: - name: tiller-certs - secret: + secret: secretName: {{ template "kubeapps.tiller-proxy.fullname" . }} {{- end }} {{- with .Values.tillerProxy.nodeSelector }} diff --git a/bitnami/kubeapps/templates/tls-secrets.yaml b/bitnami/kubeapps/templates/tls-secrets.yaml new file mode 100644 index 000000000..b7d959d28 --- /dev/null +++ b/bitnami/kubeapps/templates/tls-secrets.yaml @@ -0,0 +1,17 @@ +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} + labels: + app: {{ template "kubeapps.name" $ }} + chart: {{ template "kubeapps.chart" $ }} + release: {{ $.Release.Name }} + heritage: {{ $.Release.Service }} +type: kubernetes.io/tls +data: + tls.crt: {{ .certificate | b64enc }} + tls.key: {{ .key | b64enc }} +{{- end }} +{{- end }} diff --git a/bitnami/kubeapps/values.yaml b/bitnami/kubeapps/values.yaml index 58a6cfe46..3dee71232 100644 --- a/bitnami/kubeapps/values.yaml +++ b/bitnami/kubeapps/values.yaml @@ -1,16 +1,53 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +# global: +# imageRegistry: + # The frontend service is the main reverse proxy used to access the Kubeapps UI # To expose Kubeapps externally either configure the ingress object below or # set frontend.service.type=LoadBalancer in the frontend configuration. +# ref: http://kubernetes.io/docs/user-guide/ingress/ +# ingress: + # Set to true to enable ingress record generation enabled: false - annotations: {} - path: / + + # Set this to true in order to add the corresponding annotations for cert-manager + certManager: false + + # Ingress annotations done as key:value pairs + # For a full list of possible ingress annotations, please see + # ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/annotations.md + # + # If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + annotations: + # kubernetes.io/ingress.class: nginx + + # The list of hostnames to be covered with this ingress record. + # Most likely this will be just one host, but in the event more hosts are needed, this is an array hosts: - - kubeapps.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local + - name: kubeapps.local + path: / + + # Set this to true in order to enable TLS on the ingress record + tls: false + + ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS + tlsSecret: kubeapps.local-tls + + secrets: + # If you're providing your own certificates, please use this to add the certificates as secrets + # key and certificate should start with -----BEGIN CERTIFICATE----- or + # -----BEGIN RSA PRIVATE KEY----- + # + # name should line up with a tlsSecret set further up + # If you're using cert-manager, this is unneeded, as it will create the secret for you if it is not set + # + # It is also possible to create and manage the certificates outside of this helm chart + # Please see README.md for more information + # - name: kubeapps.local-tls + # key: + # certificate: frontend: replicaCount: 2 @@ -55,12 +92,12 @@ apprepository: image: registry: docker.io repository: kubeapps/apprepository-controller - tag: v1.0.0-beta.2 + tag: v1.0.0 # Image used to perform chart repository syncs syncImage: - registry: docker.io - repository: kubeapps/chart-repo - tag: v1.0.0-beta.2 + registry: quay.io + repository: helmpack/chart-repo + tag: v1.0.2 initialRepos: - name: stable url: https://kubernetes-charts.storage.googleapis.com @@ -101,7 +138,7 @@ tillerProxy: image: registry: docker.io repository: kubeapps/tiller-proxy - tag: v1.0.0-beta.2 + tag: v1.0.0 service: port: 8080 host: tiller-deploy.kube-system:44134 @@ -126,9 +163,9 @@ tillerProxy: chartsvc: replicaCount: 2 image: - registry: docker.io - repository: kubeapps/chartsvc - tag: v1.0.0-beta.2 + registry: quay.io + repository: helmpack/chartsvc + tag: v1.0.2 service: port: 8080 # https://github.com/kubeapps/kubeapps/issues/478#issuecomment-422979262 @@ -163,7 +200,7 @@ dashboard: image: registry: docker.io repository: kubeapps/dashboard - tag: v1.0.0-beta.2 + tag: v1.0.0 service: port: 8080 livenessProbe: @@ -190,6 +227,11 @@ dashboard: tolerations: [] affinity: {} +## +## MongoDB chart configuration +## +## https://github.com/helm/charts/blob/master/stable/mongodb/values.yaml +## mongodb: # Kubeapps uses MongoDB as a cache and persistence is not required persistence: diff --git a/bitnami/mean/Chart.yaml b/bitnami/mean/Chart.yaml index d0f9959fa..7a9929808 100644 --- a/bitnami/mean/Chart.yaml +++ b/bitnami/mean/Chart.yaml @@ -1,6 +1,6 @@ name: mean -version: 4.1.0 -appVersion: 3.6.4 +version: 4.2.3 +appVersion: 4.6.2 description: MEAN is a free and open-source JavaScript software stack for building dynamic web sites and web applications. The MEAN stack is MongoDB, Express.js, Angular, and Node.js. Because all components of the MEAN stack support programs written in JavaScript, MEAN applications can be written in one language for both server-side and client-side execution environments. keywords: - node diff --git a/bitnami/mean/README.md b/bitnami/mean/README.md index fa943ad18..1783ab2f8 100644 --- a/bitnami/mean/README.md +++ b/bitnami/mean/README.md @@ -51,15 +51,16 @@ The following table lists the configurable parameters of the MEAN chart and thei | Parameter | Description | Default | |-----------------------------------------|-----------------------------------------------------------|-----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | NodeJS image registry | `docker.io` | -| `image.repository` | NodeJS Image name | `bitnami/node` | -| `image.tag` | NodeJS Image tag | `{VERSION}` | +| `image.repository` | NodeJS image name | `bitnami/node` | +| `image.tag` | NodeJS image tag | `{VERSION}` | | `image.pullPolicy` | NodeJS image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | -| `gitImage.registry` | Git image registry | `docker.io` | -| `gitImage.repository` | Git Image name | `alpine/git` | -| `gitImage.tag` | Git Image tag | `latest` | -| `gitImage.pullPolicy` | Git image pull policy | IfNotPresent` | +| `git.registry` | Git image registry | `docker.io` | +| `git.repository` | Git image name | `bitnami/git` | +| `git.tag` | Git image tag | `latest` | +| `git.pullPolicy` | Git image pull policy | IfNotPresent` | | `repository` | Repo of the application | `https://github.com/bitnami/sample-mean.git` | | `revision` | Revision to checkout | `master` | | `replicas` | Number of replicas for the application | `1` | @@ -217,7 +218,7 @@ ingress: 4. Deploy the helm chart: ``` - $ helm install --name node-app --set mongodb.install=false,externaldb.broker.serviceInstanceName=azure-mongodb-instance bitnami/mean + $ helm install --name node-app --set mongodb.install=false,externaldb.broker.serviceInstanceName=azure-mongodb-instance,externaldb.ssl=true bitnami/mean ``` Once the instance has been provisioned in Azure, a new secret should have been automatically created with the connection parameters for your application. diff --git a/bitnami/mean/requirements.lock b/bitnami/mean/requirements.lock index 5ba31ec45..c6c9ab468 100644 --- a/bitnami/mean/requirements.lock +++ b/bitnami/mean/requirements.lock @@ -1,9 +1,9 @@ dependencies: - name: mongodb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 4.2.3 + version: 4.6.2 - name: bitnami-common repository: https://charts.bitnami.com/bitnami version: 0.0.3 digest: sha256:e08b8d1bb8197aa8fdc27536aaa1de2e7de210515a451ebe94949a3db55264dd -generated: 2018-09-05T14:56:00.449083032+02:00 +generated: 2018-10-25T11:06:24.877576+02:00 diff --git a/bitnami/mean/templates/_helpers.tpl b/bitnami/mean/templates/_helpers.tpl index 31a358e45..464a3d75e 100644 --- a/bitnami/mean/templates/_helpers.tpl +++ b/bitnami/mean/templates/_helpers.tpl @@ -40,3 +40,49 @@ Custom template to get proper service name {{- printf "%s-%s" .Release.Name "mongodb-binding" | trunc 63 | trimSuffix "-" -}} {{- end }} {{- end -}} + +{{/* +Return the proper MEAN image name +*/}} +{{- define "mean.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper Git image name +*/}} +{{- define "git.image" -}} +{{- $registryName := .Values.git.registry -}} +{{- $repositoryName := .Values.git.repository -}} +{{- $tag := .Values.git.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/mean/templates/deployment.yaml b/bitnami/mean/templates/deployment.yaml index 9b378c168..811680ddb 100644 --- a/bitnami/mean/templates/deployment.yaml +++ b/bitnami/mean/templates/deployment.yaml @@ -28,14 +28,14 @@ spec: {{- end }} initContainers: - name: git-clone-repository - image: "{{ .Values.gitImage.registry }}/{{ .Values.gitImage.repository }}:{{ .Values.gitImage.tag }}" - imagePullPolicy: {{ .Values.gitImage.pullPolicy | quote }} + image: "{{ template "git.image" . }}" + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} command: [ '/bin/sh', '-c' , 'git clone {{ .Values.repository }} /app && cd /app && git checkout {{ .Values.revision }}'] volumeMounts: - name: app mountPath: /app - name: npm-install - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "mean.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} workingDir: /app command: ['/bin/bash', '-c', 'useradd bitnami && chown -R bitnami:bitnami /app && npm install'] @@ -44,7 +44,7 @@ spec: mountPath: /app containers: - name: {{ template "mean.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "mean.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: {{- if .Values.mongodb.install }} diff --git a/bitnami/mean/values.yaml b/bitnami/mean/values.yaml index f856bd35f..49c10ef81 100644 --- a/bitnami/mean/values.yaml +++ b/bitnami/mean/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami node image version ## ref: https://hub.docker.com/r/bitnami/node/tags/ ## image: registry: docker.io repository: bitnami/node - tag: 9.11.1-prod + tag: 8.12.0-prod ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -17,9 +23,9 @@ image: # pullSecrets: # - myRegistrKeySecretName -gitImage: +git: registry: docker.io - repository: alpine/git + repository: bitnami/git tag: latest pullPolicy: IfNotPresent @@ -84,6 +90,8 @@ resources: {} ## ## MongoDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mongodb/values.yaml +## mongodb: ## MongoDB admin password ## ref: https://github.com/bitnami/bitnami-docker-MongoDB/blob/master/README.md#setting-the-root-password-on-first-run diff --git a/bitnami/memcached/Chart.yaml b/bitnami/memcached/Chart.yaml index b2c2e34df..a44719854 100644 --- a/bitnami/memcached/Chart.yaml +++ b/bitnami/memcached/Chart.yaml @@ -1,6 +1,6 @@ name: memcached -version: 1.1.0 -appVersion: 1.5.11 +version: 1.2.2 +appVersion: 1.5.12 description: Chart for Memcached keywords: - memcached diff --git a/bitnami/memcached/README.md b/bitnami/memcached/README.md index 93e97395e..65909c4b3 100644 --- a/bitnami/memcached/README.md +++ b/bitnami/memcached/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Memcached chart an | Parameter | Description | Default | |-----------------------------|-------------------------------------|---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Memcached image registry | `docker.io` | | `image.repository` | Memcached Image name | `bitnami/memcached` | | `image.tag` | Memcached Image tag | `{VERSION}` | diff --git a/bitnami/memcached/templates/_helpers.tpl b/bitnami/memcached/templates/_helpers.tpl index 234480de7..d9b10568e 100644 --- a/bitnami/memcached/templates/_helpers.tpl +++ b/bitnami/memcached/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} {{- end -}} + +{{/* +Return the proper Memcached image name +*/}} +{{- define "memcached.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/memcached/templates/deployment.yaml b/bitnami/memcached/templates/deployment.yaml index 5e0344ec1..bcbaaf70d 100644 --- a/bitnami/memcached/templates/deployment.yaml +++ b/bitnami/memcached/templates/deployment.yaml @@ -32,7 +32,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "memcached.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: MEMCACHED_USERNAME diff --git a/bitnami/memcached/values.yaml b/bitnami/memcached/values.yaml index bd20d1d22..c6672582c 100644 --- a/bitnami/memcached/values.yaml +++ b/bitnami/memcached/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Memcached image version ## ref: https://hub.docker.com/r/bitnami/memcached/tags/ ## image: registry: docker.io repository: bitnami/memcached - tag: 1.5.11-debian-9 + tag: 1.5.12 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/metrics-server/Chart.yaml b/bitnami/metrics-server/Chart.yaml index 10c6ecc5e..e85fb83ff 100644 --- a/bitnami/metrics-server/Chart.yaml +++ b/bitnami/metrics-server/Chart.yaml @@ -1,5 +1,5 @@ name: metrics-server -version: 2.0.5 +version: 2.1.1 appVersion: 0.3.1 description: Metrics Server is a cluster-wide aggregator of resource usage data. Metrics Server collects metrics from the Summary API, exposed by Kubelet on each node. keywords: diff --git a/bitnami/metrics-server/README.md b/bitnami/metrics-server/README.md index 34b7e5088..080ab8620 100644 --- a/bitnami/metrics-server/README.md +++ b/bitnami/metrics-server/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Metrics Server cha | Parameter | Description | Default | |--------------------------|-----------------------------------------------------------------------------|----------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Metrics Server image registry | `docker.io` | | `image.repository` | Metrics Server image name | `bitnami/metrics-server` | | `image.tag` | Metrics Server image tag | `{VERSION}` | diff --git a/bitnami/metrics-server/templates/_helpers.tpl b/bitnami/metrics-server/templates/_helpers.tpl index 4e90a0ff6..4aec7080d 100644 --- a/bitnami/metrics-server/templates/_helpers.tpl +++ b/bitnami/metrics-server/templates/_helpers.tpl @@ -37,6 +37,21 @@ Create the name of the service account to use Return the proper metrics-server image name */}} {{- define "metrics-server.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} -{{- end -}} \ No newline at end of file +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/metrics-server/values.yaml b/bitnami/metrics-server/values.yaml index ddbc0aa1a..2d8d56465 100644 --- a/bitnami/metrics-server/values.yaml +++ b/bitnami/metrics-server/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Metrics Server image version ## ref: https://hub.docker.com/r/bitnami/metrics-server/tags/ ## image: registry: docker.io repository: bitnami/metrics-server - tag: 0.3.1-debian-9 + tag: 0.3.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/mysql/Chart.yaml b/bitnami/mysql/Chart.yaml index 2e0fc41ad..cfe075ad7 100644 --- a/bitnami/mysql/Chart.yaml +++ b/bitnami/mysql/Chart.yaml @@ -1,6 +1,6 @@ name: mysql -version: 4.0.6 -appVersion: 5.7.23 +version: 4.1.2 +appVersion: 5.7.24 description: Chart to create a Highly available MySQL cluster keywords: - mysql diff --git a/bitnami/mysql/README.md b/bitnami/mysql/README.md index 885ce6741..4481e7934 100644 --- a/bitnami/mysql/README.md +++ b/bitnami/mysql/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the MySQL chart and th | Parameter | Description | Default | |-------------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | MySQL image registry | `docker.io` | | `image.repository` | MySQL Image name | `bitnami/mysql` | | `image.tag` | MySQL Image tag | `{VERSION}` | diff --git a/bitnami/mysql/templates/_helpers.tpl b/bitnami/mysql/templates/_helpers.tpl index 668cef0f4..451f40ac2 100644 --- a/bitnami/mysql/templates/_helpers.tpl +++ b/bitnami/mysql/templates/_helpers.tpl @@ -27,15 +27,27 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end }} - {{/* Return the proper MySQL image name */}} {{- define "mysql.image" -}} -{{- $registryName := .Values.image.registry -}} +{{- $registryName := .Values.image.registry -}} {{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -47,4 +59,3 @@ Return the proper MySQL metrics exporter image name {{- $tag := .Values.metrics.image.tag | toString -}} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- end -}} - diff --git a/bitnami/mysql/values-production.yaml b/bitnami/mysql/values-production.yaml index f40e585d9..66486b23c 100644 --- a/bitnami/mysql/values-production.yaml +++ b/bitnami/mysql/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami MySQL image ## ref: https://hub.docker.com/r/bitnami/mysql/tags/ ## image: registry: docker.io repository: bitnami/mysql - tag: 5.7.23-debian-9 + tag: 5.7.24 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/mysql/values.yaml b/bitnami/mysql/values.yaml index 94bbea4b5..b32d639f3 100644 --- a/bitnami/mysql/values.yaml +++ b/bitnami/mysql/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami MySQL image ## ref: https://hub.docker.com/r/bitnami/mysql/tags/ ## image: registry: docker.io repository: bitnami/mysql - tag: 5.7.23-debian-9 + tag: 5.7.24 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/nginx-ingress-controller/Chart.yaml b/bitnami/nginx-ingress-controller/Chart.yaml index 4c50e7914..0898c2940 100644 --- a/bitnami/nginx-ingress-controller/Chart.yaml +++ b/bitnami/nginx-ingress-controller/Chart.yaml @@ -1,5 +1,5 @@ name: nginx-ingress-controller -version: 2.0.4 +version: 3.0.0 appVersion: 0.20.0 description: Chart for the nginx Ingress controller keywords: diff --git a/bitnami/nginx-ingress-controller/README.md b/bitnami/nginx-ingress-controller/README.md index 581550ad7..cda46236d 100644 --- a/bitnami/nginx-ingress-controller/README.md +++ b/bitnami/nginx-ingress-controller/README.md @@ -48,6 +48,7 @@ The following tables lists the configurable parameters of the nginx-ingress-cont Parameter | Description | Default --- | --- | --- +`global.imageRegistry` | Global Docker image registry | `nil` `name` | name of the controller component | `controller` `image.registry` | name of the container image registry | `docker.io` `image.repository` | controller container image repository | `bitnami/nginx-ingress-controller` @@ -123,7 +124,7 @@ Parameter | Description | Default `metrics.service.externalIPs` | Prometheus metrics service external IP addresses | `[]` `metrics.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` `metrics.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]` -`metrics.service.servicePort` | Prometheus metrics service port | `9913` +`metrics.service.port` | Prometheus metrics service port | `9913` `metrics.service.type` | type of Prometheus metrics service to create | `ClusterIP` `customTemplate.configMapName` | configMap containing a custom nginx template | `""` `customTemplate.configMapKey` | configMap key containing the nginx template | `""` diff --git a/bitnami/nginx-ingress-controller/templates/NOTES.txt b/bitnami/nginx-ingress-controller/templates/NOTES.txt index a3e1b3c92..80e3bf7ec 100644 --- a/bitnami/nginx-ingress-controller/templates/NOTES.txt +++ b/bitnami/nginx-ingress-controller/templates/NOTES.txt @@ -45,7 +45,7 @@ An example Ingress that makes use of the controller: paths: - backend: serviceName: exampleService - servicePort: 80 + port: 80 path: / # This section is only required if TLS is to be enabled for the Ingress tls: diff --git a/bitnami/nginx-ingress-controller/templates/_helpers.tpl b/bitnami/nginx-ingress-controller/templates/_helpers.tpl index 6285744fa..6074a372e 100644 --- a/bitnami/nginx-ingress-controller/templates/_helpers.tpl +++ b/bitnami/nginx-ingress-controller/templates/_helpers.tpl @@ -62,8 +62,23 @@ Create the name of the service account to use Return the proper nginx-ingress-controller image name */}} {{- define "nginx-ingress-controller.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -71,4 +86,4 @@ Create chart name and version as used by the chart label. */}} {{- define "nginx-ingress-controller.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/bitnami/nginx-ingress-controller/templates/controller-metrics-service.yaml b/bitnami/nginx-ingress-controller/templates/controller-metrics-service.yaml index 8b1c5186a..11b46ca7b 100644 --- a/bitnami/nginx-ingress-controller/templates/controller-metrics-service.yaml +++ b/bitnami/nginx-ingress-controller/templates/controller-metrics-service.yaml @@ -28,7 +28,7 @@ spec: {{- end }} ports: - name: metrics - port: {{ .Values.metrics.service.servicePort }} + port: {{ .Values.metrics.service.port }} targetPort: metrics selector: app: {{ template "nginx-ingress.name" . }} diff --git a/bitnami/nginx-ingress-controller/templates/controller-stats-service.yaml b/bitnami/nginx-ingress-controller/templates/controller-stats-service.yaml index 3b8cbf534..ef69d186c 100644 --- a/bitnami/nginx-ingress-controller/templates/controller-stats-service.yaml +++ b/bitnami/nginx-ingress-controller/templates/controller-stats-service.yaml @@ -28,7 +28,7 @@ spec: {{- end }} ports: - name: stats - port: {{ .Values.stats.service.servicePort }} + port: {{ .Values.stats.service.port }} targetPort: stats selector: app: {{ template "nginx-ingress.name" . }} diff --git a/bitnami/nginx-ingress-controller/templates/default-backend-service.yaml b/bitnami/nginx-ingress-controller/templates/default-backend-service.yaml index 8508ef059..aa02a5780 100644 --- a/bitnami/nginx-ingress-controller/templates/default-backend-service.yaml +++ b/bitnami/nginx-ingress-controller/templates/default-backend-service.yaml @@ -28,7 +28,7 @@ spec: {{- end }} ports: - name: http - port: {{ .Values.defaultBackend.service.servicePort }} + port: {{ .Values.defaultBackend.service.port }} protocol: TCP targetPort: http selector: diff --git a/bitnami/nginx-ingress-controller/values.yaml b/bitnami/nginx-ingress-controller/values.yaml index 727aa518d..73f88828c 100644 --- a/bitnami/nginx-ingress-controller/values.yaml +++ b/bitnami/nginx-ingress-controller/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami NGINX Ingress controller image version ## ref: https://hub.docker.com/r/bitnami/nginx-ingress-controller/tags/ name: controller image: registry: docker.io repository: bitnami/nginx-ingress-controller - tag: 0.20.0-debian-9 + tag: 0.20.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -231,8 +237,8 @@ extraVolumes: [] extraInitContainers: [] ## Containers, which are run before the app containers are started. # - name: init-myservice -# image: busybox -# command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done;'] +# image: bitnami/minideb +# command: ['sh', '-c', 'install_packages dnsutils && until nslookup myservice; do echo waiting for myservice; sleep 2; done;'] stats: enabled: false @@ -248,7 +254,7 @@ stats: loadBalancerIP: "" loadBalancerSourceRanges: [] - servicePort: 18080 + port: 18080 type: ClusterIP ## If controller.stats.enabled = true and controller.metrics.enabled = true, Prometheus metrics will be exported @@ -270,7 +276,7 @@ metrics: loadBalancerIP: "" loadBalancerSourceRanges: [] - servicePort: 9913 + port: 9913 type: ClusterIP lifecycle: {} @@ -291,9 +297,10 @@ defaultBackend: name: default-backend image: - repository: k8s.gcr.io/defaultbackend - tag: "1.4" - pullPolicy: IfNotPresent + registry: docker.io + repository: bitnami/nginx + tag: latest + pullPolicy: Always extraArgs: {} @@ -346,7 +353,7 @@ defaultBackend: loadBalancerIP: "" loadBalancerSourceRanges: [] - servicePort: 80 + port: 80 type: ClusterIP priorityClassName: "" diff --git a/bitnami/nginx/Chart.yaml b/bitnami/nginx/Chart.yaml index e6480844b..ef3c5c628 100644 --- a/bitnami/nginx/Chart.yaml +++ b/bitnami/nginx/Chart.yaml @@ -1,6 +1,6 @@ name: nginx -version: 1.0.1 -appVersion: 1.14.0 +version: 2.0.0 +appVersion: 1.14.1 description: Chart for the nginx server keywords: - nginx diff --git a/bitnami/nginx/README.md b/bitnami/nginx/README.md index 8b5631d98..5f9323ce8 100644 --- a/bitnami/nginx/README.md +++ b/bitnami/nginx/README.md @@ -44,12 +44,18 @@ The following tables lists the configurable parameters of the NGINX Open Source | Parameter | Description | Default | | ------------------------- | ------------------------------ | --------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | NGINX image registry | `docker.io` | | `image.repository` | NGINX Image name | `bitnami/nginx` | | `image.tag` | NGINX Image tag | `{VERSION}` | | `image.pullPolicy` | NGINX image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | | `vhost` | Custom NGINX virtual host | `nil` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/nginx/templates/_helpers.tpl b/bitnami/nginx/templates/_helpers.tpl index 234480de7..32b533f69 100644 --- a/bitnami/nginx/templates/_helpers.tpl +++ b/bitnami/nginx/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} {{- end -}} + +{{/* +Return the proper NGINX image name +*/}} +{{- define "nginx.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/nginx/templates/deployment.yaml b/bitnami/nginx/templates/deployment.yaml index ac258488f..42fddb52e 100644 --- a/bitnami/nginx/templates/deployment.yaml +++ b/bitnami/nginx/templates/deployment.yaml @@ -29,7 +29,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "nginx.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} ports: - name: http diff --git a/bitnami/nginx/templates/svc.yaml b/bitnami/nginx/templates/svc.yaml index cf77abe82..8c7493ac6 100644 --- a/bitnami/nginx/templates/svc.yaml +++ b/bitnami/nginx/templates/svc.yaml @@ -8,10 +8,19 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/nginx/values.yaml b/bitnami/nginx/values.yaml index e0e4a015e..9ce487125 100644 --- a/bitnami/nginx/values.yaml +++ b/bitnami/nginx/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami NGINX image version ## ref: https://hub.docker.com/r/bitnami/nginx/tags/ ## image: registry: docker.io repository: bitnami/nginx - tag: 1.14.0-debian-9 + tag: 1.14.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -15,12 +21,25 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistrKeySecretName ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + ## + ## loadBalancerIP: + ## nodePorts: + ## http: + nodePorts: + http: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster # vhost: |- # # example PHP-FPM vhost diff --git a/bitnami/node/Chart.yaml b/bitnami/node/Chart.yaml index 879481bb0..077168d88 100644 --- a/bitnami/node/Chart.yaml +++ b/bitnami/node/Chart.yaml @@ -1,6 +1,6 @@ name: node -version: 6.1.0 -appVersion: 10.7.0 +version: 6.3.1 +appVersion: 8.13.0 description: Event-driven I/O server-side JavaScript environment based on V8 keywords: - node diff --git a/bitnami/node/README.md b/bitnami/node/README.md index 43b043d4f..eafb2f166 100644 --- a/bitnami/node/README.md +++ b/bitnami/node/README.md @@ -51,20 +51,21 @@ The following table lists the configurable parameters of the Node chart and thei | Parameter | Description | Default | |-----------------------------------------|-----------------------------------------------------------|-----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | NodeJS image registry | `docker.io` | -| `image.repository` | NodeJS Image name | `bitnami/node` | -| `image.tag` | NodeJS Image tag | `{VERSION}` | +| `image.repository` | NodeJS image name | `bitnami/node` | +| `image.tag` | NodeJS image tag | `{VERSION}` | | `image.pullPolicy` | NodeJS image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | -| `gitImage.registry` | Git image registry | `docker.io` | -| `gitImage.repository` | Git Image name | `alpine/git` | -| `gitImage.tag` | Git Image tag | `latest` | -| `gitImage.pullPolicy` | Git image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | -| `gitImage` | Image used for initContainers | `alpine/git` | +| `git.registry` | Git image registry | `docker.io` | +| `git.repository` | Git image name | `bitnami/git` | +| `git.tag` | Git image tag | `latest` | +| `git.pullPolicy` | Git image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | | `repository` | Repo of the application | `https://github.com/bitnami/sample-mean.git` | | `revision` | Revision to checkout | `master` | | `replicas` | Number of replicas for the application | `1` | | `applicationPort` | Port where the application will be running | `3000` | +| `extraEnv` | Any extra environment variables to be pass to the pods | `{}` | | `service.type` | Kubernetes Service type | `ClusterIP` | | `service.port` | Kubernetes Service port | `80` | | `service.annotations` | Annotations for the Service | {} | @@ -159,7 +160,7 @@ ingress: ``` $ kubectl create secret generic my-database-secret --from-literal=host=YOUR_DATABASE_HOST --from-literal=port=YOUR_DATABASE_PORT --from-literal=username=YOUR_DATABASE_USER --from-literal=password=YOUR_DATABASE_PASSWORD --from-literal=database=YOUR_DATABASE_NAME ``` - + `YOUR_DATABASE_HOST`, `YOUR_DATABASE_PORT`, `YOUR_DATABASE_USER`, `YOUR_DATABASE_PASSWORD`, and `YOUR_DATABASE_NAME` are placeholders that must be replaced with correct values. 2. Deploy the node chart specifying the secret name @@ -174,7 +175,7 @@ ingress: 2. Install the Open Service Broker for Azure in your Kubernetes cluster following [this instructions](https://github.com/Azure/open-service-broker-azure/tree/master/contrib/k8s/charts/open-service-broker-azure) > TIP: you may want to install the osba chart setting the `modules.minStability=EXPERIMENTAL` to see all the available services. -> +> > $ helm install azure/open-service-broker-azure --name osba --namespace osba \ > --set azure.subscriptionId=$AZURE_SUBSCRIPTION_ID \ > --set azure.tenantId=$AZURE_TENANT_ID \ @@ -202,7 +203,7 @@ ingress: - "0.0.0.0/0" ``` - Please update the `YOUR_AZURE_LOCATION` placeholder in the above example. + Please update the `YOUR_AZURE_LOCATION` placeholder in the above example. ``` $ kubectl create -f mongodb-service-instance.yml @@ -211,7 +212,7 @@ ingress: 4. Deploy the helm chart: ``` - $ helm install --name node-app --set mongodb.install=false,externaldb.broker.serviceInstanceName=azure-mongodb-instance bitnami/node + $ helm install --name node-app --set mongodb.install=false,externaldb.broker.serviceInstanceName=azure-mongodb-instance,externaldb.ssl=true bitnami/node ``` Once the instance has been provisioned in Azure, a new secret should have been automatically created with the connection parameters for your application. @@ -220,7 +221,7 @@ Deploying the helm chart enabling the Azure external database makes the followin - You would want an Azure CosmosDB MongoDB database - Your application uses DATABASE_HOST, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD, and DATABASE_NAME environment variables to connect to the database. -You can read more about the kubernetes service catalog at https://github.com/kubernetes-bitnami/service-catalog +You can read more about the kubernetes service catalog at https://github.com/kubernetes-bitnami/service-catalog ## Upgrading diff --git a/bitnami/node/requirements.lock b/bitnami/node/requirements.lock index 205a9fa09..c987ee5de 100644 --- a/bitnami/node/requirements.lock +++ b/bitnami/node/requirements.lock @@ -1,9 +1,9 @@ dependencies: - name: mongodb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 4.2.3 + version: 4.6.2 - name: bitnami-common repository: https://charts.bitnami.com/bitnami version: 0.0.3 digest: sha256:e08b8d1bb8197aa8fdc27536aaa1de2e7de210515a451ebe94949a3db55264dd -generated: 2018-09-05T15:06:25.041888238+02:00 +generated: 2018-10-25T10:09:00.707768+02:00 diff --git a/bitnami/node/templates/_helpers.tpl b/bitnami/node/templates/_helpers.tpl index a4a3ccd07..15927885f 100644 --- a/bitnami/node/templates/_helpers.tpl +++ b/bitnami/node/templates/_helpers.tpl @@ -40,3 +40,49 @@ Custom template to get proper service name {{- printf "%s-%s" .Release.Name "mongodb-binding" | trunc 63 | trimSuffix "-" -}} {{- end }} {{- end -}} + +{{/* +Return the proper Node image name +*/}} +{{- define "node.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper git image name +*/}} +{{- define "git.image" -}} +{{- $registryName := .Values.git.registry -}} +{{- $repositoryName := .Values.git.repository -}} +{{- $tag := .Values.git.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/node/templates/deployment.yaml b/bitnami/node/templates/deployment.yaml index 7d838952b..4dc68518c 100644 --- a/bitnami/node/templates/deployment.yaml +++ b/bitnami/node/templates/deployment.yaml @@ -29,14 +29,14 @@ spec: {{- end }} initContainers: - name: git-clone-repository - image: "{{ .Values.gitImage.registry }}/{{ .Values.gitImage.repository }}:{{ .Values.gitImage.tag }}" - imagePullPolicy: {{ .Values.gitImage.pullPolicy | quote }} + image: "{{ template "git.image" . }}" + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} command: [ '/bin/sh', '-c' , 'git clone {{ .Values.repository }} /app && cd /app && git checkout {{ .Values.revision }}'] volumeMounts: - name: app mountPath: /app - name: npm-install - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "node.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} workingDir: /app command: ['/bin/bash', '-c', 'useradd bitnami && chown -R bitnami:bitnami /app && npm install'] @@ -45,7 +45,7 @@ spec: mountPath: /app containers: - name: {{ template "node.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "node.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: {{- if .Values.mongodb.install }} @@ -106,6 +106,9 @@ spec: {{- end }} - name: DATA_FOLDER value: "/app" +{{- if .Values.extraEnv }} +{{ toYaml .Values.extraEnv | indent 8 }} +{{- end }} workingDir: /app command: ['/bin/bash', '-c', 'useradd bitnami && su bitnami -c "PATH=/opt/bitnami/node/bin:$PATH npm start"'] ports: diff --git a/bitnami/node/values.yaml b/bitnami/node/values.yaml index f7d8b96da..9ee0c7f76 100644 --- a/bitnami/node/values.yaml +++ b/bitnami/node/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami node image version ## ref: https://hub.docker.com/r/bitnami/node/tags/ ## image: registry: docker.io repository: bitnami/node - tag: 10.7.0-prod + tag: 8.13.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -15,14 +21,17 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistrKeySecretName -gitImage: +## Bitnami git image version +## ref: https://hub.docker.com/r/bitnami/git/tags/ +## +git: registry: docker.io - repository: alpine/git + repository: bitnami/git tag: latest pullPolicy: IfNotPresent - + ## Git repository http/https ## repository: https://github.com/bitnami/sample-mean.git @@ -35,10 +44,13 @@ revision: master ## replicas: 1 -## Specify the port where your applucation will be running +## Specify the port where your application will be running ## applicationPort: 3000 +# Define custom environment variables to pass to the image here +extraEnv: {} + ## Kubernetes Service Configuration service: ## For minikube, set this to NodePort, elsewhere use LoadBalancer @@ -83,6 +95,8 @@ resources: {} ## ## MongoDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mongodb/values.yaml +## mongodb: ## Whether to deploy a mongodb server to satisfy the applications database requirements. ## To use an external database set this to false and configure the externaldb parameters @@ -92,7 +106,7 @@ mongodb: ## mongodbUsername: user mongodbDatabase: test_db - mongodbPassword: secret_password + mongodbPassword: secret_password ## Provision an external database (Only if mongodb.install is false) ## You can: @@ -110,6 +124,9 @@ externaldb: broker: serviceInstanceName: +## Configure ingress resource that allow you to access the application. +## ref: http://kubernetes.io/docs/user-guide/ingress/ +## ingress: ## Set to true to enable ingress record generation enabled: false diff --git a/bitnami/postgresql/.helmignore b/bitnami/postgresql/.helmignore deleted file mode 100644 index 6b8710a71..000000000 --- a/bitnami/postgresql/.helmignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md deleted file mode 100644 index b9613f28b..000000000 --- a/bitnami/postgresql/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# PostgreSQL - -[PostgreSQL](https://www.postgresql.org/) is an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. - -## TL;DR; - -```console -$ helm install bitnami/postgresql -``` - -## Introduction - -This chart bootstraps a [PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. - -## Prerequisites - -- Kubernetes 1.4+ with Beta APIs enabled -- PV provisioner support in the underlying infrastructure - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```console -$ helm install --name my-release bitnami/postgresql -``` - -The command deploys PostgreSQL on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -$ helm delete my-release -``` - -The command removes all the Kubernetes components associated with the chart and deletes the release. - -## Configuration - -The following tables lists the configurable parameters of the PostgreSQL chart and their default values. - -| Parameter | Description | Default | -|----------------------------|-------------------------------------------|---------------------------------------------------------- | -| `image.registry` | PostgreSQL image registry | `docker.io` | -| `image.repository` | PostgreSQL Image name | `bitnami/postgresql` | -| `image.tag` | PostgreSQL Image tag | `{VERSION}` | -| `image.pullPolicy` | PostgreSQL image pull policy | `Always` | -| `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | -| `image.debug` | Specify if debug values should be set | `false` | -| `replication.enabled` | Would you like to enable replication | `false` | -| `replication.user` | Replication user | `repl_user` | -| `replication.password` | Replication user password | `repl_password` | -| `replication.slaveReplicas`| Number of slaves replicas | `1` | -| `postgresqlUsername` | PostgreSQL admin user | `postgres` | -| `postgresqlPassword` | PostgreSQL admin password | _random 10 character alphanumeric string_ | -| `postgresqlDatabase` | PostgreSQL database | `nil` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.port` | PostgreSQL port | `5432` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for PostgreSQL volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for PostgreSQL volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` | -| `persistence.annotations` | Annotations for the PVC | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | -| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | `livenessProbe.enabled` | would you like a livessProbed to be enabled | `true` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | -| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | -| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | -| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | -| `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 | -| `readinessProbe.periodSeconds` | How often to perform the probe | 10 | -| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | -| `metrics.enabled` | Start a prometheus exporter | `false` | -| `metrics.service.type` | Kubernetes Service type | `ClusterIP` | -| `metrics.service.annotatios` | Additional annotations for metrics exporter pod | `{}` | -| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` | -| `metrics.image.registry` | PostgreSQL image registry | `docker.io` | -| `metrics.image.repository` | PostgreSQL Image name | `wrouesnel/postgres_exporter` | -| `metrics.image.tag` | PostgreSQL Image tag | `{VERSION}` | -| `metrics.image.pullPolicy` | PostgreSQL image pull policy | `IfNotPresent` | -| `metrics.image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```console -$ helm install --name my-release \ - --set postgresqlPassword=secretpassword,postgresqlDatabase=my-database \ - bitnami/postgresql -``` - -The above command sets the PostgreSQL `postgres` account password to `secretpassword`. Additionally it creates a database named `my-database`. - -Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, - -```console -$ helm install --name my-release -f values.yaml bitnami/postgresql -``` - -> **Tip**: You can use the default [values.yaml](values.yaml) - -### postgresql.conf file as configMap - -Instead of using specific variables for the PostgreSQL configuration, this helm chart also supports to customize the whole configuration file. - -Add your custom file to "files/postgresql.conf" in your working directory. This file will be mounted as configMap to the containers and it will be used for configuring the PostgreSQL server. - -## Initialize a fresh instance - -The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder `files/docker-entrypoint-initdb.d` so they can be consumed as a ConfigMap. - -The allowed extensions are `.sh`, `.sql` and `.sql.gz`. - -## Production and horizontal scaling - -The following repo contains the recommended production settings for PostgreSQL server in an alternative [values file](values-production.yaml). Please read carefully the comments in the values-production.yaml file to set up your environment - -To horizontally scale this chart, first download the [values-production.yaml](values-production.yaml) file to your local folder, then: - -```console -$ helm install --name my-release -f ./values-production.yaml bitnami/postgresql -$ kubectl scale statefulset my-postgresql-slave --replicas=3 -``` - -## Persistence - -The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image stores the PostgreSQL data and configurations at the `/bitnami/postgresql` path of the container. - -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. -See the [Configuration](#configuration) section to configure the PVC or to disable persistence. - -## Upgrading - -### To 3.0.0 - -Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments. -Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is postgresql: - -```console -$ kubectl delete statefulset postgresql --cascade=false -$ kubectl delete statefulset postgresql-slave --cascade=false -``` diff --git a/bitnami/postgresql/files/README.md b/bitnami/postgresql/files/README.md deleted file mode 100644 index 5906be3e1..000000000 --- a/bitnami/postgresql/files/README.md +++ /dev/null @@ -1 +0,0 @@ -Copy here your postgresql.conf file to use it as a config map. \ No newline at end of file diff --git a/bitnami/postgresql/templates/_helpers.tpl b/bitnami/postgresql/templates/_helpers.tpl deleted file mode 100644 index b064fde20..000000000 --- a/bitnami/postgresql/templates/_helpers.tpl +++ /dev/null @@ -1,54 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "postgresql.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "postgresql.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "postgresql.master.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if .Values.replication.enabled -}} -{{- printf "%s-%s-%s" .Release.Name $name "master" | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "postgresql.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Return the proper PostgreSQL image name -*/}} -{{- define "postgresql.image" -}} -{{- $registryName := default "docker.io" .Values.image.registry -}} -{{- $tag := default "latest" .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.image.repository $tag -}} -{{- end -}} - -{{/* -Return the proper PostgreSQL metrics image name -*/}} -{{- define "metrics.image" -}} -{{- $registryName := default "docker.io" .Values.metrics.image.registry -}} -{{- $tag := default "latest" .Values.metrics.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName .Values.metrics.image.repository $tag -}} -{{- end -}} diff --git a/bitnami/postgresql/templates/configmap.yaml b/bitnami/postgresql/templates/configmap.yaml deleted file mode 100644 index f6bad0d21..000000000 --- a/bitnami/postgresql/templates/configmap.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{ if (.Files.Glob "files/postgresql.conf") }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "postgresql.fullname" . }}-configuration - labels: - app: "{{ template "postgresql.name" . }}" - chart: {{ template "postgresql.chart" . }} - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} -data: -{{ (.Files.Glob "files/postgresql.conf").AsConfig | indent 2 }} -{{ end }} \ No newline at end of file diff --git a/bitnami/postgresql/templates/svc.yaml b/bitnami/postgresql/templates/svc.yaml deleted file mode 100644 index 1a4bea1df..000000000 --- a/bitnami/postgresql/templates/svc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "postgresql.fullname" . }} - labels: - app: {{ template "postgresql.name" . }} - chart: {{ template "postgresql.chart" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - type: {{ .Values.service.type }} - ports: - - name: postgresql - port: 5432 - targetPort: postgresql - selector: - app: {{ template "postgresql.name" . }} - release: {{ .Release.Name | quote }} - role: master \ No newline at end of file diff --git a/bitnami/tensorflow-inception/Chart.yaml b/bitnami/tensorflow-inception/Chart.yaml index ab203dab0..171d5e0b4 100755 --- a/bitnami/tensorflow-inception/Chart.yaml +++ b/bitnami/tensorflow-inception/Chart.yaml @@ -1,6 +1,6 @@ name: tensorflow-inception -version: 1.0.2 -appVersion: 1.10.1 +version: 3.1.0 +appVersion: 1.11.1 description: Open-source software library for serving machine learning models keywords: - tensorflow diff --git a/bitnami/tensorflow-inception/README.md b/bitnami/tensorflow-inception/README.md index 6818ff71e..09e194606 100755 --- a/bitnami/tensorflow-inception/README.md +++ b/bitnami/tensorflow-inception/README.md @@ -62,6 +62,8 @@ The following tables lists the configurable parameters of the TensorFlow Incepti | Parameter | Description | Default | | ------------------------------- | -------------------------------------- | ---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `replicaCount` | desired number of pods | `1` | | `server.image.registry` | TensorFlow Serving image registry | `docker.io` | | `server.image.repository` | TensorFlow Serving Image name | `bitnami/tensorflow-serving` | | `server.image.tag` | TensorFlow Serving Image tag | `{VERSION}` | @@ -74,10 +76,15 @@ The following tables lists the configurable parameters of the TensorFlow Incepti | `client.image.pullPolicy` | TensorFlow Inception image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | | `client.image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | | `imagePullPolicy` | Image pull policy | `Always` if `image` tag is `latest`, else `IfNotPresent` | -| `persistence.enabled` | Use a PVC to persist data | `true` | -| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | -| `persistence.size` | Size of data volume | `500Mi` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car Tensorflow prometheus exporter | `false` | +| `metrics.image.registry` | Tensorflow exporter image registry | `docker.io` | +| `metrics.image.repository` | Tensorflow exporter image name | `ynqa/tensorflow-serving-exporter` | +| `metrics.image.tag` | Tensorflow exporter image tag | `latest` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9118"}` | +| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/tensorflow-inception/templates/_helpers.tpl b/bitnami/tensorflow-inception/templates/_helpers.tpl index f0d83d2ed..eea84fd0b 100644 --- a/bitnami/tensorflow-inception/templates/_helpers.tpl +++ b/bitnami/tensorflow-inception/templates/_helpers.tpl @@ -14,3 +14,59 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper tensorflow-inception server image name +*/}} +{{- define "tensorflow-inception.server.image" -}} +{{- $registryName := .Values.server.image.registry -}} +{{- $repositoryName := .Values.server.image.repository -}} +{{- $tag := .Values.server.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper tensorflow-inception client image name +*/}} +{{- define "tensorflow-inception.client.image" -}} +{{- $registryName := .Values.client.image.registry -}} +{{- $repositoryName := .Values.client.image.repository -}} +{{- $tag := .Values.client.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/bitnami/tensorflow-inception/templates/deployment.yaml b/bitnami/tensorflow-inception/templates/deployment.yaml index 91890164c..5c827c9fd 100644 --- a/bitnami/tensorflow-inception/templates/deployment.yaml +++ b/bitnami/tensorflow-inception/templates/deployment.yaml @@ -12,13 +12,22 @@ spec: matchLabels: app: {{ template "fullname" . }} release: "{{ .Release.Name }}" - replicas: 1 + replicas: {{ .Values.replicaCount }} template: metadata: labels: app: {{ template "fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.server.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,30 @@ spec: - name: {{ . }} {{- end}} {{- end }} + initContainers: + - name: seed + image: "{{ template "tensorflow-inception.client.image" . }}" + imagePullPolicy: {{ .Values.client.image.pullPolicy | quote }} + command: + - "/bin/sh" + - "-c" + - | + if [ -f /seed/.initialized ];then + echo "Already initialized. Skipping" + else + curl -o /seed/inception-v3-2016-03-01.tar.gz http://download.tensorflow.org/models/image/imagenet/inception-v3-2016-03-01.tar.gz + cd /seed/ && tar -xzf inception-v3-2016-03-01.tar.gz + rm inception-v3-2016-03-01.tar.gz + inception_saved_model --checkpoint_dir=/seed/inception-v3 --output_dir=/seed/ + rm -rf inception-v3 + touch /seed/.initialized + fi + volumeMounts: + - name: seed + mountPath: /seed containers: - - name: {{ template "fullname" . }} - image: "{{ .Values.server.image.registry }}/{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}" + - name: serving + image: "{{ template "tensorflow-inception.server.image" . }}" imagePullPolicy: {{ .Values.server.image.pullPolicy | quote }} readinessProbe: tcpSocket: @@ -43,16 +73,29 @@ spec: volumeMounts: - name: seed mountPath: "/bitnami/model-data" - - name: data - mountPath: /bitnami/tensorflow-serving +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: ['python', 'tf_serving_exporter.py', '--tf_port', '{{ .Values.server.port }}', '--port', '9118', '--model_name', 'inception-v3'] + ports: + - name: metrics + containerPort: 9118 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: seed - persistentVolumeClaim: - claimName: {{ template "fullname" . }}-seed-inception - - name: data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "fullname" . }} - {{- else }} emptyDir: {} - {{- end -}} diff --git a/bitnami/tensorflow-inception/templates/inception-job.yaml b/bitnami/tensorflow-inception/templates/inception-job.yaml deleted file mode 100644 index 114c2236a..000000000 --- a/bitnami/tensorflow-inception/templates/inception-job.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "fullname" . }}-seed-inception - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - template: - metadata: - name: seed-inception - spec: - containers: - {{- if .Values.client.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.client.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- end }} - - name: seed - image: "{{ .Values.client.image.registry }}/{{ .Values.client.image.repository }}:{{ .Values.client.image.tag }}" - imagePullPolicy: {{ .Values.client.image.pullPolicy | quote }} - command: - - "/bin/sh" - - "-c" - - | - curl -o /seed/inception-v3-2016-03-01.tar.gz http://download.tensorflow.org/models/image/imagenet/inception-v3-2016-03-01.tar.gz - cd /seed/ && tar -xzf inception-v3-2016-03-01.tar.gz - rm inception-v3-2016-03-01.tar.gz - inception_saved_model --checkpoint_dir=/seed/inception-v3 --output_dir=/seed/ - rm -rf inception-v3 - volumeMounts: - - name: seed - mountPath: /seed - restartPolicy: Never - volumes: - - name: seed - persistentVolumeClaim: - claimName: {{ template "fullname" . }}-seed-inception diff --git a/bitnami/tensorflow-inception/templates/inception-pvc.yaml b/bitnami/tensorflow-inception/templates/inception-pvc.yaml deleted file mode 100644 index 84d5b34a8..000000000 --- a/bitnami/tensorflow-inception/templates/inception-pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ template "fullname" . }}-seed-inception - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 500Mi diff --git a/bitnami/tensorflow-inception/templates/pvc.yaml b/bitnami/tensorflow-inception/templates/pvc.yaml deleted file mode 100644 index 6a21fe551..000000000 --- a/bitnami/tensorflow-inception/templates/pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if .Values.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "fullname" . }} - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - annotations: - {{- if .Values.persistence.storageClass }} - volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} - {{- else }} - volume.alpha.kubernetes.io/storage-class: default - {{- end }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} -{{- end }} diff --git a/bitnami/tensorflow-inception/values.yaml b/bitnami/tensorflow-inception/values.yaml index ec68070bd..ae374eb93 100755 --- a/bitnami/tensorflow-inception/values.yaml +++ b/bitnami/tensorflow-inception/values.yaml @@ -1,3 +1,11 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + +replicaCount: 1 + ## TensorFlow Serving server image version ## ref: https://hub.docker.com/r/bitnami/tensorflow-serving/tags/ ## @@ -5,7 +13,7 @@ server: image: registry: docker.io repository: bitnami/tensorflow-serving - tag: 1.10.1-debian-9 + tag: 1.11.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -26,7 +34,7 @@ client: image: registry: docker.io repository: bitnami/tensorflow-inception - tag: 1.10.1-debian-9 + tag: 1.11.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -45,19 +53,36 @@ client: ## imagePullPolicy: IfNotPresent -## Enable persistence using Persistent Volume Claims -## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ -## -persistence: - enabled: true - ## If defined, volume.beta.kubernetes.io/storage-class: - ## Default: volume.alpha.kubernetes.io/storage-class: default - ## - # storageClass: - accessMode: ReadWriteOnce - size: 500Mi - ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## serviceType: LoadBalancer + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: ynqa/tensorflow-serving-exporter + tag: latest + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9118" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/bitnami/tomcat/Chart.yaml b/bitnami/tomcat/Chart.yaml index a79a675bf..adb089879 100644 --- a/bitnami/tomcat/Chart.yaml +++ b/bitnami/tomcat/Chart.yaml @@ -1,6 +1,6 @@ name: tomcat -version: 1.0.2 -appVersion: 8.5.34 +version: 2.0.0 +appVersion: 8.5.35 description: Chart for Apache Tomcat keywords: - tomcat diff --git a/bitnami/tomcat/README.md b/bitnami/tomcat/README.md index a2b8e8d1a..8df61dd45 100644 --- a/bitnami/tomcat/README.md +++ b/bitnami/tomcat/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Tomcat chart and t | Parameter | Description | Default | |-------------------------------|----------------------------------------------|---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Tomcat image registry | `docker.io` | | `image.repository` | Tomcat Image name | `bitnami/tomcat` | | `image.tag` | Tomcat Image tag | `{VERSION}` | @@ -55,7 +56,11 @@ The following tables lists the configurable parameters of the Tomcat chart and t | `tomcatUsername` | Tomcat admin user | `user` | | `tomcatPassword` | Tomcat admin password | _random 10 character alphanumeric string_ | | `tomcatAllowRemoteManagement` | Enable remote access to management interface | `0` (disabled) | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.storageClass` | PVC Storage Class for Tomcat volume | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | PVC Access Mode for Tomcat volume | `ReadWriteOnce` | diff --git a/bitnami/tomcat/templates/NOTES.txt b/bitnami/tomcat/templates/NOTES.txt index a54a1e981..e8bfa5831 100644 --- a/bitnami/tomcat/templates/NOTES.txt +++ b/bitnami/tomcat/templates/NOTES.txt @@ -3,24 +3,25 @@ 1. Get the Tomcat URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT/ -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo URL : http://$SERVICE_IP/ - echo Management URL : http://$SERVICE_IP/manager -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo URL : http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/ + echo Management URL : http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/manager +{{- else if contains "ClusterIP" .Values.service.type }} echo URL : http://127.0.0.1:8080/ echo Management URL : http://127.0.0.1:8080/manager - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:8080 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:{{ .Values.service.port }} {{- end }} 2. Login with the following credentials diff --git a/bitnami/tomcat/templates/_helpers.tpl b/bitnami/tomcat/templates/_helpers.tpl index f0d83d2ed..c20823f7c 100644 --- a/bitnami/tomcat/templates/_helpers.tpl +++ b/bitnami/tomcat/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Tomcat image name +*/}} +{{- define "tomcat.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/tomcat/templates/deployment.yaml b/bitnami/tomcat/templates/deployment.yaml index d1418821d..654da418d 100644 --- a/bitnami/tomcat/templates/deployment.yaml +++ b/bitnami/tomcat/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "tomcat.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: TOMCAT_USERNAME diff --git a/bitnami/tomcat/templates/svc.yaml b/bitnami/tomcat/templates/svc.yaml index cf77abe82..8c7493ac6 100644 --- a/bitnami/tomcat/templates/svc.yaml +++ b/bitnami/tomcat/templates/svc.yaml @@ -8,10 +8,19 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/tomcat/values.yaml b/bitnami/tomcat/values.yaml index 032095894..8bb519080 100644 --- a/bitnami/tomcat/values.yaml +++ b/bitnami/tomcat/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Tomcat image version ## ref: https://hub.docker.com/r/bitnami/tomcat/tags/ ## image: registry: docker.io repository: bitnami/tomcat - tag: 8.5.34-debian-9 + tag: 8.5.35 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -40,7 +46,21 @@ tomcatAllowRemoteManagement: 0 ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + ## + ## loadBalancerIP: + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ diff --git a/bitnami/wildfly/Chart.yaml b/bitnami/wildfly/Chart.yaml index b76157c94..f9c5c32ba 100644 --- a/bitnami/wildfly/Chart.yaml +++ b/bitnami/wildfly/Chart.yaml @@ -1,5 +1,5 @@ name: wildfly -version: 1.0.2 +version: 2.0.0 appVersion: 14.0.1 description: Chart for Wildfly keywords: diff --git a/bitnami/wildfly/README.md b/bitnami/wildfly/README.md index 933544aaa..bfd776b82 100644 --- a/bitnami/wildfly/README.md +++ b/bitnami/wildfly/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the WildFly chart and | Parameter | Description | Default | |----------------------------|----------------------------------------|------------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | WildFly image registry | `docker.io` | | `image.repository` | WildFly Image name | `bitnami/wildfly` | | `image.tag` | WildFly Image tag | `{VERSION}` | @@ -54,7 +55,13 @@ The following tables lists the configurable parameters of the WildFly chart and | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | | `wildflyUsername` | WildFly admin user | `user` | | `wildflyPassword` | WildFly admin password | _random 10 character alphanumeric string_ | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.mgmtPort` | Service Management port | `9990` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.mgmt` | Kubernetes management node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.storageClass` | PVC Storage Class for WildFly volume | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | PVC Access Mode for WildFly volume | `ReadWriteOnce` | diff --git a/bitnami/wildfly/templates/NOTES.txt b/bitnami/wildfly/templates/NOTES.txt index e6f5f777a..14ff56213 100644 --- a/bitnami/wildfly/templates/NOTES.txt +++ b/bitnami/wildfly/templates/NOTES.txt @@ -3,24 +3,25 @@ 1. Get the WildFly URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT/ -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo URL : http://$SERVICE_IP/ - echo Management Url : http://$SERVICE_IP:9990/ -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo URL : http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/ + echo Management Url : http://$SERVICE_IP:{{ .Values.service.mgmtPort }}/ +{{- else if contains "ClusterIP" .Values.service.type }} echo URL : http://127.0.0.1:8080/ echo Management URL : http://127.0.0.1:9990/ - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:8080 9990:9990 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:{{ .Values.service.port}} 9990:{{ .Values.service.mgmtPort }} {{- end }} 2. Login with the following credentials diff --git a/bitnami/wildfly/templates/_helpers.tpl b/bitnami/wildfly/templates/_helpers.tpl index 234480de7..3d8fd4ded 100644 --- a/bitnami/wildfly/templates/_helpers.tpl +++ b/bitnami/wildfly/templates/_helpers.tpl @@ -14,3 +14,26 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} {{- end -}} + +{{/* +Return the proper Wildfly image name +*/}} +{{- define "wildfly.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/bitnami/wildfly/templates/deployment.yaml b/bitnami/wildfly/templates/deployment.yaml index 9e5197295..61ed98e47 100644 --- a/bitnami/wildfly/templates/deployment.yaml +++ b/bitnami/wildfly/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- end }} containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ template "wildfly.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: WILDFLY_USERNAME diff --git a/bitnami/wildfly/templates/svc.yaml b/bitnami/wildfly/templates/svc.yaml index 6be072b6b..f6f24642e 100644 --- a/bitnami/wildfly/templates/svc.yaml +++ b/bitnami/wildfly/templates/svc.yaml @@ -8,13 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port}} targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} - name: mgmt - port: 9990 + port: {{ .Values.service.mgmtPort}} targetPort: mgmt + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.mgmt)))}} + nodePort: {{ .Values.service.nodePorts.mgmt }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/wildfly/values.yaml b/bitnami/wildfly/values.yaml index 05957e7d7..cd0bde2d2 100644 --- a/bitnami/wildfly/values.yaml +++ b/bitnami/wildfly/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami WildFly image version ## ref: https://hub.docker.com/r/bitnami/wildfly/tags/ ## image: registry: docker.io repository: bitnami/wildfly - tag: 14.0.1-debian-9 + tag: 14.0.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -35,7 +41,24 @@ wildflyUsername: user ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # Management Port + mgmtPort: 9990 + ## + ## loadBalancerIP: + ## nodePorts: + ## http: + ## mgmt: + nodePorts: + http: "" + mgmt: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ diff --git a/bitnami/zookeeper/Chart.yaml b/bitnami/zookeeper/Chart.yaml index b8aa48c83..7dea82810 100644 --- a/bitnami/zookeeper/Chart.yaml +++ b/bitnami/zookeeper/Chart.yaml @@ -1,5 +1,5 @@ name: zookeeper -version: 1.1.0 +version: 1.2.0 appVersion: 3.4.12 description: A centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services for distributed applications. keywords: diff --git a/bitnami/zookeeper/README.md b/bitnami/zookeeper/README.md index 189068d25..29f621a03 100644 --- a/bitnami/zookeeper/README.md +++ b/bitnami/zookeeper/README.md @@ -47,6 +47,7 @@ The following tables lists the configurable parameters of the Zookeeper chart an | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Zookeeper image registry | `docker.io` | | `image.repository` | Zookeeper Image name | `bitnami/zookeeper` | | `image.tag` | Zookeeper Image tag | `{VERSION}` | diff --git a/bitnami/zookeeper/templates/_helpers.tpl b/bitnami/zookeeper/templates/_helpers.tpl index faf4994d3..ed38b41c9 100644 --- a/bitnami/zookeeper/templates/_helpers.tpl +++ b/bitnami/zookeeper/templates/_helpers.tpl @@ -26,8 +26,23 @@ Create chart name and version as used by the chart label. Return the proper Zookeeper image name */}} {{- define "zookeeper.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/bitnami/zookeeper/values.yaml b/bitnami/zookeeper/values.yaml index b5fce8f18..c50cf9b7d 100644 --- a/bitnami/zookeeper/values.yaml +++ b/bitnami/zookeeper/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Zookeeper image version ## ref: https://hub.docker.com/r/bitnami/zookeeper/tags/ ## image: registry: docker.io repository: bitnami/zookeeper - tag: 3.4.12-debian-9 + tag: 3.4.12 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/upstreamed/dokuwiki/Chart.yaml b/upstreamed/dokuwiki/Chart.yaml index 0bddc297c..fba2585aa 100644 --- a/upstreamed/dokuwiki/Chart.yaml +++ b/upstreamed/dokuwiki/Chart.yaml @@ -1,5 +1,5 @@ name: dokuwiki -version: 3.1.0 +version: 4.0.0 appVersion: 0.20180422.201805030840 description: DokuWiki is a standards-compliant, simple to use wiki optimized for creating documentation. It is targeted at developer teams, workgroups, and small companies. diff --git a/upstreamed/dokuwiki/README.md b/upstreamed/dokuwiki/README.md index 9eda155f0..1a5587f15 100644 --- a/upstreamed/dokuwiki/README.md +++ b/upstreamed/dokuwiki/README.md @@ -47,6 +47,7 @@ The following table lists the configurable parameters of the DokuWiki chart and | Parameter | Description | Default | |--------------------------------------|------------------------------------------------------------|-----------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | DokuWiki image registry | `docker.io` | | `image.repository` | DokuWiki image name | `bitnami/dokuwiki` | | `image.tag` | DokuWiki image tag | `{VERSION}` | @@ -57,7 +58,10 @@ The following table lists the configurable parameters of the DokuWiki chart and | `dokuwikiPassword` | Application password | _random 10 character alphanumeric string_ | | `dokuwikiEmail` | User email | `user@example.com` | | `dokuwikiWikiName` | Wiki name | `My Wiki` | -| `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.loadBalancerIP` | Kubernetes LoadBalancerIP to request | `nil` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.nodePorts.http` | Kubernetes http node port | `""` | | `service.nodePorts.https` | Kubernetes https node port | `""` | @@ -94,6 +98,16 @@ The following table lists the configurable parameters of the DokuWiki chart and | `nodeSelector` | Node labels for pod assignment | `{}` | | `affinity` | Affinity settings for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | + The above parameters map to the env variables defined in [bitnami/dokuwiki](http://github.com/bitnami/bitnami-docker-dokuwiki). For more information please refer to the [bitnami/dokuwiki](http://github.com/bitnami/bitnami-docker-dokuwiki) image documentation. @@ -119,7 +133,8 @@ $ helm install --name my-release -f values.yaml stable/dokuwiki The [Bitnami DokuWiki](https://github.com/bitnami/bitnami-docker-dokuwiki) image stores the DokuWiki data and configurations at the `/bitnami/dokuwiki` and `/bitnami/apache` paths of the container. -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +Persistent Volume Claims are used to keep the data across deployments. There is a [known issue](https://github.com/kubernetes/kubernetes/issues/39178) in Kubernetes Clusters with EBS in different availability zones. Ensure your cluster is configured properly to create Volumes in the same availability zone where the nodes are running. Kuberentes 1.12 solved this issue with the [Volume Binding Mode](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode). + See the [Configuration](#configuration) section to configure the PVC or to disable persistence. ## Upgrading diff --git a/upstreamed/dokuwiki/templates/NOTES.txt b/upstreamed/dokuwiki/templates/NOTES.txt index 6b41468fe..24b8e605b 100644 --- a/upstreamed/dokuwiki/templates/NOTES.txt +++ b/upstreamed/dokuwiki/templates/NOTES.txt @@ -26,12 +26,14 @@ ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "dokuwiki.fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "dokuwiki.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "URL: http://$SERVICE_IP/" + +{{- $port:=.Values.service.port | toString }} + echo "URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} echo "URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "dokuwiki.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "dokuwiki.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} {{- end }} diff --git a/upstreamed/dokuwiki/templates/_helpers.tpl b/upstreamed/dokuwiki/templates/_helpers.tpl index a636b70a0..1ad62fbe8 100644 --- a/upstreamed/dokuwiki/templates/_helpers.tpl +++ b/upstreamed/dokuwiki/templates/_helpers.tpl @@ -23,9 +23,34 @@ Create chart name and version as used by the chart label. {{- end -}} {{/* -Return the proper Dokuwiki image name +Return the proper DokuWiki image name */}} {{- define "dokuwiki.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- end -}} diff --git a/upstreamed/dokuwiki/templates/deployment.yaml b/upstreamed/dokuwiki/templates/deployment.yaml index 08e8f3d66..20fbe7f34 100644 --- a/upstreamed/dokuwiki/templates/deployment.yaml +++ b/upstreamed/dokuwiki/templates/deployment.yaml @@ -18,6 +18,15 @@ spec: app: {{ template "dokuwiki.name" . }} chart: {{ template "dokuwiki.chart" . }} release: {{ .Release.Name | quote }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.affinity }} affinity: @@ -37,6 +46,10 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "dokuwiki.fullname" . }} image: {{ template "dokuwiki.image" . }} @@ -89,6 +102,29 @@ spec: mountPath: /bitnami/dokuwiki - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: dokuwiki-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/dokuwiki/templates/svc.yaml b/upstreamed/dokuwiki/templates/svc.yaml index b50c26364..bfad4323d 100644 --- a/upstreamed/dokuwiki/templates/svc.yaml +++ b/upstreamed/dokuwiki/templates/svc.yaml @@ -17,13 +17,13 @@ spec: {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port }} targetPort: http {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} nodePort: {{ .Values.service.nodePorts.http }} {{- end }} - name: https - port: 443 + port: {{ .Values.service.httpsPort }} targetPort: https {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} nodePort: {{ .Values.service.nodePorts.https }} diff --git a/upstreamed/dokuwiki/values.yaml b/upstreamed/dokuwiki/values.yaml index e8af38e0e..c1ce46d56 100644 --- a/upstreamed/dokuwiki/values.yaml +++ b/upstreamed/dokuwiki/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami DokuWiki image version ## ref: https://hub.docker.com/r/bitnami/dokuwiki/tags/ ## image: registry: docker.io repository: bitnami/dokuwiki - tag: 0.20180422.201805030840-debian-9 + tag: 0.20180422.201805030840 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -53,6 +59,10 @@ service: ## otherwise leave blank ## # loadBalancerIP: + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 ## Use nodePorts to requets some specific ports when usin NodePort ## nodePorts: ## http: @@ -170,3 +180,31 @@ readinessProbe: nodeSelector: {} tolerations: [] affinity: {} + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/drupal/Chart.yaml b/upstreamed/drupal/Chart.yaml index 6ea74469e..c191df164 100644 --- a/upstreamed/drupal/Chart.yaml +++ b/upstreamed/drupal/Chart.yaml @@ -1,6 +1,6 @@ name: drupal -version: 2.1.0 -appVersion: 8.6.1 +version: 3.0.0 +appVersion: 8.6.3 description: One of the most versatile open source content management systems. keywords: - drupal diff --git a/upstreamed/drupal/README.md b/upstreamed/drupal/README.md index ea449fb59..bc7867a9e 100644 --- a/upstreamed/drupal/README.md +++ b/upstreamed/drupal/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Drupal chart and th | Parameter | Description | Default | | --------------------------------- | ------------------------------------------ | --------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Drupal image registry | `docker.io` | | `image.repository` | Drupal Image name | `bitnami/drupal` | | `image.tag` | Drupal Image tag | `{VERSION}` | @@ -79,7 +80,12 @@ The following table lists the configurable parameters of the Drupal chart and th | `mariadb.db.name` | Database name to create | `bitnami_drupal` | | `mariadb.db.user` | Database user to create | `bn_drupal` | | `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | | `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | @@ -92,6 +98,15 @@ The following table lists the configurable parameters of the Drupal chart and th | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | | `volumeMounts.drupal.mountPath` | Drupal data volume mount path | `/bitnami/drupal` | | `volumeMounts.apache.mountPath` | Apache data volume mount path | `/bitnami/apache` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/drupal](http://github.com/bitnami/bitnami-docker-drupal). For more information please refer to the [bitnami/drupal](http://github.com/bitnami/bitnami-docker-drupal) image documentation. diff --git a/upstreamed/drupal/requirements.lock b/upstreamed/drupal/requirements.lock index aeb25e469..5f7b389b7 100644 --- a/upstreamed/drupal/requirements.lock +++ b/upstreamed/drupal/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.3 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:23:40.285763588+02:00 +generated: 2018-11-07T17:27:51.273910024Z diff --git a/upstreamed/drupal/templates/NOTES.txt b/upstreamed/drupal/templates/NOTES.txt index 811c6adbf..c9bb8da49 100644 --- a/upstreamed/drupal/templates/NOTES.txt +++ b/upstreamed/drupal/templates/NOTES.txt @@ -11,22 +11,24 @@ http://{{- .Values.ingress.hostname }}/ -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "drupal.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "drupal.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Drupal URL: http://$SERVICE_IP/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "Drupal URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + +{{- else if contains "ClusterIP" .Values.service.type }} echo "Drupal URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "drupal.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "drupal.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} Or running: diff --git a/upstreamed/drupal/templates/_helpers.tpl b/upstreamed/drupal/templates/_helpers.tpl index 33decfbd9..52d4f9577 100644 --- a/upstreamed/drupal/templates/_helpers.tpl +++ b/upstreamed/drupal/templates/_helpers.tpl @@ -28,4 +28,37 @@ Create chart name and version as used by the chart label. */}} {{- define "drupal.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Drupal image name +*/}} +{{- define "drupal.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/drupal/templates/deployment.yaml b/upstreamed/drupal/templates/deployment.yaml index 661d83e22..05121a469 100644 --- a/upstreamed/drupal/templates/deployment.yaml +++ b/upstreamed/drupal/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "drupal.fullname" . }} chart: {{ template "drupal.chart" . }} release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "drupal.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + - name: drupal + image: {{ template "drupal.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -104,6 +117,29 @@ spec: - name: apache-data mountPath: {{ .Values.volumeMounts.apache.mountPath }} {{- end }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: drupal-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/drupal/templates/svc.yaml b/upstreamed/drupal/templates/svc.yaml index 222e9d5b8..842b460a3 100644 --- a/upstreamed/drupal/templates/svc.yaml +++ b/upstreamed/drupal/templates/svc.yaml @@ -8,13 +8,22 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "drupal.fullname" . }} diff --git a/upstreamed/drupal/values.yaml b/upstreamed/drupal/values.yaml index dad9906d4..94996e698 100644 --- a/upstreamed/drupal/values.yaml +++ b/upstreamed/drupal/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Drupal image version ## ref: https://hub.docker.com/r/bitnami/drupal/tags/ ## image: registry: docker.io repository: bitnami/drupal - tag: 8.6.1-debian-9 + tag: 8.6.3 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -61,6 +67,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -105,7 +113,23 @@ mariadb: ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## Use ClusterIP if your setup includes ingress controller ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Configure the ingress resource that allows you to access the ## Drupal installation. Set up the URL @@ -222,3 +246,31 @@ readinessProbe: path: /user/login port: http initialDelaySeconds: 30 + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/ghost/Chart.yaml b/upstreamed/ghost/Chart.yaml index 19bba51e3..ef5cdd673 100644 --- a/upstreamed/ghost/Chart.yaml +++ b/upstreamed/ghost/Chart.yaml @@ -1,6 +1,6 @@ name: ghost -version: 5.2.0 -appVersion: 2.2.1 +version: 6.0.0 +appVersion: 2.6.0 description: A simple, powerful publishing platform that allows you to share your stories with the world keywords: diff --git a/upstreamed/ghost/README.md b/upstreamed/ghost/README.md index 3502cf09e..7b16b273d 100644 --- a/upstreamed/ghost/README.md +++ b/upstreamed/ghost/README.md @@ -47,52 +47,59 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the Ghost chart and their default values. -| Parameter | Description | Default | -|----------------------------------|---------------------------------------------------------------|----------------------------------------------------------| -| `image.registry` | Ghost image registry | `docker.io` | -| `image.repository` | Ghost Image name | `bitnami/ghost` | -| `image.tag` | Ghost Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `ghostHost` | Ghost host to create application URLs | `nil` | -| `ghostPath` | Ghost path to create application URLs | `nil` | -| `ghostPort` | Ghost port to create application URLs along with host | `80` | -| `ghostLoadBalancerIP` | `loadBalancerIP` for the Ghost Service | `nil` | -| `ghostUsername` | User of the application | `user@example.com` | -| `ghostPassword` | Application password | Randomly generated | -| `ghostEmail` | Admin email | `user@example.com` | -| `ghostBlogTitle` | Ghost Blog name | `User's Blog` | -| `allowEmptyPassword` | Allow DB blank passwords | `yes` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | -| `ingress.enabled` | Enable ingress controller resource | `false` | -| `ingress.hosts[0].name` | Hostname to your Ghost installation | `ghost.local` | -| `ingress.hosts[0].path` | Path within the url structure | `/` | -| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | -| `ingress.hosts[0].certManager` | Add annotations for cert-manager | `false` | -| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `ghost.local-tls-secret` | -| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | -| `ingress.secrets[0].name` | TLS Secret Name | `nil` | -| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | -| `ingress.secrets[0].key` | TLS Secret Key | `nil` | -| `externalDatabase.host` | Host of the external database | `nil` | -| `externalDatabase.port` | Port of the external database | `nil` | -| `externalDatabase.user` | Existing username in the external db | `bn_ghost` | -| `externalDatabase.password` | Password for the above username | `nil` | -| `externalDatabase.database` | Name of the existing database | `bitnami_ghost` | -| `mariadb.enabled` | Whether or not to install MariaDB (disable if using external) | `true` | -| `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `mariadb.db.name` | MariaDB Database name to create | `bitnami_ghost` | -| `mariadb.db.user` | MariaDB Database user to create | `bn_ghost` | -| `mariadb.db.password` | MariaDB Password for user | _random 10 character long alphanumeric string_ | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for Ghost volume | `nil` (uses alpha storage annotation) | -| `persistence.accessMode` | PVC Access Mode for Ghost volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for Ghost volume | `8Gi` | -| `persistence.path` | Path to mount the volume at, to use other images | `/bitnami` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| Parameter | Description | Default | +|-------------------------------------|---------------------------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | Ghost image registry | `docker.io` | +| `image.repository` | Ghost Image name | `bitnami/ghost` | +| `image.tag` | Ghost Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | +| `volumePermissions.image.repository`| Init container volume-permissions image name | `bitnami/minideb` | +| `volumePermissions.image.tag` | Init container volume-permissions image tag | `latest` | +| `volumePermissions.image.pullPolicy`| Init container volume-permissions image pull policy | `Always` | +| `ghostHost` | Ghost host to create application URLs | `nil` | +| `ghostPath` | Ghost path to create application URLs | `nil` | +| `ghostUsername` | User of the application | `user@example.com` | +| `ghostPassword` | Application password | Randomly generated | +| `ghostEmail` | Admin email | `user@example.com` | +| `ghostBlogTitle` | Ghost Blog name | `User's Blog` | +| `allowEmptyPassword` | Allow DB blank passwords | `yes` | +| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.hosts[0].name` | Hostname to your Ghost installation | `ghost.local` | +| `ingress.hosts[0].path` | Path within the url structure | `/` | +| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ingress.hosts[0].certManager` | Add annotations for cert-manager | `false` | +| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `ghost.local-tls-secret` | +| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `externalDatabase.host` | Host of the external database | `nil` | +| `externalDatabase.port` | Port of the external database | `nil` | +| `externalDatabase.user` | Existing username in the external db | `bn_ghost` | +| `externalDatabase.password` | Password for the above username | `nil` | +| `externalDatabase.database` | Name of the existing database | `bitnami_ghost` | +| `mariadb.enabled` | Whether or not to install MariaDB (disable if using external) | `true` | +| `mariadb.rootUser.password` | MariaDB admin password | `nil` | +| `mariadb.db.name` | MariaDB Database name to create | `bitnami_ghost` | +| `mariadb.db.user` | MariaDB Database user to create | `bn_ghost` | +| `mariadb.db.password` | MariaDB Password for user | _random 10 character long alphanumeric string_ | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.storageClass` | PVC Storage Class for Ghost volume | `nil` (uses alpha storage annotation) | +| `persistence.accessMode` | PVC Access Mode for Ghost volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for Ghost volume | `8Gi` | +| `persistence.path` | Path to mount the volume at, to use other images | `/bitnami` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | The above parameters map to the env variables defined in [bitnami/ghost](http://github.com/bitnami/bitnami-docker-ghost). For more information please refer to the [bitnami/ghost](http://github.com/bitnami/bitnami-docker-ghost) image documentation. diff --git a/upstreamed/ghost/requirements.lock b/upstreamed/ghost/requirements.lock index 9121d7d47..ed15407e4 100644 --- a/upstreamed/ghost/requirements.lock +++ b/upstreamed/ghost/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.1.1 + version: 5.2.3 digest: sha256:b3053e73f5c114f55a794eccea2606cc9fe8a669eaab1716246994bbdd37a473 -generated: 2018-10-11T10:01:18.165751169Z +generated: 2018-11-07T23:03:33.306837234Z diff --git a/upstreamed/ghost/templates/NOTES.txt b/upstreamed/ghost/templates/NOTES.txt index 59f483072..e8bfc24f6 100644 --- a/upstreamed/ghost/templates/NOTES.txt +++ b/upstreamed/ghost/templates/NOTES.txt @@ -8,32 +8,37 @@ host. To configure Ghost with the URL of your service: 1. Get the Ghost URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "ghost.fullname" . }}' export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "ghost.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "ghost.fullname" . }} -o jsonpath="{.data.ghost-password}" | base64 --decode) + {{- if .Values.mariadb.mariadbRootPassword }} + export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "ghost.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} + {{- end }} + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "ghost.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-password}" | base64 --decode) 2. Complete your Ghost deployment by running: - helm upgrade {{ .Release.Name }} \ - --set serviceType={{ .Values.serviceType }},ghostHost=$APP_HOST stable/ghost + helm upgrade {{ .Release.Name }} stable/ghost\ + --set service.type={{ .Values.service.type }},ghostHost=$APP_HOST,ghostPassword=$APP_PASSWORD,{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$DATABASE_ROOT_PASSWORD{{ end }}mariadb.db.password=$APP_DATABASE_PASSWORD {{- else -}} 1. Get the Ghost URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} - echo Blog URL : http://127.0.0.1:{{ default "80" .Values.ghostPort }}{{ .Values.ghostPath }} - echo Admin URL : http://127.0.0.1:{{ default "80" .Values.ghostPort }}{{ .Values.ghostPath }}ghost - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "ghost.fullname" . }} {{ default "80" .Values.ghostPort }}:2368 + echo Blog URL : http://127.0.0.1:{{ default "80" .Values.service.port }}{{ .Values.ghostPath }} + echo Admin URL : http://127.0.0.1:{{ default "80" .Values.service.port }}{{ .Values.ghostPath }}ghost + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "ghost.fullname" . }} {{ default "80" .Values.service.port }}:2368 -{{- else if eq .Values.serviceType "NodePort" }} +{{- else if eq .Values.service.type "NodePort" }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export APP_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "ghost.fullname" . }}) diff --git a/upstreamed/ghost/templates/_helpers.tpl b/upstreamed/ghost/templates/_helpers.tpl index 2c034934e..993f0c149 100644 --- a/upstreamed/ghost/templates/_helpers.tpl +++ b/upstreamed/ghost/templates/_helpers.tpl @@ -37,7 +37,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "ghost.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -63,3 +63,49 @@ Create chart name and version as used by the chart label. {{- define "ghost.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Ghost image name +*/}} +{{- define "ghost.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name to change the volume permissions +*/}} +{{- define "ghost.volumePermissions.image" -}} +{{- $registryName := .Values.volumePermissions.image.registry -}} +{{- $repositoryName := .Values.volumePermissions.image.repository -}} +{{- $tag := .Values.volumePermissions.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/upstreamed/ghost/templates/deployment.yaml b/upstreamed/ghost/templates/deployment.yaml index b5e83d2b0..b828be447 100644 --- a/upstreamed/ghost/templates/deployment.yaml +++ b/upstreamed/ghost/templates/deployment.yaml @@ -28,8 +28,8 @@ spec: {{- else }} initContainers: - name: volume-permissions - image: "{{ .Values.volumePermissions.image.name }}:{{ .Values.volumePermissions.image.tag }}" - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} + image: {{ template "ghost.volumePermissions.image" . }} + imagePullPolicy: "{{ .Values.volumePermissions.image.pullPolicy }}" command: ['sh', '-c', 'chmod -R g+rwX {{ .Values.persistence.path }}'] volumeMounts: - mountPath: {{ .Values.persistence.path }} @@ -43,7 +43,7 @@ spec: {{- end }} containers: - name: {{ template "ghost.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "ghost.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -88,7 +88,7 @@ spec: - name: GHOST_HOST value: {{ include "ghost.host" . | quote }} - name: GHOST_PORT_NUMBER - value: {{ .Values.ghostPort | quote }} + value: {{ .Values.service.port | quote }} - name: GHOST_USERNAME value: {{ .Values.ghostUsername | quote }} - name: GHOST_PASSWORD diff --git a/upstreamed/ghost/templates/svc.yaml b/upstreamed/ghost/templates/svc.yaml index d3d7e2663..2cfcf9801 100644 --- a/upstreamed/ghost/templates/svc.yaml +++ b/upstreamed/ghost/templates/svc.yaml @@ -8,13 +8,16 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ .Values.ghostLoadBalancerIP }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} ports: - - name: http - port: {{ .Values.ghostPort }} - targetPort: http + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "ghost.fullname" . }} diff --git a/upstreamed/ghost/values.yaml b/upstreamed/ghost/values.yaml index 2ce665b44..a9a5a3101 100644 --- a/upstreamed/ghost/values.yaml +++ b/upstreamed/ghost/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Ghost image version ## ref: https://hub.docker.com/r/bitnami/ghost/tags/ ## image: registry: docker.io repository: bitnami/ghost - tag: 2.2.1-debian-9 + tag: 2.6.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -17,13 +23,16 @@ image: # pullSecrets: # - myRegistrKeySecretName -## Busybox image used to configure volume permissions +## +## Init containers parameters: +## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup ## volumePermissions: image: - name: busybox - tag: 1.28.3 -# pullPolicy: + registry: docker.io + repository: bitnami/minideb + tag: latest + pullPolicy: Always ## Ghost host and path to create application URLs ## ref: https://github.com/bitnami/bitnami-docker-ghost#configuration @@ -31,15 +40,6 @@ volumePermissions: # ghostHost: ghostPath: / -## Ghost port to create application URLs along with host. -## ref: https://github.com/bitnami/bitnami-docker-ghost#configuration -## -ghostPort: 80 - -## loadBalancerIP for the Ghost Service (optional, cloud specific) -## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer -## -ghostLoadBalancerIP: "" ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-ghost#configuration @@ -97,6 +97,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -140,7 +142,19 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + ## + ## nodePorts: + ## http: + nodePorts: + http: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ diff --git a/upstreamed/jasperreports/Chart.yaml b/upstreamed/jasperreports/Chart.yaml index 4ba784b24..a4d1d4198 100644 --- a/upstreamed/jasperreports/Chart.yaml +++ b/upstreamed/jasperreports/Chart.yaml @@ -1,5 +1,5 @@ name: jasperreports -version: 3.0.3 +version: 4.0.0 appVersion: 7.1.0 description: The JasperReports server can be used as a stand-alone or embedded reporting and BI server that offers web-based reporting, analytic tools and visualization, diff --git a/upstreamed/jasperreports/README.md b/upstreamed/jasperreports/README.md index 42aac6131..858f29657 100644 --- a/upstreamed/jasperreports/README.md +++ b/upstreamed/jasperreports/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the JasperReports chart | Parameter | Description | Default | |-------------------------------|----------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | JasperReports image registry | `docker.io` | | `image.repository` | JasperReports Image name | `bitnami/jasperreports` | | `image.tag` | JasperReports Image tag | `{VERSION}` | @@ -74,7 +75,10 @@ The following table lists the configurable parameters of the JasperReports chart | `mariadb.db.user` | Database user to create | `bn_jasperreports` | | `mariadb.db.password` | Password for the database | `nil` | | `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.port` | Service HTTP port | `80` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.storageClass` | PVC Storage Class for JasperReports volume | `nil` (uses alpha storage annotation) | | `persistence.accessMode` | PVC Access Mode for JasperReports volume | `ReadWriteOnce` | diff --git a/upstreamed/jasperreports/requirements.lock b/upstreamed/jasperreports/requirements.lock index 2b5c4a4eb..69f8a3808 100644 --- a/upstreamed/jasperreports/requirements.lock +++ b/upstreamed/jasperreports/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:30:38.012477426+02:00 +generated: 2018-10-16T08:48:01.960359+02:00 diff --git a/upstreamed/jasperreports/templates/NOTES.txt b/upstreamed/jasperreports/templates/NOTES.txt index c36d47d59..c7c9717b7 100644 --- a/upstreamed/jasperreports/templates/NOTES.txt +++ b/upstreamed/jasperreports/templates/NOTES.txt @@ -3,24 +3,26 @@ 1. Get the JasperReports URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "jasperreports.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "JasperReports URL: http://$NODE_IP:$NODE_PORT/" -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "jasperreports.fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "jasperreports.fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "jasperreports.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "JasperReports URL: http://$SERVICE_IP/jasperserver/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "JasperReports URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/jasperserver/" + +{{- else if contains "ClusterIP" .Values.service.type }} echo "JasperReports URL: http://127.0.0.1:8080/jasperserver/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "jasperreports.fullname" . }} 8080:8080 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "jasperreports.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} @@ -41,6 +43,6 @@ host. To configure JasperReports to use and external database host: 1. Complete your JasperReports deployment by running: - helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/jasperreports + helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/jasperreports {{- end }} diff --git a/upstreamed/jasperreports/templates/_helpers.tpl b/upstreamed/jasperreports/templates/_helpers.tpl index faadb6d8d..f6f27cda9 100644 --- a/upstreamed/jasperreports/templates/_helpers.tpl +++ b/upstreamed/jasperreports/templates/_helpers.tpl @@ -22,3 +22,26 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "jasperreports.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Jasper Reports image name +*/}} +{{- define "jasperreports.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/upstreamed/jasperreports/templates/deployment.yaml b/upstreamed/jasperreports/templates/deployment.yaml index d4ca76283..b75d5df39 100644 --- a/upstreamed/jasperreports/templates/deployment.yaml +++ b/upstreamed/jasperreports/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- end }} containers: - name: {{ template "jasperreports.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "jasperreports.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD diff --git a/upstreamed/jasperreports/templates/svc.yaml b/upstreamed/jasperreports/templates/svc.yaml index 640df13ef..d7aa3ed93 100644 --- a/upstreamed/jasperreports/templates/svc.yaml +++ b/upstreamed/jasperreports/templates/svc.yaml @@ -8,10 +8,16 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "jasperreports.fullname" . }} diff --git a/upstreamed/jasperreports/values.yaml b/upstreamed/jasperreports/values.yaml index 55f1b25de..7745c3632 100644 --- a/upstreamed/jasperreports/values.yaml +++ b/upstreamed/jasperreports/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami JasperReports image version ## ref: https://hub.docker.com/r/bitnami/dokuwiki/tags/ ## image: registry: docker.io repository: bitnami/jasperreports - tag: 7.1.0-debian-9 + tag: 7.1.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -70,6 +76,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -113,7 +121,20 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ diff --git a/upstreamed/joomla/Chart.yaml b/upstreamed/joomla/Chart.yaml index 16e20a66f..4869f7708 100644 --- a/upstreamed/joomla/Chart.yaml +++ b/upstreamed/joomla/Chart.yaml @@ -1,6 +1,6 @@ name: joomla -version: 3.2.0 -appVersion: 3.8.13 +version: 4.0.0 +appVersion: 3.9.0 description: PHP content management system (CMS) for publishing web content keywords: - joomla diff --git a/upstreamed/joomla/README.md b/upstreamed/joomla/README.md index 4eff3ab4e..127b262c2 100644 --- a/upstreamed/joomla/README.md +++ b/upstreamed/joomla/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Joomla! chart and t | Parameter | Description | Default | | ------------------------------------ | ----------------------------------------------------------- | ---------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Joomla! image registry | `docker.io` | | `image.repository` | Joomla! Image name | `bitnami/joomla` | | `image.tag` | Joomla! Image tag | `{VERSION}` | @@ -76,6 +77,8 @@ The following table lists the configurable parameters of the Joomla! chart and t | `mariadb.db.password` | Password for the database | `nil` | | `mariadb.root.password` | MariaDB admin password | `nil` | | `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | | `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.nodePorts.http` | Kubernetes http node port | `""` | @@ -113,6 +116,15 @@ The following table lists the configurable parameters of the Joomla! chart and t | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | List of node taints to tolerate | `[]` | | `affinity` | Map of node/pod affinities | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/joomla](http://github.com/bitnami/bitnami-docker-joomla). For more information please refer to the [bitnami/joomla](http://github.com/bitnami/bitnami-docker-joomla) image documentation. diff --git a/upstreamed/joomla/requirements.lock b/upstreamed/joomla/requirements.lock index 81c37e093..ae55aa516 100644 --- a/upstreamed/joomla/requirements.lock +++ b/upstreamed/joomla/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.1.1 + version: 5.2.2 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-10-11T04:07:42.662012144Z +generated: 2018-10-30T16:57:15.548981979Z diff --git a/upstreamed/joomla/templates/NOTES.txt b/upstreamed/joomla/templates/NOTES.txt index 009d8f446..fe3caeba4 100644 --- a/upstreamed/joomla/templates/NOTES.txt +++ b/upstreamed/joomla/templates/NOTES.txt @@ -27,12 +27,14 @@ Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "joomla.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "joomla.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Joomla! URL: http://$SERVICE_IP/" + +{{- $port:=.Values.service.port | toString }} + echo "Joomla! URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} echo "Joomla! URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "joomla.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "joomla.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} {{- end }} diff --git a/upstreamed/joomla/templates/_helpers.tpl b/upstreamed/joomla/templates/_helpers.tpl index 58ab48ed1..90fb598eb 100644 --- a/upstreamed/joomla/templates/_helpers.tpl +++ b/upstreamed/joomla/templates/_helpers.tpl @@ -26,8 +26,23 @@ Create chart name and version as used by the chart label. Return the proper Joomla! image name */}} {{- define "joomla.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -37,3 +52,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "joomla.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/joomla/templates/deployment.yaml b/upstreamed/joomla/templates/deployment.yaml index 1032233c8..78b7ad1de 100644 --- a/upstreamed/joomla/templates/deployment.yaml +++ b/upstreamed/joomla/templates/deployment.yaml @@ -20,6 +20,15 @@ spec: app: {{ template "joomla.fullname" . }} chart: {{ template "joomla.chart" . }} release: {{ .Release.Name | quote }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -27,8 +36,12 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "joomla.fullname" . }} + - name: joomla image: {{ template "joomla.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: @@ -129,6 +142,29 @@ spec: mountPath: /bitnami/joomla - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: joomla-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/joomla/templates/svc.yaml b/upstreamed/joomla/templates/svc.yaml index 885e1a3a8..4759953c4 100644 --- a/upstreamed/joomla/templates/svc.yaml +++ b/upstreamed/joomla/templates/svc.yaml @@ -17,13 +17,13 @@ spec: {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port }} targetPort: http {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} nodePort: {{ .Values.service.nodePorts.http }} {{- end }} - name: https - port: 443 + port: {{ .Values.service.httpsPort }} targetPort: https {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} nodePort: {{ .Values.service.nodePorts.https }} diff --git a/upstreamed/joomla/values.yaml b/upstreamed/joomla/values.yaml index 7234205fb..6bcb6eafa 100644 --- a/upstreamed/joomla/values.yaml +++ b/upstreamed/joomla/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Joomla! image version ## ref: https://hub.docker.com/r/bitnami/dokuwiki/tags/ ## image: registry: docker.io repository: bitnami/joomla - tag: 3.8.13-debian-9 + tag: 3.9.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -69,6 +75,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -112,7 +120,7 @@ mariadb: ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: - enbaled: true + enabled: true initialDelaySeconds: 120 periodSeconds: 10 timeoutSeconds: 5 @@ -136,6 +144,10 @@ service: ## Use serviceLoadBalancerIP to request a specific static IP, ## otherwise leave blank ## + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 # loadBalancerIP: ## Use nodePorts to requets some specific ports when usin NodePort ## nodePorts: @@ -246,3 +258,33 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/kubewatch/Chart.yaml b/upstreamed/kubewatch/Chart.yaml index 17562d0e7..35e38308e 100644 --- a/upstreamed/kubewatch/Chart.yaml +++ b/upstreamed/kubewatch/Chart.yaml @@ -1,5 +1,5 @@ name: kubewatch -version: 0.4.2 +version: 0.5.2 apiVersion: v1 appVersion: v0.0.4 home: https://github.com/bitnami-labs/kubewatch diff --git a/upstreamed/kubewatch/OWNERS b/upstreamed/kubewatch/OWNERS index 0db6eaa01..18436629f 100644 --- a/upstreamed/kubewatch/OWNERS +++ b/upstreamed/kubewatch/OWNERS @@ -1,6 +1,14 @@ approvers: - compleatang +- prydonius - tompizmor +- sameersbn +- carrodher +- juan131 reviewers: - compleatang -- tompizmor \ No newline at end of file +- prydonius +- tompizmor +- sameersbn +- carrodher +- juan131 diff --git a/upstreamed/kubewatch/README.md b/upstreamed/kubewatch/README.md index 97900db14..e454eee40 100644 --- a/upstreamed/kubewatch/README.md +++ b/upstreamed/kubewatch/README.md @@ -39,6 +39,7 @@ The following table lists the configurable parameters of the kubewatch chart and | Parameter | Description | Default | | ---------------------------------------- | ------------------------------------ | --------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `affinity` | node/pod affinities | None | | `image.registry` | Image registry | `docker.io` | | `image.repository` | Image repository | `bitnami/kubewatch` | @@ -50,7 +51,7 @@ The following table lists the configurable parameters of the kubewatch chart and | `replicaCount` | desired number of pods | `1` | | `rbac.create` | If true, create & use RBAC resources | `true` | | `serviceAccount.create` | If true, create a serviceAccount | `true` | -| `serviceAccount.name` | existing ServiceAccount to use (ignored if rbac.create=true) | `` | +| `serviceAccount.name` | existing ServiceAccount to use (ignored if rbac.create=true) | `` | | `resources` | pod resource requests & limits | `{}` | | `slack.channel` | Slack channel to notify | `""` | | `slack.token` | Slack API token | `""` | diff --git a/upstreamed/kubewatch/templates/_helpers.tpl b/upstreamed/kubewatch/templates/_helpers.tpl index 3e3d9656f..baf5c90e4 100644 --- a/upstreamed/kubewatch/templates/_helpers.tpl +++ b/upstreamed/kubewatch/templates/_helpers.tpl @@ -31,7 +31,6 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} - {{/* Create the name of the service account to use */}} @@ -41,4 +40,27 @@ Create the name of the service account to use {{- else -}} {{ default "default" .Values.serviceAccount.name }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Kubewatch image name +*/}} +{{- define "kubewatch.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/upstreamed/kubewatch/templates/deployment.yaml b/upstreamed/kubewatch/templates/deployment.yaml index 35db9cc7f..d95be8622 100644 --- a/upstreamed/kubewatch/templates/deployment.yaml +++ b/upstreamed/kubewatch/templates/deployment.yaml @@ -23,13 +23,14 @@ spec: labels: app: {{ template "kubewatch.name" . }} release: "{{ .Release.Name }}" + chart: {{ template "kubewatch.chart" . }} {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} spec: containers: - name: {{ template "kubewatch.name" . }} - image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} + image: {{ template "kubewatch.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: {{ template "kubewatch.name" . }}-config-map @@ -53,4 +54,3 @@ spec: - name: {{ template "kubewatch.name" . }}-config-map configMap: name: {{ template "kubewatch.fullname" . }}-config - diff --git a/upstreamed/kubewatch/values.yaml b/upstreamed/kubewatch/values.yaml index 2b0de1953..157125ee0 100644 --- a/upstreamed/kubewatch/values.yaml +++ b/upstreamed/kubewatch/values.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + slack: # Slack channel to notify channel: "XXXX" diff --git a/upstreamed/magento/Chart.yaml b/upstreamed/magento/Chart.yaml index 1e3fbf74e..f0d8fd138 100644 --- a/upstreamed/magento/Chart.yaml +++ b/upstreamed/magento/Chart.yaml @@ -1,5 +1,5 @@ name: magento -version: 3.0.4 +version: 4.0.0 appVersion: 2.2.6 description: A feature-rich flexible e-commerce solution. It includes transaction options, multi-store functionality, loyalty programs, product categorization and shopper filtering, promotion rules, and more. keywords: diff --git a/upstreamed/magento/README.md b/upstreamed/magento/README.md index 03f9f40d9..e1bbc4def 100644 --- a/upstreamed/magento/README.md +++ b/upstreamed/magento/README.md @@ -47,42 +47,64 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the Magento chart and their default values. -| Parameter | Description | Default | -|------------------------------------|------------------------------------------|----------------------------------------------------------| -| `image.registry` | Magento image registry | `docker.io` | -| `image.repository` | Magento Image name | `bitnami/magento` | -| `image.tag` | Magento Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `magentoHost` | Magento host to create application URLs | `nil` | -| `magentoLoadBalancerIP` | `loadBalancerIP` for the magento Service | `nil` | -| `magentoUsername` | User of the application | `user` | -| `magentoPassword` | Application password | _random 10 character long alphanumeric string_ | -| `magentoEmail` | Admin email | `user@example.com` | -| `magentoFirstName` | Magento Admin First Name | `FirstName` | -| `magentoLastName` | Magento Admin Last Name | `LastName` | -| `magentoMode` | Magento mode | `developer` | -| `magentoAdminUri` | Magento prefix to access Magento Admin | `admin` | -| `allowEmptyPassword` | Allow DB blank passwords | `yes` | -| `externalDatabase.host` | Host of the external database | `nil` | -| `externalDatabase.port` | Port of the external database | `3306` | -| `externalDatabase.user` | Existing username in the external db | `bn_magento` | -| `externalDatabase.password` | Password for the above username | `nil` | -| `externalDatabase.database` | Name of the existing database | `bitnami_magento` | -| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | -| `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `mariadb.db.name` | Database name to create | `bitnami_magento` | -| `mariadb.db.user` | Database user to create | `bn_magento` | -| `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage annotation) | -| `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.magento.storageClass` | PVC Storage Class for Magento volume | `nil` (uses alpha storage annotation) | -| `persistence.magento.accessMode` | PVC Access Mode for Magento volume | `ReadWriteOnce` | -| `persistence.magento.size` | PVC Storage Request for Magento volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| Parameter | Description | Default | +|--------------------------------------|--------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | Magento image registry | `docker.io` | +| `image.repository` | Magento Image name | `bitnami/magento` | +| `image.tag` | Magento Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `magentoHost` | Magento host to create application URLs | `nil` | +| `magentoLoadBalancerIP` | `loadBalancerIP` for the magento Service | `nil` | +| `magentoUsername` | User of the application | `user` | +| `magentoPassword` | Application password | _random 10 character long alphanumeric string_ | +| `magentoEmail` | Admin email | `user@example.com` | +| `magentoFirstName` | Magento Admin First Name | `FirstName` | +| `magentoLastName` | Magento Admin Last Name | `LastName` | +| `magentoMode` | Magento mode | `developer` | +| `magentoAdminUri` | Magento prefix to access Magento Admin | `admin` | +| `allowEmptyPassword` | Allow DB blank passwords | `yes` | +| `externalDatabase.host` | Host of the external database | `nil` | +| `externalDatabase.port` | Port of the external database | `3306` | +| `externalDatabase.user` | Existing username in the external db | `bn_magento` | +| `externalDatabase.password` | Password for the above username | `nil` | +| `externalDatabase.database` | Name of the existing database | `bitnami_magento` | +| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | +| `mariadb.rootUser.password` | MariaDB admin password | `nil` | +| `mariadb.db.name` | Database name to create | `bitnami_magento` | +| `mariadb.db.user` | Database user to create | `bn_magento` | +| `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | +| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `livenessProbe.enabled` | Turn on and off liveness probe | `true` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `1000` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe| `1` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe | `6` | +| `readinessProbe.enabled` | Turn on and off readiness probe | `true` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `5` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `3` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe| `1` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe | `3` | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage annotation) | +| `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | +| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | +| `persistence.magento.storageClass` | PVC Storage Class for Magento volume | `nil` (uses alpha storage annotation) | +| `persistence.magento.accessMode` | PVC Access Mode for Magento volume | `ReadWriteOnce` | +| `persistence.magento.size` | PVC Storage Request for Magento volume | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/magento](http://github.com/bitnami/bitnami-docker-magento). For more information please refer to the [bitnami/magento](http://github.com/bitnami/bitnami-docker-magento) image documentation. diff --git a/upstreamed/magento/requirements.lock b/upstreamed/magento/requirements.lock index c56f25d5e..908afbe57 100644 --- a/upstreamed/magento/requirements.lock +++ b/upstreamed/magento/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:35:19.787082498+02:00 +generated: 2018-10-16T08:48:29.636469+02:00 diff --git a/upstreamed/magento/templates/NOTES.txt b/upstreamed/magento/templates/NOTES.txt index 6f0a4ab2e..65486ca54 100644 --- a/upstreamed/magento/templates/NOTES.txt +++ b/upstreamed/magento/templates/NOTES.txt @@ -10,12 +10,12 @@ host. To configure Magento with the URL of your service: 1. Get the Magento URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "magento.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "magento.fullname" . }}' @@ -39,22 +39,23 @@ host. To configure Magento with the URL of your service: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/magento \ - --set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} + --set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} {{- end }} {{- else -}} 1. Get the Magento URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo "Store URL: http://127.0.0.1:8080/" echo "Admin URL: http://127.0.0.1:8080/{{ .Values.magentoAdminUri }}" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "magento.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "magento.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} - echo Store URL : http://{{ include "magento.host" . }}/ - echo Admin URL : http://{{ include "magento.host" . }}/{{ .Values.magentoAdminUri }} +{{- $port:=.Values.service.port | toString }} + echo Store URL : http://{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/ + echo Admin URL : http://{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/{{ .Values.magentoAdminUri }} {{- end }} @@ -76,9 +77,9 @@ host. To configure Magento to use and external database host: 1. Complete your Magento deployment by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "magento.fullname" . }}' @@ -93,5 +94,5 @@ host. To configure Magento to use and external database host: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/magento \ - --set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST + --set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST {{- end }} diff --git a/upstreamed/magento/templates/_helpers.tpl b/upstreamed/magento/templates/_helpers.tpl index 7501c78a0..c032a3f24 100644 --- a/upstreamed/magento/templates/_helpers.tpl +++ b/upstreamed/magento/templates/_helpers.tpl @@ -44,7 +44,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "magento.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -59,3 +59,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "magento.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Magento image name +*/}} +{{- define "magento.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/magento/templates/deployment.yaml b/upstreamed/magento/templates/deployment.yaml index c1b83f81f..d3748050e 100644 --- a/upstreamed/magento/templates/deployment.yaml +++ b/upstreamed/magento/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "magento.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "magento.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "magento.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: MARIADB_HOST @@ -65,8 +78,9 @@ spec: name: {{ template "magento.fullname" . }}-externaldb key: db-password {{- end }} + {{- $port:=.Values.service.port | toString }} - name: MAGENTO_HOST - value: {{ include "magento.host" . | quote }} + value: "{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" - name: MAGENTO_USERNAME value: {{ .Values.magentoUsername | quote }} - name: MAGENTO_PASSWORD @@ -89,6 +103,7 @@ spec: containerPort: 80 - name: https containerPort: 443 + {{- if .Values.livenessProbe.enabled }} livenessProbe: httpGet: path: /index.php @@ -96,9 +111,13 @@ spec: httpHeaders: - name: Host value: {{ include "magento.host" . | quote }} - initialDelaySeconds: 1000 - timeoutSeconds: 5 - failureThreshold: 6 + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} readinessProbe: httpGet: path: /index.php @@ -106,9 +125,12 @@ spec: httpHeaders: - name: Host value: {{ include "magento.host" . | quote }} - initialDelaySeconds: 30 - timeoutSeconds: 3 - periodSeconds: 5 + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: @@ -116,6 +138,29 @@ spec: mountPath: /bitnami/magento - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: magento-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/magento/templates/svc.yaml b/upstreamed/magento/templates/svc.yaml index 93f2438e9..d20d17a32 100644 --- a/upstreamed/magento/templates/svc.yaml +++ b/upstreamed/magento/templates/svc.yaml @@ -8,16 +8,16 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ default "" .Values.magentoLoadBalancerIP }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "magento.fullname" . }} diff --git a/upstreamed/magento/values.yaml b/upstreamed/magento/values.yaml index 6830d1767..8459bd832 100644 --- a/upstreamed/magento/values.yaml +++ b/upstreamed/magento/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Magento image version ## ref: https://hub.docker.com/r/bitnami/magento/tags/ ## image: registry: docker.io repository: bitnami/magento - tag: 2.2.6-debian-9 + tag: 2.2.6 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -89,6 +95,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -132,7 +140,41 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + +## Configure liveness and readiness probes +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) +## +livenessProbe: + enabled: true + initialDelaySeconds: 1000 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 6 +readinessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 5 + timeoutSeconds: 3 + successThreshold: 1 + failureThreshold: 3 ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -169,3 +211,32 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/mariadb/Chart.yaml b/upstreamed/mariadb/Chart.yaml index 47fff6e69..c8acad2cd 100644 --- a/upstreamed/mariadb/Chart.yaml +++ b/upstreamed/mariadb/Chart.yaml @@ -1,6 +1,6 @@ name: mariadb -version: 5.1.2 -appVersion: 10.1.36 +version: 5.2.3 +appVersion: 10.1.37 description: Fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Highly available MariaDB cluster. keywords: - mariadb diff --git a/upstreamed/mariadb/README.md b/upstreamed/mariadb/README.md index 71f9a15aa..557de504e 100644 --- a/upstreamed/mariadb/README.md +++ b/upstreamed/mariadb/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the MariaDB chart and t | Parameter | Description | Default | |-------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | MariaDB image registry | `docker.io` | | `image.repository` | MariaDB Image name | `bitnami/mariadb` | | `image.tag` | MariaDB Image tag | `{VERSION}` | @@ -166,7 +167,7 @@ It's necessary to set the `rootUser.password` parameter when upgrading for readi $ helm upgrade my-release stable/mariadb --set rootUser.password=[ROOT_PASSWORD] ``` -| Note: you need to substitue the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes. +| Note: you need to substitute the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes. ### To 5.0.0 diff --git a/upstreamed/mariadb/templates/_helpers.tpl b/upstreamed/mariadb/templates/_helpers.tpl index 5afe380ff..9d785167b 100644 --- a/upstreamed/mariadb/templates/_helpers.tpl +++ b/upstreamed/mariadb/templates/_helpers.tpl @@ -23,7 +23,6 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{- end -}} - {{- define "slave.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb-slave" | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -33,17 +32,30 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{/* -Return the proper image name +Return the proper MariaDB image name */}} {{- define "mariadb.image" -}} -{{- $registryName := .Values.image.registry -}} +{{- $registryName := .Values.image.registry -}} {{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* -Return the proper image name +Return the proper metrics image name */}} {{- define "metrics.image" -}} {{- $registryName := .Values.metrics.image.registry -}} diff --git a/upstreamed/mariadb/templates/test-runner.yaml b/upstreamed/mariadb/templates/test-runner.yaml index 99a85d4aa..e1931e2d5 100644 --- a/upstreamed/mariadb/templates/test-runner.yaml +++ b/upstreamed/mariadb/templates/test-runner.yaml @@ -20,7 +20,7 @@ spec: name: tools containers: - name: mariadb-test - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "mariadb.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} command: ["/tools/bats/bats", "-t", "/tests/run.sh"] env: diff --git a/upstreamed/mariadb/values-production.yaml b/upstreamed/mariadb/values-production.yaml index 3b19bd509..05901dea2 100644 --- a/upstreamed/mariadb/values-production.yaml +++ b/upstreamed/mariadb/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami MariaDB image ## ref: https://hub.docker.com/r/bitnami/mariadb/tags/ ## image: registry: docker.io repository: bitnami/mariadb - tag: 10.1.36-debian-9 + tag: 10.1.37 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/upstreamed/mariadb/values.yaml b/upstreamed/mariadb/values.yaml index 0bdec13f3..85dbde720 100644 --- a/upstreamed/mariadb/values.yaml +++ b/upstreamed/mariadb/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami MariaDB image ## ref: https://hub.docker.com/r/bitnami/mariadb/tags/ ## image: registry: docker.io repository: bitnami/mariadb - tag: 10.1.36-debian-9 + tag: 10.1.37 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/upstreamed/mediawiki/Chart.yaml b/upstreamed/mediawiki/Chart.yaml index 6d4e168f3..49be0e54f 100644 --- a/upstreamed/mediawiki/Chart.yaml +++ b/upstreamed/mediawiki/Chart.yaml @@ -1,5 +1,5 @@ name: mediawiki -version: 4.1.0 +version: 6.0.0 appVersion: 1.31.1 description: Extremely powerful, scalable software and a feature-rich wiki implementation that uses PHP to process and display data stored in a database. diff --git a/upstreamed/mediawiki/README.md b/upstreamed/mediawiki/README.md index 89988ec36..0cd9c9610 100644 --- a/upstreamed/mediawiki/README.md +++ b/upstreamed/mediawiki/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the MediaWiki chart and | Parameter | Description | Default | |--------------------------------------|-------------------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | MediaWiki image registry | `docker.io` | | `image.repository` | MediaWiki Image name | `bitnami/mediawiki` | | `image.tag` | MediaWiki Image tag | `{VERSION}` | @@ -75,6 +76,8 @@ The following table lists the configurable parameters of the MediaWiki chart and | `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | | `service.type` | Kubernetes Service type | `LoadBalancer` | | `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.nodePorts.http` | Kubernetes http node port | `""` | | `service.nodePorts.https` | Kubernetes https node port | `""` | @@ -89,12 +92,10 @@ The following table lists the configurable parameters of the MediaWiki chart and | `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | | `ingress.secrets[0].key` | TLS Secret Key | `nil` | | `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | -| `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.mediawiki.storageClass` | PVC Storage Class for MediaWiki volume | `nil` (uses alpha storage class annotation) | -| `persistence.mediawiki.accessMode` | PVC Access Mode for MediaWiki volume | `ReadWriteOnce` | -| `persistence.mediawiki.size` | PVC Storage Request for MediaWiki volume | `8Gi` | +| `persistence.storageClass` | PVC Storage Class for MediaWiki volume | `nil` (uses alpha storage class annotation) | +| `persistence.existingClaim` | An Existing PVC name for MediaWiki volume | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | PVC Access Mode for MediaWiki volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for MediaWiki volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | | `livenessProbe.enabled` | Enable/disable the liveness probe (ingest nodes pod) | `true` | | `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (ingest nodes pod) | 120 | @@ -108,6 +109,15 @@ The following table lists the configurable parameters of the MediaWiki chart and | `readinessProbe.timeoutSeconds` | When the probe times out (ingest nodes pod) | 5 | | `readinessProbe.failureThreshold` | Minimum consecutive failures to be considered failed | 6 | | `readinessProbe.successThreshold` | Minimum consecutive successes to be considered successful | 1 | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/mediawiki](http://github.com/bitnami/bitnami-docker-mediawiki). For more information please refer to the [bitnami/mediawiki](http://github.com/bitnami/bitnami-docker-mediawiki) image documentation. diff --git a/upstreamed/mediawiki/requirements.lock b/upstreamed/mediawiki/requirements.lock index 509b5fa3f..12f073a4a 100644 --- a/upstreamed/mediawiki/requirements.lock +++ b/upstreamed/mediawiki/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:7043c28f05b6aac3615a61e609bddc958b51bea717afa81455d7d34641cdd906 -generated: 2018-09-25T11:40:02.188164295+02:00 +generated: 2018-10-16T08:48:39.403302+02:00 diff --git a/upstreamed/mediawiki/templates/NOTES.txt b/upstreamed/mediawiki/templates/NOTES.txt index 5dd529089..306ec8587 100644 --- a/upstreamed/mediawiki/templates/NOTES.txt +++ b/upstreamed/mediawiki/templates/NOTES.txt @@ -27,12 +27,14 @@ Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "mediawiki.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "mediawiki.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Mediawiki URL: http://$SERVICE_IP/" + +{{- $port:=.Values.service.port | toString }} + echo "Mediawiki URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} echo "Mediawiki URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mediawiki.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mediawiki.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} {{- end }} diff --git a/upstreamed/mediawiki/templates/_helpers.tpl b/upstreamed/mediawiki/templates/_helpers.tpl index b9e46d9a4..ddeeb9dea 100644 --- a/upstreamed/mediawiki/templates/_helpers.tpl +++ b/upstreamed/mediawiki/templates/_helpers.tpl @@ -26,8 +26,23 @@ Create chart name and version as used by the chart label. Return the proper Mediawiki image name */}} {{- define "mediawiki.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -37,3 +52,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "mediawiki.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/mediawiki/templates/apache-pvc.yaml b/upstreamed/mediawiki/templates/apache-pvc.yaml deleted file mode 100644 index d9888c5e2..000000000 --- a/upstreamed/mediawiki/templates/apache-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.persistence.enabled -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "mediawiki.fullname" . }}-apache - labels: - app: {{ template "mediawiki.name" . }} - chart: {{ template "mediawiki.chart" . }} - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} -spec: - accessModes: - - {{ .Values.persistence.apache.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.apache.size | quote }} -{{- if .Values.persistence.apache.storageClass }} -{{- if (eq "-" .Values.persistence.apache.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: {{ .Values.persistence.apache.storageClass | quote }} -{{- end }} -{{- end }} -{{- end -}} diff --git a/upstreamed/mediawiki/templates/deployment.yaml b/upstreamed/mediawiki/templates/deployment.yaml index 232043872..851041e03 100644 --- a/upstreamed/mediawiki/templates/deployment.yaml +++ b/upstreamed/mediawiki/templates/deployment.yaml @@ -20,6 +20,15 @@ spec: app: {{ template "mediawiki.name" . }} chart: {{ template "mediawiki.chart" . }} release: {{ .Release.Name | quote }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -27,6 +36,10 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "mediawiki.fullname" . }} image: {{ template "mediawiki.image" . }} @@ -132,22 +145,40 @@ spec: resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: - - name: mediawiki-data - mountPath: /bitnami/mediawiki - - name: apache-data - mountPath: /bitnami/apache + - mountPath: /bitnami/apache + name: mediawiki-data + subPath: apache + - mountPath: /bitnami/mediawiki + name: mediawiki-data + subPath: mediawiki +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: mediawiki-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "mediawiki.fullname" . }}-mediawiki - {{- else }} - emptyDir: {} - {{- end }} - - name: apache-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "mediawiki.fullname" . }}-apache + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "mediawiki.fullname" . }}-mediawiki{{- end }} {{- else }} emptyDir: {} {{- end }} diff --git a/upstreamed/mediawiki/templates/mediawiki-pvc.yaml b/upstreamed/mediawiki/templates/mediawiki-pvc.yaml index 214802ef4..2a0e0db99 100644 --- a/upstreamed/mediawiki/templates/mediawiki-pvc.yaml +++ b/upstreamed/mediawiki/templates/mediawiki-pvc.yaml @@ -10,15 +10,15 @@ metadata: heritage: {{ .Release.Service | quote }} spec: accessModes: - - {{ .Values.persistence.mediawiki.accessMode | quote }} + - {{ .Values.persistence.accessMode | quote }} resources: requests: - storage: {{ .Values.persistence.mediawiki.size | quote }} -{{- if .Values.persistence.mediawiki.storageClass }} -{{- if (eq "-" .Values.persistence.mediawiki.storageClass) }} + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" {{- else }} - storageClassName: {{ .Values.persistence.mediawiki.storageClass | quote }} + storageClassName: {{ .Values.persistence.storageClass | quote }} {{- end }} {{- end }} {{- end -}} diff --git a/upstreamed/mediawiki/templates/svc.yaml b/upstreamed/mediawiki/templates/svc.yaml index a301366e3..f060d455c 100644 --- a/upstreamed/mediawiki/templates/svc.yaml +++ b/upstreamed/mediawiki/templates/svc.yaml @@ -17,13 +17,13 @@ spec: {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port }} targetPort: http {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} nodePort: {{ .Values.service.nodePorts.http }} {{- end }} - name: https - port: 443 + port: {{ .Values.service.httpsPort }} targetPort: https {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} nodePort: {{ .Values.service.nodePorts.https }} diff --git a/upstreamed/mediawiki/values.yaml b/upstreamed/mediawiki/values.yaml index 2dcf925fa..66706b5ec 100644 --- a/upstreamed/mediawiki/values.yaml +++ b/upstreamed/mediawiki/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami DokuWiki image version ## ref: https://hub.docker.com/r/bitnami/mediawiki/tags/ ## image: registry: docker.io repository: bitnami/mediawiki - tag: 1.31.1-debian-9 + tag: 1.31.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -73,6 +79,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -128,6 +136,10 @@ service: ## otherwise leave blank ## # loadBalancerIP: + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 ## Use nodePorts to requets some specific ports when usin NodePort ## nodePorts: ## http: @@ -192,28 +204,22 @@ ingress: ## persistence: enabled: true - apache: - ## Apache data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 1Gi - mediawiki: - ## Mediawiki data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi + ## Mediawiki data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + accessMode: ReadWriteOnce + size: 8Gi ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ @@ -239,3 +245,31 @@ readinessProbe: timeoutSeconds: 5 failureThreshold: 6 successThreshold: 1 +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/mongodb/Chart.yaml b/upstreamed/mongodb/Chart.yaml index 4d42f8040..ff9733ddd 100644 --- a/upstreamed/mongodb/Chart.yaml +++ b/upstreamed/mongodb/Chart.yaml @@ -1,5 +1,5 @@ name: mongodb -version: 4.4.0 +version: 4.9.0 appVersion: 4.0.3 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. keywords: diff --git a/upstreamed/mongodb/README.md b/upstreamed/mongodb/README.md index 1f4107d7c..41b448a30 100644 --- a/upstreamed/mongodb/README.md +++ b/upstreamed/mongodb/README.md @@ -45,59 +45,76 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the MongoDB chart and their default values. -| Parameter | Description | Default | -|-----------------------------------------|----------------------------------------------------------------------------------------------|----------------------------------------------------------| -| `image.registry` | MongoDB image registry | `docker.io` | -| `image.repository` | MongoDB Image name | `bitnami/mongodb` | -| `image.tag` | MongoDB Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `usePassword` | Enable password authentication | `true` | -| `existingSecret` | Existing secret with MongoDB credentials | `nil` | -| `mongodbRootPassword` | MongoDB admin password | `random alhpanumeric string (10)` | -| `mongodbUsername` | MongoDB custom user | `nil` | -| `mongodbPassword` | MongoDB custom user password | `random alhpanumeric string (10)` | -| `mongodbDatabase` | Database to create | `nil` | -| `mongodbEnableIPv6` | Switch to enable/disable IPv6 on MongoDB | `true` | -| `mongodbExtraFlags` | MongoDB additional command line flags | [] | -| `service.annotations` | Kubernetes service annotations | `{}` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.nodePort` | Port to bind to for NodePort service type | `nil` | -| `port` | MongoDB service port | `27017` | -| `replicaSet.enabled` | Switch to enable/disable replica set configuration | `false` | -| `replicaSet.name` | Name of the replica set | `rs0` | -| `replicaSet.useHostnames` | Enable DNS hostnames in the replica set config | `true` | -| `replicaSet.key` | Key used for authentication in the replica set | `nil` | -| `replicaSet.replicas.secondary` | Number of secondary nodes in the replica set | `1` | -| `replicaSet.replicas.arbiter` | Number of arbiter nodes in the replica set | `1` | -| `replicaSet.pdb.minAvailable.primary` | PDB for the MongoDB Primary nodes | `1` | -| `replicaSet.pdb.minAvailable.secondary` | PDB for the MongoDB Secondary nodes | `1` | -| `replicaSet.pdb.minAvailable.arbiter` | PDB for the MongoDB Arbiter nodes | `1` | -| `podAnnotations` | Annotations to be added to pods | {} | -| `resources` | Pod resources | {} | -| `nodeSelector` | Node labels for pod assignment | {} | -| `affinity` | Affinity for pod assignment | {} | -| `tolerations` | Toleration labels for pod assignment | {} | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | -| `persistence.enabled` | Use a PVC to persist data | `true` | -| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | -| `persistence.size` | Size of data volume | `8Gi` | -| `persistence.annotations` | Persistent Volume annotations | `{}` | -| `persistence.existingClaim` | Name of an existing PVC to use (avoids creating one if this is given) | `nil` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | -| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | -| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | -| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` | -| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | -| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | -| `configmap` | MongoDB configuration file to be used | `nil` | +| Parameter | Description | Default | +| --------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | MongoDB image registry | `docker.io` | +| `image.repository` | MongoDB Image name | `bitnami/mongodb` | +| `image.tag` | MongoDB Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `usePassword` | Enable password authentication | `true` | +| `existingSecret` | Existing secret with MongoDB credentials | `nil` | +| `mongodbRootPassword` | MongoDB admin password | `random alhpanumeric string (10)` | +| `mongodbUsername` | MongoDB custom user | `nil` | +| `mongodbPassword` | MongoDB custom user password | `random alhpanumeric string (10)` | +| `mongodbDatabase` | Database to create | `nil` | +| `mongodbEnableIPv6` | Switch to enable/disable IPv6 on MongoDB | `true` | +| `mongodbExtraFlags` | MongoDB additional command line flags | [] | +| `service.annotations` | Kubernetes service annotations | `{}` | +| `service.type` | Kubernetes Service type | `ClusterIP` | +| `service.clusterIP` | Static clusterIP or None for headless services | `nil` | +| `service.nodePort` | Port to bind to for NodePort service type | `nil` | +| `port` | MongoDB service port | `27017` | +| `replicaSet.enabled` | Switch to enable/disable replica set configuration | `false` | +| `replicaSet.name` | Name of the replica set | `rs0` | +| `replicaSet.useHostnames` | Enable DNS hostnames in the replica set config | `true` | +| `replicaSet.key` | Key used for authentication in the replica set | `nil` | +| `replicaSet.replicas.secondary` | Number of secondary nodes in the replica set | `1` | +| `replicaSet.replicas.arbiter` | Number of arbiter nodes in the replica set | `1` | +| `replicaSet.pdb.minAvailable.primary` | PDB for the MongoDB Primary nodes | `1` | +| `replicaSet.pdb.minAvailable.secondary` | PDB for the MongoDB Secondary nodes | `1` | +| `replicaSet.pdb.minAvailable.arbiter` | PDB for the MongoDB Arbiter nodes | `1` | +| `podAnnotations` | Annotations to be added to pods | {} | +| `podLabels` | Additional labels for the pod(s). | {} | +| `resources` | Pod resources | {} | +| `nodeSelector` | Node labels for pod assignment | {} | +| `affinity` | Affinity for pod assignment | {} | +| `tolerations` | Toleration labels for pod assignment | {} | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `persistence.enabled` | Use a PVC to persist data | `true` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | +| `persistence.annotations` | Persistent Volume annotations | `{}` | +| `persistence.existingClaim` | Name of an existing PVC to use (avoids creating one if this is given) | `nil` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `configmap` | MongoDB configuration file to be used | `nil` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | MongoDB exporter image registry | `docker.io` | +| `metrics.image.repository` | MongoDB exporter image name | `forekshub/percona-mongodb-exporter` | +| `metrics.image.tag` | MongoDB exporter image tag | `latest` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | {} | +| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | +| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` | +| `metrics.serviceMonitor.additionalLabels` | Used to pass Labels that are required by the Installed Prometheus Operator | {} | +| `metrics.serviceMonitor.relabellings` | Specify Metric Relabellings to add to the scrape endpoint | `nil` | +| `metrics.serviceMonitor.alerting.rules` | Define individual alerting rules as required | {} | +| `metrics.serviceMonitor.alerting.additionalLabels` | Used to pass Labels that are required by the Installed Prometheus Operator | {} | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, @@ -114,6 +131,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ```bash $ helm install --name my-release -f values.yaml stable/mongodb ``` + > **Tip**: You can use the default [values.yaml](values.yaml) ## Replication @@ -123,6 +141,7 @@ You can start the MongoDB chart in replica set mode with the following command: ```bash $ helm install --name my-release stable/mongodb --set replication.enabled=true ``` + ## Production settings and horizontal scaling The [values-production.yaml](values-production.yaml) file consists a configuration to deploy a scalable and high-available MongoDB deployment for production environments. We recommend that you base your production configuration on this template and adjust the parameters appropriately. @@ -140,9 +159,9 @@ $ kubectl scale statefulset my-release-mongodb-secondary --replicas=3 Some characteristics of this chart are: -* Each of the participants in the replication has a fixed stateful set so you always know where to find the primary, secondary or arbiter nodes. -* The number of secondary and arbiter nodes can be scaled out independently. -* Easy to move an application from using a standalone MongoDB server to use a replica set. +- Each of the participants in the replication has a fixed stateful set so you always know where to find the primary, secondary or arbiter nodes. +- The number of secondary and arbiter nodes can be scaled out independently. +- Easy to move an application from using a standalone MongoDB server to use a replica set. ## Initialize a fresh instance diff --git a/upstreamed/mongodb/templates/NOTES.txt b/upstreamed/mongodb/templates/NOTES.txt index af810019b..c619a5733 100644 --- a/upstreamed/mongodb/templates/NOTES.txt +++ b/upstreamed/mongodb/templates/NOTES.txt @@ -40,7 +40,7 @@ To get the password for "{{ .Values.mongodbUsername }}" run: To connect to your database run the following command: - kubectl run --namespace {{ .Release.Namespace }} {{ template "mongodb.fullname" . }}-client --rm --tty -i --image bitnami/mongodb --command -- mongo admin --host {{ template "mongodb.fullname" . }} {{- if .Values.usePassword }} -u root -p $MONGODB_ROOT_PASSWORD{{- end }} + kubectl run --namespace {{ .Release.Namespace }} {{ template "mongodb.fullname" . }}-client --rm --tty -i --image bitnami/mongodb --command -- mongo admin --host {{ template "mongodb.fullname" . }} {{- if .Values.usePassword }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }} To connect to your database from outside the cluster execute the following commands: @@ -48,7 +48,7 @@ To connect to your database from outside the cluster execute the following comma export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "mongodb.fullname" . }}) - mongo --host $NODE_IP --port $NODE_PORT {{- if .Values.usePassword }} -p $MONGODB_ROOT_PASSWORD{{- end }} + mongo --host $NODE_IP --port $NODE_PORT {{- if .Values.usePassword }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }} {{- else if contains "LoadBalancer" .Values.service.type }} @@ -56,11 +56,11 @@ To connect to your database from outside the cluster execute the following comma Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "mongodb.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "mongodb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - mongo --host $SERVICE_IP --port {{ .Values.service.nodePort }} {{- if .Values.usePassword }} -p $MONGODB_ROOT_PASSWORD{{- end }} + mongo --host $SERVICE_IP --port {{ .Values.service.nodePort }} {{- if .Values.usePassword }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }} {{- else if contains "ClusterIP" .Values.service.type }} kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mongodb.fullname" . }} 27017:27017 & - mongo --host 127.0.0.1 {{- if .Values.usePassword }} -p $MONGODB_ROOT_PASSWORD{{- end }} + mongo --host 127.0.0.1 {{- if .Values.usePassword }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }} {{- end }} diff --git a/upstreamed/mongodb/templates/_helpers.tpl b/upstreamed/mongodb/templates/_helpers.tpl index a948b7ecb..00057a1cc 100644 --- a/upstreamed/mongodb/templates/_helpers.tpl +++ b/upstreamed/mongodb/templates/_helpers.tpl @@ -54,11 +54,35 @@ Create the name for the key secret. {{- end -}} {{/* -Return the proper image name +Return the proper MongoDB image name */}} {{- define "mongodb.image" -}} -{{- $registryName := .Values.image.registry -}} +{{- $registryName := .Values.image.registry -}} {{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- end -}} \ No newline at end of file +{{- end -}} + diff --git a/upstreamed/mongodb/templates/deployment-standalone.yaml b/upstreamed/mongodb/templates/deployment-standalone.yaml index d8ff01be3..6874cbcfe 100644 --- a/upstreamed/mongodb/templates/deployment-standalone.yaml +++ b/upstreamed/mongodb/templates/deployment-standalone.yaml @@ -19,9 +19,17 @@ spec: app: {{ template "mongodb.name" . }} release: "{{ .Release.Name }}" chart: {{ template "mongodb.chart" . }} - {{- if .Values.podAnnotations }} + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} + {{- end }} + {{- if or .Values.podAnnotations .Values.metrics.enabled }} annotations: +{{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} +{{- if .Values.metrics.enabled }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} +{{- end }} {{- end }} spec: {{- if .Values.securityContext.enabled }} @@ -121,6 +129,35 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + env: + - name: MONGODB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{- else }}{{ template "mongodb.fullname" . }}{{- end }} + key: mongodb-root-password + command: [ 'sh', '-c', '/bin/mongodb_exporter --mongodb.uri mongodb://root:${MONGODB_ROOT_PASSWORD}@localhost:{{ .Values.service.port }}/admin' ] + ports: + - name: metrics + containerPort: 9216 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} - name: custom-init-scripts diff --git a/upstreamed/mongodb/templates/headless-svc-rs.yaml b/upstreamed/mongodb/templates/headless-svc-rs.yaml index 29fcf34cc..93b3b01e9 100644 --- a/upstreamed/mongodb/templates/headless-svc-rs.yaml +++ b/upstreamed/mongodb/templates/headless-svc-rs.yaml @@ -18,7 +18,12 @@ spec: ports: - name: mongodb port: {{ .Values.service.port }} +{{- if .Values.metrics.enabled }} + - name: metrics + port: 9216 + targetPort: metrics +{{- end }} selector: app: {{ template "mongodb.name" . }} release: {{ .Release.Name }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/upstreamed/mongodb/templates/prometheus-alerting-rule.yaml b/upstreamed/mongodb/templates/prometheus-alerting-rule.yaml new file mode 100644 index 000000000..e6d4d4c68 --- /dev/null +++ b/upstreamed/mongodb/templates/prometheus-alerting-rule.yaml @@ -0,0 +1,17 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled .Values.metrics.serviceMonitor.alerting.rules }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.name" . }} + chart: {{ template "mongodb.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + {{- if .Values.metrics.serviceMonitor.alerting.additionalLabels }} +{{ toYaml .Values.metrics.serviceMonitor.alerting.additionalLabels | indent 4 }} + {{- end }} +spec: + groups: +{{ toYaml .Values.metrics.serviceMonitor.alerting.rules | indent 4 }} +{{- end }} diff --git a/upstreamed/mongodb/templates/prometheus-service-monitor.yaml b/upstreamed/mongodb/templates/prometheus-service-monitor.yaml new file mode 100644 index 000000000..7c3316923 --- /dev/null +++ b/upstreamed/mongodb/templates/prometheus-service-monitor.yaml @@ -0,0 +1,32 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.name" . }} + chart: {{ template "mongodb.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + {{- if .Values.metrics.serviceMonitor.additionalLabels }} +{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} + {{- end }} +spec: + endpoints: + - interval: 30s + port: metrics + {{- if .Values.metrics.serviceMonitor.relabellings }} + metricRelabelings: +{{ toYaml .Values.metrics.serviceMonitor.relabellings | indent 4 }} + {{- end }} + jobLabel: {{ template "mongodb.fullname" . }} + namespaceSelector: + matchNames: + - "{{ $.Release.Namespace }}" + selector: + matchLabels: + app: {{ template "mongodb.name" . }} + chart: {{ template "mongodb.chart" . }} + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- end }} diff --git a/upstreamed/mongodb/templates/statefulset-arbiter-rs.yaml b/upstreamed/mongodb/templates/statefulset-arbiter-rs.yaml index 4ed30a16d..b795e6698 100644 --- a/upstreamed/mongodb/templates/statefulset-arbiter-rs.yaml +++ b/upstreamed/mongodb/templates/statefulset-arbiter-rs.yaml @@ -24,6 +24,9 @@ spec: chart: {{ template "mongodb.chart" . }} release: {{ .Release.Name }} component: arbiter + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} + {{- end }} {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} @@ -112,6 +115,8 @@ spec: mountPath: /opt/bitnami/mongodb/conf/mongodb.conf subPath: mongodb.conf {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} volumes: {{- if .Values.configmap }} - name: config diff --git a/upstreamed/mongodb/templates/statefulset-primary-rs.yaml b/upstreamed/mongodb/templates/statefulset-primary-rs.yaml index 8dcb00471..9a3ab96a9 100644 --- a/upstreamed/mongodb/templates/statefulset-primary-rs.yaml +++ b/upstreamed/mongodb/templates/statefulset-primary-rs.yaml @@ -24,9 +24,17 @@ spec: chart: {{ template "mongodb.chart" . }} release: {{ .Release.Name }} component: primary - {{- if .Values.podAnnotations }} + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} + {{- end }} + {{- if or .Values.podAnnotations .Values.metrics.enabled }} annotations: +{{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} +{{- if .Values.metrics.enabled }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} +{{- end }} {{- end }} spec: {{- if .Values.securityContext.enabled }} @@ -69,7 +77,7 @@ spec: - name: MONGODB_DATABASE value: {{ .Values.mongodbDatabase | quote }} {{- if .Values.usePassword }} - {{- if .Values.mongodbPassword }} + {{- if or .Values.mongodbPassword .Values.existingSecret }} - name: MONGODB_PASSWORD valueFrom: secretKeyRef: @@ -133,6 +141,41 @@ spec: mountPath: /opt/bitnami/mongodb/conf/mongodb.conf subPath: mongodb.conf {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + env: + {{- if .Values.usePassword }} + - name: MONGODB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{- else }}{{ template "mongodb.fullname" . }}{{- end }} + key: mongodb-root-password + command: [ 'sh', '-c', '/bin/mongodb_exporter --mongodb.uri mongodb://root:${MONGODB_ROOT_PASSWORD}@localhost:{{ .Values.service.port }}/admin' ] + {{- else }} + command: [ 'sh', '-c', '/bin/mongodb_exporter --mongodb.uri mongodb://localhost:{{ .Values.service.port }}' ] + {{- end }} + ports: + - name: metrics + containerPort: 9216 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} - name: custom-init-scripts diff --git a/upstreamed/mongodb/templates/statefulset-secondary-rs.yaml b/upstreamed/mongodb/templates/statefulset-secondary-rs.yaml index d4c4a974a..334e84bd9 100644 --- a/upstreamed/mongodb/templates/statefulset-secondary-rs.yaml +++ b/upstreamed/mongodb/templates/statefulset-secondary-rs.yaml @@ -25,9 +25,17 @@ spec: chart: {{ template "mongodb.chart" . }} release: {{ .Release.Name }} component: secondary - {{- if .Values.podAnnotations }} + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} + {{- end }} + {{- if or .Values.podAnnotations .Values.metrics.enabled }} annotations: +{{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} +{{- if .Values.metrics.enabled }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} +{{- end }} {{- end }} spec: {{- if .Values.securityContext.enabled }} @@ -121,6 +129,41 @@ spec: mountPath: /opt/bitnami/mongodb/conf/mongodb.conf subPath: mongodb.conf {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + env: + {{- if .Values.usePassword }} + - name: MONGODB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{- else }}{{ template "mongodb.fullname" . }}{{- end }} + key: mongodb-root-password + command: [ 'sh', '-c', '/bin/mongodb_exporter --mongodb.uri mongodb://root:${MONGODB_ROOT_PASSWORD}@localhost:{{ .Values.service.port }}/admin' ] + {{- else }} + command: [ 'sh', '-c', '/bin/mongodb_exporter --mongodb.uri mongodb://localhost:{{ .Values.service.port }}' ] + {{- end }} + ports: + - name: metrics + containerPort: 9216 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: {{- if .Values.configmap }} - name: config diff --git a/upstreamed/mongodb/templates/svc-primary-rs.yaml b/upstreamed/mongodb/templates/svc-primary-rs.yaml index fd440c839..ccc73ecb3 100644 --- a/upstreamed/mongodb/templates/svc-primary-rs.yaml +++ b/upstreamed/mongodb/templates/svc-primary-rs.yaml @@ -14,6 +14,9 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} + {{- if and (eq .Values.service.type "ClusterIP") .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} ports: - name: mongodb port: 27017 diff --git a/upstreamed/mongodb/templates/svc-standalone.yaml b/upstreamed/mongodb/templates/svc-standalone.yaml index 4ca944317..00eecc6b1 100644 --- a/upstreamed/mongodb/templates/svc-standalone.yaml +++ b/upstreamed/mongodb/templates/svc-standalone.yaml @@ -14,6 +14,9 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} + {{- if and (eq .Values.service.type "ClusterIP") .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} ports: - name: mongodb port: 27017 diff --git a/upstreamed/mongodb/values-production.yaml b/upstreamed/mongodb/values-production.yaml index fdf8d0c85..14c2b0c3a 100644 --- a/upstreamed/mongodb/values-production.yaml +++ b/upstreamed/mongodb/values-production.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + image: ## Bitnami MongoDB registry ## @@ -8,7 +14,7 @@ image: ## Bitnami MongoDB image tag ## ref: https://hub.docker.com/r/bitnami/mongodb/tags/ ## - tag: 4.0.3-debian-9 + tag: 4.0.3 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -67,6 +73,7 @@ clusterDomain: cluster.local service: annotations: {} type: ClusterIP + # clusterIP: None port: 27017 ## Specify the nodePort value for the LoadBalancer and NodePort service types. @@ -107,6 +114,9 @@ replicaSet: # Annotations to be added to MongoDB pods podAnnotations: {} +# Additional pod labels to apply +podLabels: {} + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -205,3 +215,54 @@ configmap: # security: # authorization: enabled # keyFile: /opt/bitnami/mongodb/conf/keyfile + +## Prometheus Exporter / Metrics +## +metrics: + enabled: true + + image: + registry: docker.io + repository: forekshub/percona-mongodb-exporter + tag: latest + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} + + ## Metrics exporter pod Annotation + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9216" + + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md + serviceMonitor: + ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry + enabled: false + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} + + ## Specify Metric Relabellings to add to the scrape endpoint + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + # relabellings: + + alerting: + ## Define individual alerting rules as required + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#rulegroup + ## https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ + rules: {} + + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Prometheus Rules to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} diff --git a/upstreamed/mongodb/values.yaml b/upstreamed/mongodb/values.yaml index bc8fb5e4e..2479befd3 100644 --- a/upstreamed/mongodb/values.yaml +++ b/upstreamed/mongodb/values.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + image: ## Bitnami MongoDB registry ## @@ -8,7 +14,7 @@ image: ## Bitnami MongoDB image tag ## ref: https://hub.docker.com/r/bitnami/mongodb/tags/ ## - tag: 4.0.3-debian-9 + tag: 4.0.3 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -68,6 +74,7 @@ clusterDomain: cluster.local service: annotations: {} type: ClusterIP + # clusterIP: None port: 27017 ## Specify the nodePort value for the LoadBalancer and NodePort service types. @@ -107,6 +114,9 @@ replicaSet: # Annotations to be added to MongoDB pods podAnnotations: {} +# Additional pod labels to apply +podLabels: {} + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -205,3 +215,54 @@ configmap: # security: # authorization: enabled # #keyFile: /opt/bitnami/mongodb/conf/keyfile + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + + image: + registry: docker.io + repository: forekshub/percona-mongodb-exporter + tag: latest + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} + + ## Metrics exporter pod Annotation + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9216" + + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md + serviceMonitor: + ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry + enabled: false + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} + + ## Specify Metric Relabellings to add to the scrape endpoint + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + # relabellings: + + alerting: + ## Define individual alerting rules as required + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#rulegroup + ## https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ + rules: {} + + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Prometheus Rules to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} diff --git a/upstreamed/moodle/Chart.yaml b/upstreamed/moodle/Chart.yaml index 81ba49877..473450d82 100644 --- a/upstreamed/moodle/Chart.yaml +++ b/upstreamed/moodle/Chart.yaml @@ -1,6 +1,6 @@ name: moodle -version: 3.1.0 -appVersion: 3.5.2 +version: 4.0.0 +appVersion: 3.5.3 description: Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments diff --git a/upstreamed/moodle/README.md b/upstreamed/moodle/README.md index 8b5784d9c..030330926 100644 --- a/upstreamed/moodle/README.md +++ b/upstreamed/moodle/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Moodle chart and th | Parameter | Description | Default | |---------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Moodle image registry | `docker.io` | | `image.repository` | Moodle Image name | `bitnami/moodle` | | `image.tag` | Moodle Image tag | `{VERSION}` | @@ -62,7 +63,12 @@ The following table lists the configurable parameters of the Moodle chart and th | `smtpProtocol` | SMTP Protocol (options: ssl,tls, nil) | `nil` | | `smtpUser` | SMTP user | `nil` | | `smtpPassword` | SMTP password | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | | `ingress.enabled` | Enable ingress controller resource | `false` | | `ingress.hosts[0].name` | Hostname to your Moodle installation | `moodle.local` | | `ingress.hosts[0].path` | Path within the url structure | `/` | @@ -108,6 +114,15 @@ The following table lists the configurable parameters of the Moodle chart and th | `readinessProbe.timeoutSeconds` | When the probe times out | 5 | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle). For more information please refer to the [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle) image documentation. diff --git a/upstreamed/moodle/requirements.lock b/upstreamed/moodle/requirements.lock index d4ea98e97..762735340 100644 --- a/upstreamed/moodle/requirements.lock +++ b/upstreamed/moodle/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.3 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:42:15.186850414+02:00 +generated: 2018-11-11T00:03:15.201660989Z diff --git a/upstreamed/moodle/templates/NOTES.txt b/upstreamed/moodle/templates/NOTES.txt index 42d464300..7f6f63cc2 100644 --- a/upstreamed/moodle/templates/NOTES.txt +++ b/upstreamed/moodle/templates/NOTES.txt @@ -1,8 +1,8 @@ {{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}} ** Please be patient while the chart is being deployed ** -{{- if and .Values.ingress.enabled (ne .Values.serviceType "ClusterIP") }} -** Notice : Usually with ingress the serviceType should be set to ClusterIP, which is not the case to this deployment! ** +{{- if and .Values.ingress.enabled (ne .Values.service.type "ClusterIP") }} +** Notice : Usually with ingress the service.type should be set to ClusterIP, which is not the case to this deployment! ** {{- end }} 1. Access you Moodle instance with: @@ -17,22 +17,24 @@ - http://{{ . }} {{- end }} {{- end }} -{{- else if contains "NodePort" .Values.serviceType }} +{{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "moodle.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "Moodle URL: http://$NODE_IP:$NODE_PORT/" -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "moodle.fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "moodle.fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "moodle.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Moodle URL: http://$SERVICE_IP/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "Moodle URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "moodle.fullname" . }} 8080:80 +{{- else if contains "ClusterIP" .Values.service.type }} + + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "moodle.fullname" . }} 8080:{{ .Values.service.port }} echo "Moodle URL: http://127.0.0.1:8080/" {{- end }} @@ -54,6 +56,6 @@ host. To configure Moodle to use and external database host: 1. Complete your Moodle deployment by running: - helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/moodle + helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/moodle {{- end }} diff --git a/upstreamed/moodle/templates/_helpers.tpl b/upstreamed/moodle/templates/_helpers.tpl index 6b8934c9a..79d9811d9 100644 --- a/upstreamed/moodle/templates/_helpers.tpl +++ b/upstreamed/moodle/templates/_helpers.tpl @@ -36,4 +36,37 @@ Create chart name and version as used by the chart label. */}} {{- define "moodle.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Moodle image name +*/}} +{{- define "moodle.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/moodle/templates/deployment.yaml b/upstreamed/moodle/templates/deployment.yaml index 03817dad2..110607803 100644 --- a/upstreamed/moodle/templates/deployment.yaml +++ b/upstreamed/moodle/templates/deployment.yaml @@ -18,6 +18,15 @@ spec: app: {{ template "moodle.fullname" . }} chart: {{ template "moodle.chart" . }} release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.affinity }} affinity: @@ -29,9 +38,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "moodle.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + - name: moodle + image: {{ template "moodle.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -119,6 +132,29 @@ spec: volumeMounts: - name: moodle-data mountPath: /bitnami +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: moodle-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/moodle/templates/svc.yaml b/upstreamed/moodle/templates/svc.yaml index 2a69ef447..247019ee0 100644 --- a/upstreamed/moodle/templates/svc.yaml +++ b/upstreamed/moodle/templates/svc.yaml @@ -8,13 +8,22 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "moodle.fullname" . }} diff --git a/upstreamed/moodle/values.yaml b/upstreamed/moodle/values.yaml index e1291c8b4..91e8b63ed 100644 --- a/upstreamed/moodle/values.yaml +++ b/upstreamed/moodle/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Moodle image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## image: registry: docker.io repository: bitnami/moodle - tag: 3.5.2-debian-9 + tag: 3.5.3 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -66,6 +72,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -137,7 +145,24 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, for ingress ClusterIP, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## Configure the ingress resource that allows you to access the ## Moodle installation. Set up the URL @@ -244,3 +269,31 @@ readinessProbe: timeoutSeconds: 3 failureThreshold: 6 successThreshold: 1 + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/nats/Chart.yaml b/upstreamed/nats/Chart.yaml index 1c68b4bfd..2bd85505c 100644 --- a/upstreamed/nats/Chart.yaml +++ b/upstreamed/nats/Chart.yaml @@ -1,5 +1,5 @@ name: nats -version: 1.0.3 +version: 1.3.1 appVersion: 1.3.0 description: An open-source, cloud-native messaging system keywords: diff --git a/upstreamed/nats/README.md b/upstreamed/nats/README.md index 4a592c847..a524843b0 100644 --- a/upstreamed/nats/README.md +++ b/upstreamed/nats/README.md @@ -45,78 +45,90 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the NATS chart and their default values. -| Parameter | Description | Default | -|--------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------| -| `image.registry` | NATS image registry | `docker.io` | -| `image.repository` | NATS Image name | `bitnami/nats` | -| `image.tag` | NATS Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `auth.enabled` | Switch to enable/disable client authentication | `true` | -| `auth.user` | Client authentication user | `nats_cluster` | -| `auth.password` | Client authentication password | `random alhpanumeric string (10)` | -| `auth.token` | Client authentication token | `nil` | -| `clusterAuth.enabled` | Switch to enable/disable cluster authentication | `true` | -| `clusterAuth.user` | Cluster authentication user | `nats_cluster` | -| `clusterAuth.password` | Cluster authentication password | `random alhpanumeric string (10)` | -| `clusterAuth.token` | Cluster authentication token | `nil` | -| `debug.enabled` | Switch to enable/disable debug on logging | `false` | -| `debug.trace` | Switch to enable/disable trace debug level on logging | `false` | -| `debug.logtime` | Switch to enable/disable logtime on logging | `false` | -| `maxConnections` | Max. number of client connections | `nil` | -| `maxControlLine` | Max. protocol control line | `nil` | -| `maxPayload` | Max. payload | `nil` | -| `writeDeadline` | Duration the server can block on a socket write to a client | `nil` | -| `replicaCount` | Number of NATS nodes | `1` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | -| `statefulset.updateStrategy` | Statefulsets Update strategy | `OnDelete` | -| `rollingUpdatePartition` | Partition for Rolling Update strategy | `nil` | -| `podLabels` | Additional labels to be added to pods | {} | -| `podAnnotations` | Annotations to be added to pods | {} | -| `nodeSelector` | Node labels for pod assignment | `nil` | -| `schedulerName` | Name of an alternate | `nil` | -| `antiAffinity` | Anti-affinity for pod assignment | `soft` | -| `tolerations` | Toleration labels for pod assignment | `nil` | -| `resources` | CPU/Memory resource requests/limits | {} | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | -| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | -| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | -| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` | -| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | -| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | -| `clientService.type` | Kubernetes Service type (NATS client) | `ClusterIP` | -| `clientService.port` | NATS client port | `4222` | -| `clientService.nodePort` | Port to bind to for NodePort service type (NATS client) | `nil` | -| `clientService.annotations` | Annotations for NATS client service | {} | -| `clientService.loadBalancerIP` | loadBalancerIP if NATS client service type is `LoadBalancer` | `nil` | -| `clusterService.type` | Kubernetes Service type (NATS cluster) | `ClusterIP` | -| `clusterService.port` | NATS cluster port | `6222` | -| `clusterService.nodePort` | Port to bind to for NodePort service type (NATS cluster) | `nil` | -| `clusterService.annotations` | Annotations for NATS cluster service | {} | -| `clusterService.loadBalancerIP` | loadBalancerIP if NATS cluster service type is `LoadBalancer` | `nil` | -| `monitoringService.type` | Kubernetes Service type (NATS monitoring) | `ClusterIP` | -| `monitoringService.port` | NATS monitoring port | `8222` | -| `monitoringService.nodePort` | Port to bind to for NodePort service type (NATS monitoring) | `nil` | -| `monitoringService.annotations` | Annotations for NATS monitoring service | {} | -| `monitoringService.loadBalancerIP` | loadBalancerIP if NATS monitoring service type is `LoadBalancer` | `nil` | -| `ingress.enabled` | Enable ingress controller resource | `false` | -| `ingress.hosts[0].name` | Hostname for NATS monitoring | `nats.local` | -| `ingress.hosts[0].path` | Path within the url structure | `/` | -| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | -| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `nats.local-tls-secret` | -| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | -| `ingress.secrets[0].name` | TLS Secret Name | `nil` | -| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | -| `ingress.secrets[0].key` | TLS Secret Key | `nil` | -| `networkPolicy.enabled` | Enable NetworkPolicy | `false` | -| `networkPolicy.allowExternal` | Allow external connections | `true` | -| `sidecars` | Attach additional containers to the pod. | `nil` | +| Parameter | Description | Default | +| ------------------------------------ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | NATS image registry | `docker.io` | +| `image.repository` | NATS Image name | `bitnami/nats` | +| `image.tag` | NATS Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `auth.enabled` | Switch to enable/disable client authentication | `true` | +| `auth.user` | Client authentication user | `nats_cluster` | +| `auth.password` | Client authentication password | `random alhpanumeric string (10)` | +| `auth.token` | Client authentication token | `nil` | +| `clusterAuth.enabled` | Switch to enable/disable cluster authentication | `true` | +| `clusterAuth.user` | Cluster authentication user | `nats_cluster` | +| `clusterAuth.password` | Cluster authentication password | `random alhpanumeric string (10)` | +| `clusterAuth.token` | Cluster authentication token | `nil` | +| `debug.enabled` | Switch to enable/disable debug on logging | `false` | +| `debug.trace` | Switch to enable/disable trace debug level on logging | `false` | +| `debug.logtime` | Switch to enable/disable logtime on logging | `false` | +| `maxConnections` | Max. number of client connections | `nil` | +| `maxControlLine` | Max. protocol control line | `nil` | +| `maxPayload` | Max. payload | `nil` | +| `writeDeadline` | Duration the server can block on a socket write to a client | `nil` | +| `replicaCount` | Number of NATS nodes | `1` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `statefulset.updateStrategy` | Statefulsets Update strategy | `OnDelete` | +| `statefulset.rollingUpdatePartition` | Partition for Rolling Update strategy | `nil` | +| `podLabels` | Additional labels to be added to pods | {} | +| `podAnnotations` | Annotations to be added to pods | {} | +| `nodeSelector` | Node labels for pod assignment | `nil` | +| `schedulerName` | Name of an alternate | `nil` | +| `antiAffinity` | Anti-affinity for pod assignment | `soft` | +| `tolerations` | Toleration labels for pod assignment | `nil` | +| `resources` | CPU/Memory resource requests/limits | {} | +| `extraArgs` | Optional flags for NATS | `[]` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `clientService.type` | Kubernetes Service type (NATS client) | `ClusterIP` | +| `clientService.port` | NATS client port | `4222` | +| `clientService.nodePort` | Port to bind to for NodePort service type (NATS client) | `nil` | +| `clientService.annotations` | Annotations for NATS client service | {} | +| `clientService.loadBalancerIP` | loadBalancerIP if NATS client service type is `LoadBalancer` | `nil` | +| `clusterService.type` | Kubernetes Service type (NATS cluster) | `ClusterIP` | +| `clusterService.port` | NATS cluster port | `6222` | +| `clusterService.nodePort` | Port to bind to for NodePort service type (NATS cluster) | `nil` | +| `clusterService.annotations` | Annotations for NATS cluster service | {} | +| `clusterService.loadBalancerIP` | loadBalancerIP if NATS cluster service type is `LoadBalancer` | `nil` | +| `monitoringService.type` | Kubernetes Service type (NATS monitoring) | `ClusterIP` | +| `monitoringService.port` | NATS monitoring port | `8222` | +| `monitoringService.nodePort` | Port to bind to for NodePort service type (NATS monitoring) | `nil` | +| `monitoringService.annotations` | Annotations for NATS monitoring service | {} | +| `monitoringService.loadBalancerIP` | loadBalancerIP if NATS monitoring service type is `LoadBalancer` | `nil` | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.hosts[0].name` | Hostname for NATS monitoring | `nats.local` | +| `ingress.hosts[0].path` | Path within the url structure | `/` | +| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `nats.local-tls-secret` | +| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `networkPolicy.enabled` | Enable NetworkPolicy | `false` | +| `networkPolicy.allowExternal` | Allow external connections | `true` | +| `metrics.enabled` | Enable Prometheus metrics via exporter side-car | `false` | +| `metrics.image.registry` | Prometheus metrics exporter image registry | `docker.io` | +| `metrics.image.repository` | Prometheus metrics exporter image name | `synadia/prometheus-nats-exporter` | +| `metrics.image.tag` | Prometheus metrics exporter image tag | `0.1.0` | +| `metrics.image.pullPolicy` | Prometheus metrics image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Prometheus metrics image pull secrets | `nil` | +| `metrics.port` | Prometheus metrics exporter port | `7777` | +| `metrics.podAnnotations` | Prometheus metrics exporter annotations | `prometheus.io/scrape: "true"`, `prometheus.io/port: "7777"` | +| `metrics.resources` | Prometheus metrics exporter resource requests/limit | {} | +| `sidecars` | Attach additional containers to the pod | `nil` | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/upstreamed/nats/templates/NOTES.txt b/upstreamed/nats/templates/NOTES.txt index 7f275f53e..023671821 100644 --- a/upstreamed/nats/templates/NOTES.txt +++ b/upstreamed/nats/templates/NOTES.txt @@ -74,5 +74,15 @@ To access the Monitoring svc from outside the cluster, follow the steps below: kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "nats.fullname" . }}-monitoring {{ .Values.monitoringService.port }}:{{ .Values.monitoringService.port }} {{- end }} -2. Access the NATS monitoring opening the URL obtained on a browser. +2. Access NATS monitoring by opening the URL obtained in a browser. +{{- end }} + +{{- if .Values.metrics.enabled }} + +3. Get the NATS Prometheus Metrics URL by running: + + echo "Prometheus Metrics URL: http://127.0.0.1:{{ .Values.metrics.port }}" + kubectl port-forward --namespace {{ .Release.Namespace }} {{ template "nats.fullname" . }}-0 {{ .Values.metrics.port }}:{{ .Values.metrics.port }} + +4. Access NATS Prometheus metrics by opening the URL obtained in a browser. {{- end }} diff --git a/upstreamed/nats/templates/_helpers.tpl b/upstreamed/nats/templates/_helpers.tpl index 32e67f415..ef93757d9 100644 --- a/upstreamed/nats/templates/_helpers.tpl +++ b/upstreamed/nats/templates/_helpers.tpl @@ -21,11 +21,26 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{/* -Return the proper image name +Return the proper Nats image name */}} {{- define "nats.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* @@ -46,3 +61,13 @@ Return the appropriate apiVersion for networkpolicy. {{- print "networking.k8s.io/v1" -}} {{- end -}} {{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/nats/templates/configmap.yaml b/upstreamed/nats/templates/configmap.yaml index 2391d68ee..a5304f828 100644 --- a/upstreamed/nats/templates/configmap.yaml +++ b/upstreamed/nats/templates/configmap.yaml @@ -1,4 +1,4 @@ -{{- $authPwd := default (randAlphaNum 10) .Values.auth.password -}} +{{- $authPwd := default (include "nats.randomPassword" .) .Values.auth.password -}} {{- $clusterAuthPwd := default (include "nats.randomPassword" .) .Values.clusterAuth.password -}} apiVersion: v1 kind: ConfigMap diff --git a/upstreamed/nats/templates/statefulset.yaml b/upstreamed/nats/templates/statefulset.yaml index cb0811e71..46f53ddaa 100644 --- a/upstreamed/nats/templates/statefulset.yaml +++ b/upstreamed/nats/templates/statefulset.yaml @@ -29,10 +29,15 @@ spec: {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} - {{- if .Values.podAnnotations }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} annotations: +{{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} - {{- end }} +{{- end }} +{{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} +{{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -84,6 +89,9 @@ spec: args: - -c - /opt/bitnami/nats/gnatsd.conf + {{- if .Values.extraArgs }} +{{ toYaml .Values.extraArgs | indent 8 }} + {{- end }} ports: - name: client containerPort: {{ .Values.clientService.port }} @@ -122,6 +130,31 @@ spec: {{- if .Values.sidecars }} {{ toYaml .Values.sidecars | indent 6 }} {{- end }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + args: +{{ toYaml .Values.metrics.args | indent 10 -}} + - "http://localhost:{{ .Values.monitoringService.port }}" + ports: + - name: metrics + containerPort: {{ .Values.metrics.port }} + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: config configMap: diff --git a/upstreamed/nats/values-production.yaml b/upstreamed/nats/values-production.yaml index e67153896..26981c19a 100644 --- a/upstreamed/nats/values-production.yaml +++ b/upstreamed/nats/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami NATS image version ## ref: https://hub.docker.com/r/bitnami/nats/tags/ ## image: registry: docker.io repository: bitnami/nats - tag: 1.3.0-debian-9 + tag: 1.3.0 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -240,6 +246,42 @@ ingress: # key: # certificate: +# Optional additional arguments +extraArgs: [] + +## Metrics / Prometheus NATS Exporter +## +## ref: https://github.com/nats-io/prometheus-nats-exporter +metrics: + enabled: true + image: + registry: docker.io + repository: synadia/prometheus-nats-exporter + tag: 0.1.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} + ## Metrics exporter port + port: 7777 + ## Metrics exporter annotations + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "7777" + ## Metrics exporter flags + args: + - -connz + - -routez + - -subz + - -varz + sidecars: ## Add sidecars to the pod. ## e.g. diff --git a/upstreamed/nats/values.yaml b/upstreamed/nats/values.yaml index d233e78d5..e9faa9dca 100644 --- a/upstreamed/nats/values.yaml +++ b/upstreamed/nats/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami NATS image version ## ref: https://hub.docker.com/r/bitnami/nats/tags/ ## image: registry: docker.io repository: bitnami/nats - tag: 1.3.0-debian-9 + tag: 1.3.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -244,6 +250,42 @@ ingress: # key: # certificate: +# Optional additional arguments +extraArgs: [] + +## Metrics / Prometheus NATS Exporter +## +## ref: https://github.com/nats-io/prometheus-nats-exporter +metrics: + enabled: false + image: + registry: docker.io + repository: synadia/prometheus-nats-exporter + tag: 0.1.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} + ## Metrics exporter port + port: 7777 + ## Metrics exporter annotations + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "7777" + ## Metrics exporter flags + args: + - -connz + - -routez + - -subz + - -varz + sidecars: ## Add sidecars to the pod. ## e.g. diff --git a/upstreamed/odoo/.helmignore b/upstreamed/odoo/.helmignore index 6b8710a71..acbcabf42 100644 --- a/upstreamed/odoo/.helmignore +++ b/upstreamed/odoo/.helmignore @@ -1 +1,2 @@ .git +OWNERS diff --git a/upstreamed/odoo/Chart.yaml b/upstreamed/odoo/Chart.yaml index bae28b05b..fe415d138 100644 --- a/upstreamed/odoo/Chart.yaml +++ b/upstreamed/odoo/Chart.yaml @@ -1,6 +1,6 @@ name: odoo -version: 3.1.0 -appVersion: 11.0.20180915 +version: 5.0.0 +appVersion: 11.0.20181115 description: A suite of web based open source business apps. home: https://www.odoo.com/ icon: https://bitnami.com/assets/stacks/odoo/img/odoo-stack-110x117.png diff --git a/upstreamed/odoo/README.md b/upstreamed/odoo/README.md index 60a4c39f7..4965cb2d3 100644 --- a/upstreamed/odoo/README.md +++ b/upstreamed/odoo/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Odoo chart and thei | Parameter | Description | Default | |---------------------------------------|-------------------------------------------------------------|------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Odoo image registry | `docker.io` | | `image.repository` | Odoo Image name | `bitnami/odoo` | | `image.tag` | Odoo Image tag | `{VERSION}` | @@ -63,6 +64,7 @@ The following table lists the configurable parameters of the Odoo chart and thei | `smtpPassword` | SMTP password | `nil` | | `smtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` | | `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | | `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.nodePort` | Kubernetes http node port | `""` | diff --git a/upstreamed/odoo/requirements.lock b/upstreamed/odoo/requirements.lock index b04b9274e..d11dab4bd 100644 --- a/upstreamed/odoo/requirements.lock +++ b/upstreamed/odoo/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: postgresql repository: https://kubernetes-charts.storage.googleapis.com/ - version: 0.18.0 -digest: sha256:88ef0719267ade838b784ffd08d91a6728350516344d5cd7089502587c982ded -generated: 2018-09-17T10:41:27.340179448Z + version: 2.6.0 +digest: sha256:972c7085960fbe4a3f530f726f5a1cc6fe038f0ab84df632f6427c3a49f3f366 +generated: 2018-11-15T09:04:24.989806115Z diff --git a/upstreamed/odoo/requirements.yaml b/upstreamed/odoo/requirements.yaml index 076637e7b..8b19b4456 100644 --- a/upstreamed/odoo/requirements.yaml +++ b/upstreamed/odoo/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: postgresql - version: 0.x.x + version: 2.x.x repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/upstreamed/odoo/templates/NOTES.txt b/upstreamed/odoo/templates/NOTES.txt index e99c8ecc8..c9a711cb1 100644 --- a/upstreamed/odoo/templates/NOTES.txt +++ b/upstreamed/odoo/templates/NOTES.txt @@ -26,11 +26,13 @@ ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "odoo.fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "odoo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Odoo URL: http://$SERVICE_IP/" + +{{- $port:=.Values.service.port | toString }} + echo "Odoo URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} echo "Odoo URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "odoo.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "odoo.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} {{- end }} diff --git a/upstreamed/odoo/templates/_helpers.tpl b/upstreamed/odoo/templates/_helpers.tpl index a8a1cdf38..c91d10128 100644 --- a/upstreamed/odoo/templates/_helpers.tpl +++ b/upstreamed/odoo/templates/_helpers.tpl @@ -34,6 +34,21 @@ Create chart name and version as used by the chart label. Return the proper Odoo image name */}} {{- define "odoo.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} diff --git a/upstreamed/odoo/templates/deployment.yaml b/upstreamed/odoo/templates/deployment.yaml index 4a1a48182..6ab0986ff 100644 --- a/upstreamed/odoo/templates/deployment.yaml +++ b/upstreamed/odoo/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "odoo.postgresql.fullname" . }} - key: postgres-password + key: postgresql-password - name: ODOO_EMAIL value: {{ .Values.odooEmail | quote }} - name: ODOO_PASSWORD diff --git a/upstreamed/odoo/templates/svc.yaml b/upstreamed/odoo/templates/svc.yaml index 55d5f3493..0e4547841 100644 --- a/upstreamed/odoo/templates/svc.yaml +++ b/upstreamed/odoo/templates/svc.yaml @@ -17,7 +17,7 @@ spec: {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port }} targetPort: http {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort)))}} nodePort: {{ .Values.service.nodePort }} diff --git a/upstreamed/odoo/values.yaml b/upstreamed/odoo/values.yaml index c93a9c260..f3fe53272 100644 --- a/upstreamed/odoo/values.yaml +++ b/upstreamed/odoo/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Odoo image version ## ref: https://hub.docker.com/r/bitnami/odoo/tags/ ## image: registry: docker.io repository: bitnami/odoo - tag: 11.0.20180915-debian-9 + tag: 11.0.20181115 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -44,11 +50,13 @@ odooEmail: user@example.com ## ## PostgreSQL chart configuration ## +## https://github.com/helm/charts/blob/master/stable/postgresql/values.yaml +## postgresql: ## PostgreSQL password ## ref: https://hub.docker.com/_/postgres/ ## - # postgresPassword: + # postgresqlPassword: ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -81,7 +89,8 @@ service: ## otherwise leave blank ## # loadBalancerIP: - + # HTTP Port + port: 80 ## Use nodePort to requets some specific port when usin NodePort ## nodePort: "" diff --git a/upstreamed/opencart/Chart.yaml b/upstreamed/opencart/Chart.yaml index 18939ab6e..e7ee3b96e 100644 --- a/upstreamed/opencart/Chart.yaml +++ b/upstreamed/opencart/Chart.yaml @@ -1,5 +1,5 @@ name: opencart -version: 3.0.4 +version: 4.0.0 appVersion: 3.0.2-0 description: A free and open source e-commerce platform for online merchants. It provides a professional and reliable foundation for a successful online store. diff --git a/upstreamed/opencart/README.md b/upstreamed/opencart/README.md index e14c85edf..e21e2f9ac 100644 --- a/upstreamed/opencart/README.md +++ b/upstreamed/opencart/README.md @@ -49,13 +49,22 @@ The following table lists the configurable parameters of the OpenCart chart and | Parameter | Description | Default | |-------------------------------------|-------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | OpenCart image registry | `docker.io` | | `image.repository` | OpenCart Image name | `bitnami/opencart` | | `image.tag` | OpenCart Image tag | `{VERSION}` | | `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | | `image.pullSecrets` | Specify image pull secrets | `nil` | | `opencartHost` | OpenCart host to create application URLs | `nil` | -| `opencartLoadBalancerIP` | `loadBalancerIP` for the OpenCart Service | `nil` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `nodePorts.http` | Kubernetes http node port | `""` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `nodePorts.https` | Kubernetes https node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.loadBalancerIP` | `loadBalancerIP` for the OpenCart Service | `nil` | | `opencartUsername` | User of the application | `user` | | `opencartPassword` | Application password | _random 10 character long alphanumeric string_ | | `opencartEmail` | Admin email | `user@example.com` | @@ -72,7 +81,7 @@ The following table lists the configurable parameters of the OpenCart chart and | `externalDatabase.database` | Name of the existing database | `bitnami_opencart` | | `mariadb.enabled` | Whether to use MariaDB chart | `true` | | `mariadb.db.name` | Database name to create | `bitnami_opencart` | -| `mariadb.db.user` | Database user to create | `bn_opencart` | +| `mariadb.db.user` | Database user to create | `bn_opencart` | | `mariadb.db.password` | Password for the database | `nil` | | `mariadb.rootUser.password` | MariaDB admin password | `nil` | | `serviceType` | Kubernetes Service type | `LoadBalancer` | @@ -84,6 +93,15 @@ The following table lists the configurable parameters of the OpenCart chart and | `persistence.opencart.accessMode` | PVC Access Mode for OpenCart volume | `ReadWriteOnce` | | `persistence.opencart.size` | PVC Storage Request for OpenCart volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/opencart](http://github.com/bitnami/bitnami-docker-opencart). For more information please refer to the [bitnami/opencart](http://github.com/bitnami/bitnami-docker-opencart) image documentation. diff --git a/upstreamed/opencart/requirements.lock b/upstreamed/opencart/requirements.lock index b23d6437c..f27f4263f 100644 --- a/upstreamed/opencart/requirements.lock +++ b/upstreamed/opencart/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:43:52.539515518+02:00 +generated: 2018-10-16T08:49:13.828477+02:00 diff --git a/upstreamed/opencart/templates/NOTES.txt b/upstreamed/opencart/templates/NOTES.txt index 58c6795b6..a2c81846e 100644 --- a/upstreamed/opencart/templates/NOTES.txt +++ b/upstreamed/opencart/templates/NOTES.txt @@ -10,12 +10,12 @@ host. To configure OpenCart with the URL of your service: 1. Get the OpenCart URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "opencart.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "opencart.fullname" . }}' @@ -39,23 +39,23 @@ host. To configure OpenCart with the URL of your service: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/opencart \ - --set opencartPassword=$APP_PASSWORD,opencartHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} + --set opencartPassword=$APP_PASSWORD,opencartHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} {{- end }} {{- else -}} 1. Get the OpenCart URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo "URL: http://127.0.0.1:8080/" echo "Administration URL: http://127.0.0.1:8080/admin" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "opencart.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "opencart.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} - echo "URL: http://{{ include "opencart.host" . }}/" - echo "Administration URL: http://{{ include "opencart.host" . }}/admin" - +{{- $port:=.Values.service.port | toString }} + echo "URL: http://{{ include "opencart.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + echo "Administration URL: http://{{ include "opencart.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/admin" {{- end }} 2. Get your OpenCart login credentials by running: @@ -75,9 +75,9 @@ host. To configure OpenCart to use and external database host: 1. Complete your OpenCart deployment by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "opencart.fullname" . }}' @@ -92,5 +92,5 @@ host. To configure OpenCart to use and external database host: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/opencart \ - --set opencartPassword=$APP_PASSWORD,opencartHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST + --set opencartPassword=$APP_PASSWORD,opencartHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST {{- end }} diff --git a/upstreamed/opencart/templates/_helpers.tpl b/upstreamed/opencart/templates/_helpers.tpl index f962e464e..8634e78fe 100644 --- a/upstreamed/opencart/templates/_helpers.tpl +++ b/upstreamed/opencart/templates/_helpers.tpl @@ -28,7 +28,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "opencart.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -43,3 +43,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "opencart.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Opencart image name +*/}} +{{- define "opencart.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/opencart/templates/deployment.yaml b/upstreamed/opencart/templates/deployment.yaml index b1eb533d7..53349f362 100644 --- a/upstreamed/opencart/templates/deployment.yaml +++ b/upstreamed/opencart/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "opencart.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "opencart.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "opencart.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -118,6 +131,29 @@ spec: mountPath: /bitnami/opencart - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: opencart-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/opencart/templates/svc.yaml b/upstreamed/opencart/templates/svc.yaml index b7471b930..53d016247 100644 --- a/upstreamed/opencart/templates/svc.yaml +++ b/upstreamed/opencart/templates/svc.yaml @@ -8,16 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ default "" .Values.opencartLoadBalancerIP | quote }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ default "" .Values.service.loadBalancerIP | quote }} {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "opencart.fullname" . }} diff --git a/upstreamed/opencart/values.yaml b/upstreamed/opencart/values.yaml index c9a1d76f0..ae11859a6 100644 --- a/upstreamed/opencart/values.yaml +++ b/upstreamed/opencart/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami OpenCart image version ## ref: https://hub.docker.com/r/bitnami/opencart/tags/ ## image: registry: docker.io repository: bitnami/opencart - tag: 3.0.2-0-debian-9 + tag: 3.0.2-0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -22,11 +28,6 @@ image: ## # opencartHost: -## loadBalancerIP for the OpenCart Service (optional, cloud specific) -## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer -## -# opencartLoadBalancerIP: - ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-opencart#configuration ## @@ -78,6 +79,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -121,7 +124,24 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -158,3 +178,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/orangehrm/Chart.yaml b/upstreamed/orangehrm/Chart.yaml index 8c8674e10..e6fb443ef 100644 --- a/upstreamed/orangehrm/Chart.yaml +++ b/upstreamed/orangehrm/Chart.yaml @@ -1,6 +1,6 @@ name: orangehrm -version: 3.0.3 -appVersion: 4.1.2 +version: 4.0.0 +appVersion: 4.2.0-1 description: OrangeHRM is a free HR management system that offers a wealth of modules to suit the needs of your business. keywords: diff --git a/upstreamed/orangehrm/README.md b/upstreamed/orangehrm/README.md index 4fcad2fee..f85d1360d 100644 --- a/upstreamed/orangehrm/README.md +++ b/upstreamed/orangehrm/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the OrangeHRM chart and | Parameter | Description | Default | |--------------------------------------|------------------------------------------|-------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | OrangeHRM image registry | `docker.io` | | `image.repository` | OrangeHRM Image name | `bitnami/orangehrm` | | `image.tag` | OrangeHRM Image tag | `{VERSION}` | @@ -61,7 +62,12 @@ The following table lists the configurable parameters of the OrangeHRM chart and | `smtpUser` | SMTP user | `nil` | | `smtpPassword` | SMTP password | `nil` | | `smtpProtocol` | SMTP protocol [`ssl`, `none`] | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | @@ -85,6 +91,15 @@ The following table lists the configurable parameters of the OrangeHRM chart and | `mariadb.persistence.storageClass` | PVC Storage Class for MariaDB volume | `nil` (uses alpha storage class annotation) | | `mariadb.persistence.accessMode` | PVC Access Mode for MariaDB volume | `ReadWriteOnce` | | `mariadb.persistence.size` | PVC Storage Request for MariaDB volume | `8Gi` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/orangehrm](http://github.com/bitnami/bitnami-docker-orangehrm). For more information please refer to the [bitnami/orangehrm](http://github.com/bitnami/bitnami-docker-orangehrm) image documentation. @@ -110,7 +125,8 @@ $ helm install --name my-release -f values.yaml stable/orangehrm The [Bitnami OrangeHRM](https://github.com/bitnami/bitnami-docker-orangehrm) image stores the OrangeHRM data and configurations at the `/bitnami/orangehrm` and `/bitnami/apache` paths of the container. -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +Persistent Volume Claims are used to keep the data across deployments. There is a [known issue](https://github.com/kubernetes/kubernetes/issues/39178) in Kubernetes Clusters with EBS in different availability zones. Ensure your cluster is configured properly to create Volumes in the same availability zone where the nodes are running. Kuberentes 1.12 solved this issue with the [Volume Binding Mode](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode). + See the [Configuration](#configuration) section to configure the PVC or to disable persistence. ## Upgrading diff --git a/upstreamed/orangehrm/requirements.lock b/upstreamed/orangehrm/requirements.lock index 642aca3f2..8b429e2ba 100644 --- a/upstreamed/orangehrm/requirements.lock +++ b/upstreamed/orangehrm/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.3 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:46:12.001683527+02:00 +generated: 2018-11-05T18:27:21.241194918Z diff --git a/upstreamed/orangehrm/templates/NOTES.txt b/upstreamed/orangehrm/templates/NOTES.txt index 5206d8f1a..5ffc4029a 100644 --- a/upstreamed/orangehrm/templates/NOTES.txt +++ b/upstreamed/orangehrm/templates/NOTES.txt @@ -4,24 +4,26 @@ 1. Get the OrangeHRM URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "orangehrm.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "OrangeHRM URL: http://$NODE_IP:$NODE_PORT/" -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} ** Please ensure an external IP is associated to the {{ template "orangehrm.fullname" . }} service before proceeding ** ** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "orangehrm.fullname" . }} ** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "orangehrm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "OrangeHRM URL: http://$SERVICE_IP/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "OrangeHRM URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + +{{- else if contains "ClusterIP" .Values.service.type }} echo "OrangeHRM URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "orangehrm.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "orangehrm.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} @@ -42,6 +44,6 @@ host. To configure OrangeHRM to use and external database host: 1. Complete your OrangeHRM deployment by running: - helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/orangehrm + helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/orangehrm {{- end }} diff --git a/upstreamed/orangehrm/templates/_helpers.tpl b/upstreamed/orangehrm/templates/_helpers.tpl index 421032bbe..c9266a39d 100644 --- a/upstreamed/orangehrm/templates/_helpers.tpl +++ b/upstreamed/orangehrm/templates/_helpers.tpl @@ -22,3 +22,36 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "orangehrm.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper OrangeHRM image name +*/}} +{{- define "orangehrm.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/orangehrm/templates/deployment.yaml b/upstreamed/orangehrm/templates/deployment.yaml index 127f3c671..cb873eb84 100644 --- a/upstreamed/orangehrm/templates/deployment.yaml +++ b/upstreamed/orangehrm/templates/deployment.yaml @@ -18,6 +18,15 @@ spec: app: {{ template "orangehrm.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -25,9 +34,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "orangehrm.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "orangehrm.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -103,6 +116,29 @@ spec: mountPath: /bitnami/orangehrm - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: orangehrm-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/orangehrm/templates/svc.yaml b/upstreamed/orangehrm/templates/svc.yaml index 9cb4485e4..291cee6bc 100644 --- a/upstreamed/orangehrm/templates/svc.yaml +++ b/upstreamed/orangehrm/templates/svc.yaml @@ -8,13 +8,22 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "orangehrm.fullname" . }} diff --git a/upstreamed/orangehrm/values.yaml b/upstreamed/orangehrm/values.yaml index 550cf4bb1..eb47163ab 100644 --- a/upstreamed/orangehrm/values.yaml +++ b/upstreamed/orangehrm/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami OrangeHRM image version ## ref: https://hub.docker.com/r/bitnami/orangehrm/tags/ ## image: registry: docker.io repository: bitnami/orangehrm - tag: 4.1.2-debian-9 + tag: 4.2.0-1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -63,6 +69,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -104,9 +112,25 @@ mariadb: size: 8Gi ## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer +## For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -143,3 +167,32 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/osclass/Chart.yaml b/upstreamed/osclass/Chart.yaml index 8d5fac167..073164c27 100644 --- a/upstreamed/osclass/Chart.yaml +++ b/upstreamed/osclass/Chart.yaml @@ -1,5 +1,5 @@ name: osclass -version: 3.0.4 +version: 4.0.0 appVersion: 3.7.4 description: Osclass is a php script that allows you to quickly create and manage your own free classifieds site. diff --git a/upstreamed/osclass/README.md b/upstreamed/osclass/README.md index e624b495f..541e4707b 100644 --- a/upstreamed/osclass/README.md +++ b/upstreamed/osclass/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Osclass chart and t | Parameter | Description | Default | |------------------------------------|------------------------------------------|-------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Osclass image registry | `docker.io` | | `image.repository` | Osclass Image name | `bitnami/osclass` | | `image.tag` | Osclass Image tag | `{VERSION}` | @@ -91,6 +92,15 @@ The following table lists the configurable parameters of the Osclass chart and t | `mariadb.persistence.storageClass` | PVC Storage Class for MariaDB volume | `generic` | | `mariadb.persistence.accessMode` | PVC Access Mode for MariaDB volume | `ReadWriteOnce` | | `mariadb.persistence.size` | PVC Storage Request for MariaDB volume | `8Gi` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/osclass](http://github.com/bitnami/bitnami-docker-osclass). For more information please refer to the [bitnami/osclass](http://github.com/bitnami/bitnami-docker-osclass) image documentation. diff --git a/upstreamed/osclass/requirements.lock b/upstreamed/osclass/requirements.lock index 54514ee67..cd4277dac 100644 --- a/upstreamed/osclass/requirements.lock +++ b/upstreamed/osclass/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:48:30.289513274+02:00 +generated: 2018-10-16T08:49:33.513575+02:00 diff --git a/upstreamed/osclass/templates/NOTES.txt b/upstreamed/osclass/templates/NOTES.txt index a6e2de089..389d05906 100644 --- a/upstreamed/osclass/templates/NOTES.txt +++ b/upstreamed/osclass/templates/NOTES.txt @@ -10,12 +10,12 @@ host. To configure Osclass with the URL of your service: 1. Get the Osclass URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "osclass.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "osclass.fullname" . }}' @@ -39,22 +39,24 @@ host. To configure Osclass with the URL of your service: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/osclass \ - --set osclassPassword=$APP_PASSWORD,osclassHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} + --set osclassPassword=$APP_PASSWORD,osclassHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} {{- end }} {{- else -}} 1. Get the Osclass URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo URL : http://127.0.0.1:8080/ echo Admin URL : http://127.0.0.1:8080/oc-admin/ - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "osclass.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "osclass.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} - echo URL : http://{{ include "osclass.host" . }}/ - echo Admin URL : http://{{ include "osclass.host" . }}/oc-admin/ +{{- $port:=.Values.service.port | toString }} + + echo URL : http://{{ include "osclass.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/ + echo Admin URL : http://{{ include "osclass.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/oc-admin/ {{- end }} @@ -76,9 +78,9 @@ host. To configure Osclass to use and external database host: 1. Complete your Osclass deployment by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "osclass.fullname" . }}' @@ -93,5 +95,5 @@ host. To configure Osclass to use and external database host: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/osclass \ - --set osclassPassword=$APP_PASSWORD,osclassHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST + --set osclassPassword=$APP_PASSWORD,osclassHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST {{- end }} diff --git a/upstreamed/osclass/templates/_helpers.tpl b/upstreamed/osclass/templates/_helpers.tpl index 973ab39d2..207a67610 100644 --- a/upstreamed/osclass/templates/_helpers.tpl +++ b/upstreamed/osclass/templates/_helpers.tpl @@ -28,7 +28,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "osclass.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -43,3 +43,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "osclass.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Osclass image name +*/}} +{{- define "osclass.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/osclass/templates/deployment.yaml b/upstreamed/osclass/templates/deployment.yaml index a646212ec..bc3201fd5 100644 --- a/upstreamed/osclass/templates/deployment.yaml +++ b/upstreamed/osclass/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "osclass.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "osclass.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "osclass.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -62,8 +75,9 @@ spec: name: {{ printf "%s-%s" .Release.Name "externaldb" }} key: db-password {{- end }} + {{- $port:=.Values.service.port | toString }} - name: OSCLASS_HOST - value: {{ include "osclass.host" . | quote }} + value: "{{ include "osclass.host" . }}}}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" - name: OSCLASS_USERNAME value: {{ default "" .Values.osclassUsername | quote }} - name: OSCLASS_PASSWORD @@ -124,6 +138,29 @@ spec: mountPath: /bitnami/osclass - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: osclass-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/osclass/templates/svc.yaml b/upstreamed/osclass/templates/svc.yaml index 6ea898bcf..80f3c9362 100644 --- a/upstreamed/osclass/templates/svc.yaml +++ b/upstreamed/osclass/templates/svc.yaml @@ -8,16 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ default "" .Values.osclassLoadBalancerIP }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "osclass.fullname" . }} diff --git a/upstreamed/osclass/values.yaml b/upstreamed/osclass/values.yaml index 7aacec841..9b3e61e21 100644 --- a/upstreamed/osclass/values.yaml +++ b/upstreamed/osclass/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Osclass image version ## ref: https://hub.docker.com/r/bitnami/osclass/tags/ ## image: registry: docker.io repository: bitnami/osclass - tag: 3.7.4-debian-9 + tag: 3.7.4 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -22,11 +28,6 @@ image: ## # osclassHost: -## loadBalancerIP for the Osclass Service (optional, cloud specific) -## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer -## -# osclassLoadBalancerIP: - ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-osclass#configuration ## @@ -92,6 +93,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -135,7 +138,24 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -172,3 +192,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/owncloud/Chart.yaml b/upstreamed/owncloud/Chart.yaml index 3301aed01..b9d00c77d 100644 --- a/upstreamed/owncloud/Chart.yaml +++ b/upstreamed/owncloud/Chart.yaml @@ -1,5 +1,5 @@ name: owncloud -version: 3.1.0 +version: 4.0.0 appVersion: 10.0.10 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/upstreamed/owncloud/README.md b/upstreamed/owncloud/README.md index c2053b25f..398e9f6a7 100644 --- a/upstreamed/owncloud/README.md +++ b/upstreamed/owncloud/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the ownCloud chart and | Parameter | Description | Default | |-------------------------------------|--------------------------------------------|-------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | ownCloud image registry | `docker.io` | | `image.repository` | ownCloud Image name | `bitnami/owncloud` | | `image.tag` | ownCloud Image tag | `{VERSION}` | @@ -93,6 +94,15 @@ The following table lists the configurable parameters of the ownCloud chart and | `persistence.owncloud.accessMode` | PVC Access Mode for ownCloud volume | `ReadWriteOnce` | | `persistence.owncloud.size` | PVC Storage Request for ownCloud volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/owncloud](http://github.com/bitnami/bitnami-docker-owncloud). For more information please refer to the [bitnami/owncloud](http://github.com/bitnami/bitnami-docker-owncloud) image documentation. @@ -132,7 +142,8 @@ $ helm install --name my-release -f values.yaml stable/owncloud The [Bitnami ownCloud](https://github.com/bitnami/bitnami-docker-owncloud) image stores the ownCloud data and configurations at the `/bitnami/owncloud` and `/bitnami/apache` paths of the container. -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +Persistent Volume Claims are used to keep the data across deployments. There is a [known issue](https://github.com/kubernetes/kubernetes/issues/39178) in Kubernetes Clusters with EBS in different availability zones. Ensure your cluster is configured properly to create Volumes in the same availability zone where the nodes are running. Kuberentes 1.12 solved this issue with the [Volume Binding Mode](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode). + See the [Configuration](#configuration) section to configure the PVC or to disable persistence. ## Upgrading diff --git a/upstreamed/owncloud/requirements.lock b/upstreamed/owncloud/requirements.lock index 5fb8d4b38..6d1d9a962 100644 --- a/upstreamed/owncloud/requirements.lock +++ b/upstreamed/owncloud/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:49:59.281075519+02:00 +generated: 2018-10-16T08:49:42.965735+02:00 diff --git a/upstreamed/owncloud/templates/NOTES.txt b/upstreamed/owncloud/templates/NOTES.txt index 8dbb721cf..d87222fe8 100644 --- a/upstreamed/owncloud/templates/NOTES.txt +++ b/upstreamed/owncloud/templates/NOTES.txt @@ -10,12 +10,12 @@ host. To configure ownCloud with the URL of your service: 1. Get the ownCloud URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "owncloud.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "owncloud.fullname" . }}' @@ -23,35 +23,37 @@ host. To configure ownCloud with the URL of your service: export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "owncloud.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "owncloud.fullname" . }} -o jsonpath="{.data.owncloud-password}" | base64 --decode) {{- if .Values.mariadb.mariadbRootPassword }} - export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "owncloud.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) + export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "owncloud.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} {{- end }} + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "owncloud.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-password}" | base64 --decode) 2. Complete your ownCloud deployment by running: {{- if .Values.mariadb.enabled }} helm upgrade {{ .Release.Name }} stable/owncloud \ - --set owncloudHost=$APP_HOST,owncloudPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} + --set owncloudHost=$APP_HOST,owncloudPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$DATABASE_ROOT_PASSWORD{{ end }},mariadb.db.password=$APP_DATABASE_PASSWORD {{- else }} ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/owncloud \ - --set owncloudPassword=$APP_PASSWORD,owncloudHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} + --set owncloudPassword=$APP_PASSWORD,owncloudHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }} {{- end }} {{- else -}} 1. Get the ownCloud URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo "ownCloud URL: echo http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "owncloud.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "owncloud.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} - echo "ownCloud URL: http://{{ include "owncloud.host" . }}{{ if .Values.owncloudPort }}:{{ .Values.owncloudPort }}{{ end }}/" +{{- $port:=.Values.service.port | toString }} + echo "ownCloud URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- end }} @@ -73,9 +75,9 @@ host. To configure ownCloud to use and external database host: 1. Complete your ownCloud deployment by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "owncloud.fullname" . }}' @@ -90,5 +92,5 @@ host. To configure ownCloud to use and external database host: ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## helm upgrade {{ .Release.Name }} stable/owncloud \ - --set owncloudPassword=$APP_PASSWORD,owncloudHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST + --set owncloudPassword=$APP_PASSWORD,owncloudHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST {{- end }} diff --git a/upstreamed/owncloud/templates/_helpers.tpl b/upstreamed/owncloud/templates/_helpers.tpl index 27c829987..9643573d9 100644 --- a/upstreamed/owncloud/templates/_helpers.tpl +++ b/upstreamed/owncloud/templates/_helpers.tpl @@ -28,7 +28,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "owncloud.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -49,4 +49,37 @@ Create chart name and version as used by the chart label. */}} {{- define "owncloud.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Owncloud image name +*/}} +{{- define "owncloud.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/owncloud/templates/deployment.yaml b/upstreamed/owncloud/templates/deployment.yaml index ceb5e74b2..f6a08d015 100644 --- a/upstreamed/owncloud/templates/deployment.yaml +++ b/upstreamed/owncloud/templates/deployment.yaml @@ -20,6 +20,15 @@ spec: app: {{ template "owncloud.fullname" . }} chart: {{ template "owncloud.chart" . }} release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -27,9 +36,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "owncloud.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "owncloud.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -63,8 +76,9 @@ spec: name: {{ printf "%s-%s" .Release.Name "externaldb" }} key: db-password {{- end }} +{{- $port:=.Values.service.port | toString }} - name: OWNCLOUD_HOST - value: {{ include "owncloud.host" . | quote }} + value: "{{ include "owncloud.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" - name: OWNCLOUD_USERNAME value: {{ default "" .Values.owncloudUsername | quote }} - name: OWNCLOUD_PASSWORD @@ -104,6 +118,29 @@ spec: mountPath: /bitnami/owncloud - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: owncloud-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/owncloud/templates/svc.yaml b/upstreamed/owncloud/templates/svc.yaml index 162b31cad..85dd8c35b 100644 --- a/upstreamed/owncloud/templates/svc.yaml +++ b/upstreamed/owncloud/templates/svc.yaml @@ -8,13 +8,19 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ default "" .Values.owncloudLoadBalancerIP }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} {{- end }} ports: - - name: http - port: 80 - targetPort: http + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "owncloud.fullname" . }} diff --git a/upstreamed/owncloud/values.yaml b/upstreamed/owncloud/values.yaml index 46ee226db..f34a6619f 100644 --- a/upstreamed/owncloud/values.yaml +++ b/upstreamed/owncloud/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami ownCloud image version ## ref: https://hub.docker.com/r/bitnami/owncloud/tags/ ## image: registry: docker.io repository: bitnami/owncloud - tag: 10.0.10-debian-9 + tag: 10.0.10 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -72,11 +78,6 @@ ingress: ## # owncloudHost: -## loadBalancerIP for the ownCloud Service (optional, cloud specific) -## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer -## -# owncloudLoadBalancerIP: - ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-owncloud#configuration ## @@ -119,6 +120,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -162,7 +165,23 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -211,3 +230,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/parse/Chart.yaml b/upstreamed/parse/Chart.yaml index 1b5fa399c..7d93231d7 100644 --- a/upstreamed/parse/Chart.yaml +++ b/upstreamed/parse/Chart.yaml @@ -1,6 +1,6 @@ name: parse -version: 3.0.2 -appVersion: 3.0.0 +version: 5.0.0 +appVersion: 3.1.1 description: Parse is a platform that enables users to add a scalable and powerful backend to launch a full-featured app for iOS, Android, JavaScript, Windows, Unity, and more. keywords: - parse diff --git a/upstreamed/parse/README.md b/upstreamed/parse/README.md index 5b2c0ff7d..d8ccae63a 100644 --- a/upstreamed/parse/README.md +++ b/upstreamed/parse/README.md @@ -47,8 +47,12 @@ The following table lists the configurable parameters of the Parse chart and the | Parameter | Description | Default | |------------------------------------|----------------------------------------|-------------------------------------------------------- | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `loadBalancerIP` | `loadBalancerIP` for the Parse Service | `nil` | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port (Dashboard) | `80` | +| `service.loadBalancerIP` | `loadBalancerIP` for the Parse Service | `nil` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | | `server.image.registry` | Parse image registry | `docker.io` | | `server.image.repository` | Parse image name | `bitnami/parse` | | `server.image.tag` | Parse image tag | `{VERSION}` | diff --git a/upstreamed/parse/requirements.lock b/upstreamed/parse/requirements.lock index 700a3a7ad..a55c58c8b 100644 --- a/upstreamed/parse/requirements.lock +++ b/upstreamed/parse/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mongodb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 2.0.9 -digest: sha256:cf5e28c1a27636f9471953712706834f87e49cb40be80c303a1436ee7e5016e5 -generated: 2018-06-11T14:45:27.64207443+02:00 + version: 4.8.4 +digest: sha256:48512f443b15ce0b80210dd683e9517627640d144ca71c0b509f4b4a1601c5e6 +generated: 2018-11-13T17:28:08.511473529+01:00 diff --git a/upstreamed/parse/requirements.yaml b/upstreamed/parse/requirements.yaml index adcdcd326..fe54e4e51 100644 --- a/upstreamed/parse/requirements.yaml +++ b/upstreamed/parse/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: mongodb - version: 2.x.x + version: 4.x.x repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/upstreamed/parse/templates/NOTES.txt b/upstreamed/parse/templates/NOTES.txt index 56de56e32..90df2cea9 100644 --- a/upstreamed/parse/templates/NOTES.txt +++ b/upstreamed/parse/templates/NOTES.txt @@ -9,20 +9,20 @@ Parse Server 1. Get your Parse Server URL: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" {{ template "parse.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export SERVICE_IP=$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "parse.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "parse.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}"):{{ .Values.server.port }} -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- else if contains "ClusterIP" .Values.service.type }} kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "parse.fullname" . }} {{ .Values.server.port }}:{{ .Values.server.port }} export SERVICE_IP=127.0.0.1:{{ .Values.server.port }} @@ -64,7 +64,7 @@ service: {{ else }} 1. Get the Parse Dashboard URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo "Parse Dashboard URL: http://127.0.0.1:4040/" kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "parse.fullname" . }} 4040:4040 diff --git a/upstreamed/parse/templates/_helpers.tpl b/upstreamed/parse/templates/_helpers.tpl index 7e6de00d4..cb32e1271 100644 --- a/upstreamed/parse/templates/_helpers.tpl +++ b/upstreamed/parse/templates/_helpers.tpl @@ -28,10 +28,10 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "parse.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} -{{- default "" .Values.loadBalancerIP -}} +{{- default "" .Values.service.loadBalancerIP -}} {{- end -}} {{- end -}} @@ -43,3 +43,72 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := default "" .Values.server.host -}} {{- default (include "parse.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Parse image name +*/}} +{{- define "parse.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper Parse dashboard image name +*/}} +{{- define "parse.dashboard.image" -}} +{{- $registryName := .Values.dashboard.image.registry -}} +{{- $repositoryName := .Values.dashboard.image.repository -}} +{{- $tag := .Values.dashboard.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper Parse server client image name +*/}} +{{- define "parse.server.image" -}} +{{- $registryName := .Values.server.image.registry -}} +{{- $repositoryName := .Values.server.image.repository -}} +{{- $tag := .Values.server.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} diff --git a/upstreamed/parse/templates/dashboard-deployment.yaml b/upstreamed/parse/templates/dashboard-deployment.yaml index f794e3bb1..ff984e3a8 100644 --- a/upstreamed/parse/templates/dashboard-deployment.yaml +++ b/upstreamed/parse/templates/dashboard-deployment.yaml @@ -32,7 +32,7 @@ spec: {{- end }} containers: - name: {{ template "parse.fullname" . }} - image: "{{ .Values.dashboard.image.registry }}/{{ .Values.dashboard.image.repository }}:{{ .Values.dashboard.image.tag }}" + image: {{ template "parse.dashboard.image" . }} imagePullPolicy: {{ .Values.dashboard.image.pullPolicy | quote }} env: - name: PARSE_DASHBOARD_USER diff --git a/upstreamed/parse/templates/server-deployment.yaml b/upstreamed/parse/templates/server-deployment.yaml index e465c348b..888f1be91 100644 --- a/upstreamed/parse/templates/server-deployment.yaml +++ b/upstreamed/parse/templates/server-deployment.yaml @@ -31,7 +31,7 @@ spec: {{- end }} containers: - name: {{ template "parse.fullname" . }} - image: "{{ .Values.server.image.registry }}/{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}" + image: {{ template "parse.server.image" . }} imagePullPolicy: {{ .Values.server.image.pullPolicy | quote }} env: - name: PARSE_HOST diff --git a/upstreamed/parse/templates/svc.yaml b/upstreamed/parse/templates/svc.yaml index 44d53dfc3..f82c78966 100644 --- a/upstreamed/parse/templates/svc.yaml +++ b/upstreamed/parse/templates/svc.yaml @@ -8,17 +8,23 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ .Values.loadBalancerIP | quote }} + type: {{ .Values.service.type }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ .Values.service.loadBalancerIP | quote }} + {{- end }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} ports: - name: server-http port: {{ .Values.server.port }} targetPort: server-http - name: dashboard-http - port: 80 + port: {{ .Values.service.port }} targetPort: dashboard-http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} selector: app: {{ template "parse.name" . }} release: "{{ .Release.Name }}" diff --git a/upstreamed/parse/values.yaml b/upstreamed/parse/values.yaml index 57713aa22..41694f691 100644 --- a/upstreamed/parse/values.yaml +++ b/upstreamed/parse/values.yaml @@ -1,12 +1,31 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Kubernetes serviceType for Parse Deployment ## ref: http://kubernetes.io/docs/user-guide/services/#publishing-services---service-types ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # Parse dashboard HTTP Port + port: 80 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + nodePorts: + http: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## loadBalancerIP for the Parse Service (optional, cloud specific) ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer ## -# loadBalancerIP: +# server: ## Bitnami Parse image version @@ -15,7 +34,7 @@ server: image: registry: docker.io repository: bitnami/parse - tag: 3.0.0-debian-9 + tag: 3.1.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -67,7 +86,7 @@ dashboard: image: registry: docker.io repository: bitnami/parse-dashboard - tag: 1.2.0-ol-7 + tag: 1.2.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -123,6 +142,8 @@ persistence: ## ## MongoDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mongodb/values.yaml +## mongodb: ## MongoDB Password authentication usePassword: true diff --git a/upstreamed/phabricator/Chart.yaml b/upstreamed/phabricator/Chart.yaml index 5da88e405..149609720 100644 --- a/upstreamed/phabricator/Chart.yaml +++ b/upstreamed/phabricator/Chart.yaml @@ -1,6 +1,6 @@ name: phabricator -version: 3.1.0 -appVersion: 2018.40.0 +version: 4.0.0 +appVersion: 2018.46.0 description: Collection of open source web applications that help software companies build better software. keywords: - phabricator diff --git a/upstreamed/phabricator/README.md b/upstreamed/phabricator/README.md index 9d566125e..cd43566bd 100644 --- a/upstreamed/phabricator/README.md +++ b/upstreamed/phabricator/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Phabricator chart a | Parameter | Description | Default | |----------------------------------------|----------------------------------------------|----------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Phabricator image registry | `docker.io` | | `image.repository` | Phabricator image name | `bitnami/phabricator` | | `image.tag` | Phabricator image tag | `{VERSION}` | @@ -56,7 +57,6 @@ The following table lists the configurable parameters of the Phabricator chart a | `image.pullSecrets` | Specify image pull secrets | `nil` | | `phabricatorHost` | Phabricator host to create application URLs | `nil` | | `phabricatorAlternateFileDomain` | Phabricator alternate domain to upload files | `nil` | -| `phabricatorLoadBalancerIP` | `loadBalancerIP` for the Phabricator Service | `nil` | | `phabricatorUsername` | User of the application | `user` | | `phabricatorPassword` | Application password | _random 10 character long alphanumeric string_ | | `phabricatorEmail` | Admin email | `user@example.com` | @@ -68,7 +68,13 @@ The following table lists the configurable parameters of the Phabricator chart a | `smtpPassword` | SMTP password | `nil` | | `smtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` | | `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTP port | `443` | +| `service.loadBalancerIP` | `loadBalancerIP` for the Phabricator Service | `nil` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | | `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | @@ -87,6 +93,15 @@ The following table lists the configurable parameters of the Phabricator chart a | `ingress.secrets[0].name` | TLS Secret Name | `nil` | | `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | | `ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/phabricator](http://github.com/bitnami/bitnami-docker-phabricator). For more information please refer to the [bitnami/phabricator](http://github.com/bitnami/bitnami-docker-phabricator) image documentation. @@ -126,7 +141,8 @@ $ helm install --name my-release -f values.yaml stable/phabricator The [Bitnami Phabricator](https://github.com/bitnami/bitnami-docker-phabricator) image stores the Phabricator data and configurations at the `/bitnami/phabricator` and `/bitnami/apache` paths of the container. -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +Persistent Volume Claims are used to keep the data across deployments. There is a [known issue](https://github.com/kubernetes/kubernetes/issues/39178) in Kubernetes Clusters with EBS in different availability zones. Ensure your cluster is configured properly to create Volumes in the same availability zone where the nodes are running. Kuberentes 1.12 solved this issue with the [Volume Binding Mode](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode). + See the [Configuration](#configuration) section to configure the PVC or to disable persistence. ## Ingress With Reverse Proxy And Kube Lego diff --git a/upstreamed/phabricator/requirements.lock b/upstreamed/phabricator/requirements.lock index b80cf36fc..9cd3e0f80 100644 --- a/upstreamed/phabricator/requirements.lock +++ b/upstreamed/phabricator/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.9 + version: 5.2.3 digest: sha256:e09c8ca7126923a30e39f442c3863b44684d4eb3f7b6dc869f0206da4463f416 -generated: 2018-10-09T14:11:47.8079908Z +generated: 2018-11-13T00:07:48.787894577Z diff --git a/upstreamed/phabricator/templates/NOTES.txt b/upstreamed/phabricator/templates/NOTES.txt index d93017f84..ef2e0283f 100644 --- a/upstreamed/phabricator/templates/NOTES.txt +++ b/upstreamed/phabricator/templates/NOTES.txt @@ -8,39 +8,38 @@ host. To configure Phabricator with the URL of your service: 1. Get the Phabricator URL by running: - {{- if contains "NodePort" .Values.serviceType }} + {{- if contains "NodePort" .Values.service.type }} export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - {{- else if contains "LoadBalancer" .Values.serviceType }} + {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "phabricator.fullname" . }}' export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) - {{- if .Values.mariadb.mariadbRootPassword }} - export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) - {{- end }} + export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} 2. Complete your Phabricator deployment by running: - helm upgrade {{ .Release.Name }} \ - --set phabricatorHost=$APP_HOST,phabricatorPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} stable/phabricator + helm upgrade {{ .Release.Name }} stable/phabricator \ + --set phabricatorHost=$APP_HOST,phabricatorPassword=$APP_PASSWORD,mariadb.rootUser.password=$DATABASE_ROOT_PASSWORD {{- else -}} 1. Get the Phabricator URL by running: -{{- if eq .Values.serviceType "ClusterIP" }} +{{- if eq .Values.service.type "ClusterIP" }} echo "Phabricator URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "phabricator.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "phabricator.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} - echo "Phabricator URL: http://{{ include "phabricator.host" . }}/" +{{- $port:=.Values.service.port | toString }} + echo "Phabricator URL: http://{{ include "phabricator.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- end }} diff --git a/upstreamed/phabricator/templates/_helpers.tpl b/upstreamed/phabricator/templates/_helpers.tpl index 196d93969..40a6c86a6 100644 --- a/upstreamed/phabricator/templates/_helpers.tpl +++ b/upstreamed/phabricator/templates/_helpers.tpl @@ -28,7 +28,7 @@ Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} {{- define "phabricator.serviceIP" -}} -{{- if eq .Values.serviceType "ClusterIP" -}} +{{- if eq .Values.service.type "ClusterIP" -}} 127.0.0.1 {{- else -}} {{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} @@ -43,3 +43,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "phabricator.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Phabricator image name +*/}} +{{- define "phabricator.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/phabricator/templates/deployment.yaml b/upstreamed/phabricator/templates/deployment.yaml index df6f8af37..cca4e3393 100644 --- a/upstreamed/phabricator/templates/deployment.yaml +++ b/upstreamed/phabricator/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "phabricator.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "phabricator.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: MARIADB_HOST @@ -40,8 +53,9 @@ spec: secretKeyRef: name: {{ template "phabricator.mariadb.fullname" . }} key: mariadb-root-password +{{- $port:=.Values.service.port | toString }} - name: PHABRICATOR_HOST - value: {{ include "phabricator.host" . | quote }} + value: "{{ include "phabricator.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" {{- if .Values.phabricatorAlternateFileDomain }} - name: PHABRICATOR_ALTERNATE_FILE_DOMAIN value: {{ .Values.phabricatorAlternateFileDomain | quote }} @@ -120,6 +134,29 @@ spec: mountPath: /bitnami/phabricator - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: phabricator-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/phabricator/templates/svc.yaml b/upstreamed/phabricator/templates/svc.yaml index 8dbc8d6c5..ff724cf39 100644 --- a/upstreamed/phabricator/templates/svc.yaml +++ b/upstreamed/phabricator/templates/svc.yaml @@ -8,16 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if eq .Values.serviceType "LoadBalancer" }} - loadBalancerIP: {{ default "" .Values.phabricatorLoadBalancerIP }} + type: {{ .Values.service.type }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} + {{- end }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "phabricator.fullname" . }} diff --git a/upstreamed/phabricator/values.yaml b/upstreamed/phabricator/values.yaml index 64809642a..ed146515c 100644 --- a/upstreamed/phabricator/values.yaml +++ b/upstreamed/phabricator/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Phabricator image version ## ref: https://hub.docker.com/r/bitnami/phabricator/tags/ ## image: registry: docker.io repository: bitnami/phabricator - tag: 2018.40.0-debian-9 + tag: 2018.46.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -27,11 +33,6 @@ image: ## # phabricatorAlternateFileDomain: -## loadBalancerIP for the Phabricator Service (optional, cloud specific) -## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer -## -# phabricatorLoadBalancerIP: - ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-phabricator#configuration ## @@ -70,6 +71,8 @@ phabricatorLastName: Last Name ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -103,7 +106,24 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## loadBalancerIP: + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -186,3 +206,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/phpbb/Chart.yaml b/upstreamed/phpbb/Chart.yaml index 34519a311..fe86b6f30 100644 --- a/upstreamed/phpbb/Chart.yaml +++ b/upstreamed/phpbb/Chart.yaml @@ -1,6 +1,6 @@ name: phpbb -version: 3.0.3 -appVersion: 3.2.3 +version: 4.0.0 +appVersion: 3.2.4 description: Community forum that supports the notion of users and groups, file attachments, full-text search, notifications and more. keywords: diff --git a/upstreamed/phpbb/README.md b/upstreamed/phpbb/README.md index a971c089d..cfcc031ea 100644 --- a/upstreamed/phpbb/README.md +++ b/upstreamed/phpbb/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the phpBB chart and the | Parameter | Description | Default | |-----------------------------------|---------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | phpBB image registry | `docker.io` | | `image.repository` | phpBB image name | `bitnami/phpbb` | | `image.tag` | phpBB image tag | `{VERSION}` | @@ -71,7 +72,14 @@ The following table lists the configurable parameters of the phpBB chart and the | `mariadb.db.name` | Database name to create | `bitnami_phpbb` | | `mariadb.db.user` | Database user to create | `bn_phpbb` | | `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port (Dashboard) | `80` | +| `nodePorts.http` | Kubernetes http node port | `""` | +| `nodePorts.https` | Kubernetes https node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.loadBalancerIP` | LoadBalancer service IP | `""` | | `persistence.enabled` | Enable persistence using PVC | `true` | | `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | | `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | @@ -80,6 +88,15 @@ The following table lists the configurable parameters of the phpBB chart and the | `persistence.phpbb.accessMode` | PVC Access Mode for phpBB volume | `ReadWriteOnce` | | `persistence.phpbb.size` | PVC Storage Request for phpBB volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/phpbb](http://github.com/bitnami/bitnami-docker-phpbb). For more information please refer to the [bitnami/phpbb](http://github.com/bitnami/bitnami-docker-phpbb) image documentation. diff --git a/upstreamed/phpbb/requirements.lock b/upstreamed/phpbb/requirements.lock index adc8b11ac..ca0c6a891 100644 --- a/upstreamed/phpbb/requirements.lock +++ b/upstreamed/phpbb/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.3 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:54:08.872296213+02:00 +generated: 2018-11-20T10:22:49.801551704Z diff --git a/upstreamed/phpbb/templates/NOTES.txt b/upstreamed/phpbb/templates/NOTES.txt index 7e53671cc..d9267ac6a 100644 --- a/upstreamed/phpbb/templates/NOTES.txt +++ b/upstreamed/phpbb/templates/NOTES.txt @@ -2,24 +2,26 @@ 1. Get the phpBB URL by running: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "phpbb.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "phpBB URL: http://$NODE_IP:$NODE_PORT/" -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "phpbb.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phpbb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "phpBB URL: http://$SERVICE_IP/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- $port:=.Values.service.port | toString }} + echo "phpBB URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + +{{- else if contains "ClusterIP" .Values.service.type }} echo "phpBB URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "phpbb.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "phpbb.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} @@ -40,6 +42,6 @@ host. To configure phpBB to use and external database host: 1. Complete your phpBB deployment by running: - helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/phpbb + helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/phpbb {{- end }} diff --git a/upstreamed/phpbb/templates/_helpers.tpl b/upstreamed/phpbb/templates/_helpers.tpl index ba3f29229..0cd37d5d4 100644 --- a/upstreamed/phpbb/templates/_helpers.tpl +++ b/upstreamed/phpbb/templates/_helpers.tpl @@ -22,3 +22,36 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "phpbb.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper phpbb image name +*/}} +{{- define "phpbb.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/phpbb/templates/deployment.yaml b/upstreamed/phpbb/templates/deployment.yaml index da9d4999e..a1540c01b 100644 --- a/upstreamed/phpbb/templates/deployment.yaml +++ b/upstreamed/phpbb/templates/deployment.yaml @@ -20,6 +20,15 @@ spec: app: {{ template "phpbb.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -27,9 +36,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "phpbb.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "phpbb.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -112,6 +125,29 @@ spec: mountPath: /bitnami/phpbb - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: phpbb-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/phpbb/templates/svc.yaml b/upstreamed/phpbb/templates/svc.yaml index 3692d03ff..beeeffabe 100644 --- a/upstreamed/phpbb/templates/svc.yaml +++ b/upstreamed/phpbb/templates/svc.yaml @@ -8,13 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} + {{- if eq .Values.service.type "LoadBalancer" }} + loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} + {{- end }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "phpbb.fullname" . }} diff --git a/upstreamed/phpbb/values.yaml b/upstreamed/phpbb/values.yaml index d364a8b0c..9e16d2edb 100644 --- a/upstreamed/phpbb/values.yaml +++ b/upstreamed/phpbb/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami phpBB image version ## ref: https://hub.docker.com/r/bitnami/phpbb/tags/ ## image: registry: docker.io repository: bitnami/phpbb - tag: 3.2.3-debian-9 + tag: 3.2.4 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -67,6 +73,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -110,7 +118,25 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## -serviceType: LoadBalancer +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## loadBalancerIP: + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -147,3 +173,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/phpmyadmin/Chart.yaml b/upstreamed/phpmyadmin/Chart.yaml index 5428366d2..b8d5c4cd0 100644 --- a/upstreamed/phpmyadmin/Chart.yaml +++ b/upstreamed/phpmyadmin/Chart.yaml @@ -1,6 +1,6 @@ name: phpmyadmin -version: 1.1.2 -appVersion: 4.8.2 +version: 1.3.0 +appVersion: 4.8.3 description: phpMyAdmin is an mysql administration frontend keywords: - mariadb diff --git a/upstreamed/phpmyadmin/README.md b/upstreamed/phpmyadmin/README.md index 06daf784e..9ad79f093 100644 --- a/upstreamed/phpmyadmin/README.md +++ b/upstreamed/phpmyadmin/README.md @@ -44,27 +44,37 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the phpMyAdmin chart and their default values. -| Parameter | Description | Default | -|--------------------------------------|------------------------------------------|---------------------------------------------------------| -| `image.registry` | phpMyAdmin image registry | `docker.io` | -| `image.repository` | phpMyAdmin Image name | `bitnami/phpmyadmin` | -| `image.tag` | phpMyAdmin Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `service.type` | type of service for phpMyAdmin frontend | `ClusterIP` | -| `service.port` | port to expose service | `80` | -| `db.port` | database port to use to connect | `3306` | -| `db.chartName` | Database suffix if included in the same release | `nil` | -| `db.host` | database host to connect to | `nil` | -| `ingress.enabled` | ingress resource to be added | `false` | -| `ingress.annotations` | ingress annotations | `{ingress.kubernetes.io/rewrite-target: /, nginx.ingress.kubernetes.io/rewrite-target: /}` | -| `ingress.path` | path to access frontend | `/` | -| `ingress.host` | ingress host | `nil` | -| `ingress.tls` | tls for ingress | `[]` | -| `resources` | CPU/Memory resource requests/limits | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | List of node taints to tolerate | `[]` | -| `affinity` | Map of node/pod affinities | `{}` | +| Parameter | Description | Default | +|----------------------------|------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | phpMyAdmin image registry | `docker.io` | +| `image.repository` | phpMyAdmin image name | `bitnami/phpmyadmin` | +| `image.tag` | phpMyAdmin image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `service.type` | Type of service for phpMyAdmin frontend | `ClusterIP` | +| `service.port` | Port to expose service | `80` | +| `db.port` | Database port to use to connect | `3306` | +| `db.chartName` | Database suffix if included in the same release | `nil` | +| `db.host` | Database host to connect to | `nil` | +| `ingress.enabled` | Ingress resource to be added | `false` | +| `ingress.annotations` | Ingress annotations | `{ingress.kubernetes.io/rewrite-target: /, nginx.ingress.kubernetes.io/rewrite-target: /}` | +| `ingress.path` | Path to access frontend | `/` | +| `ingress.host` | Ingress host | `nil` | +| `ingress.tls` | TLS for ingress | `[]` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | List of node taints to tolerate | `[]` | +| `affinity` | Map of node/pod affinities | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | For more information please refer to the [bitnami/phpmyadmin](http://github.com/bitnami/bitnami-docker-Phpmyadmin) image documentation. diff --git a/upstreamed/phpmyadmin/templates/_helpers.tpl b/upstreamed/phpmyadmin/templates/_helpers.tpl index 131be64f4..514e5b15e 100644 --- a/upstreamed/phpmyadmin/templates/_helpers.tpl +++ b/upstreamed/phpmyadmin/templates/_helpers.tpl @@ -40,11 +40,34 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{/* -Return the proper image name +Return the proper PHPMyAdmin image name */}} {{- define "phpmyadmin.image" -}} -{{- $registryName := .Values.image.registry -}} +{{- $registryName := .Values.image.registry -}} {{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} {{- end -}} diff --git a/upstreamed/phpmyadmin/templates/deployment.yaml b/upstreamed/phpmyadmin/templates/deployment.yaml index 8fa52ad07..dd79273f9 100644 --- a/upstreamed/phpmyadmin/templates/deployment.yaml +++ b/upstreamed/phpmyadmin/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "phpmyadmin.name" . }} chart: {{ template "phpmyadmin.chart" . }} release: {{ .Release.Name }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ .Chart.Name }} - image: "{{ template "phpmyadmin.image" . }}" + image: {{ template "phpmyadmin.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: DATABASE_PORT_NUMBER @@ -68,6 +81,29 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: +{{ toYaml .Values.metrics.resources | indent 12 }} +{{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/upstreamed/phpmyadmin/values.yaml b/upstreamed/phpmyadmin/values.yaml index ab29bdfe9..dfe6faf5a 100644 --- a/upstreamed/phpmyadmin/values.yaml +++ b/upstreamed/phpmyadmin/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami WordPress image version ## ref: https://hub.docker.com/r/bitnami/phpmyadmin/tags/ ## image: registry: docker.io repository: bitnami/phpmyadmin - tag: 4.8.2-debian-9 + tag: 4.8.3 ## Specify a imagePullPolicy pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. @@ -75,3 +81,30 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} + +## Pod annotations +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/postgresql/.helmignore b/upstreamed/postgresql/.helmignore new file mode 100644 index 000000000..a1c17ae45 --- /dev/null +++ b/upstreamed/postgresql/.helmignore @@ -0,0 +1,2 @@ +.git +OWNERS \ No newline at end of file diff --git a/bitnami/postgresql/Chart.yaml b/upstreamed/postgresql/Chart.yaml similarity index 51% rename from bitnami/postgresql/Chart.yaml rename to upstreamed/postgresql/Chart.yaml index 198c7826d..7e4e208ae 100644 --- a/bitnami/postgresql/Chart.yaml +++ b/upstreamed/postgresql/Chart.yaml @@ -1,18 +1,21 @@ name: postgresql -version: 3.0.2 -appVersion: 10.5.0 -description: Chart for PostgreSQL +version: 2.6.3 +appVersion: 10.6.0 +description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. keywords: - postgresql +- postgres - database - sql - replication - cluster -home: http://www.postgresql.org +home: https://www.postgresql.org/ +icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-110x117.png sources: - https://github.com/bitnami/bitnami-docker-postgresql maintainers: - name: Bitnami email: containers@bitnami.com +- name: desaintmartin + email: cedric@desaintmartin.fr engine: gotpl -icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-110x117.png diff --git a/upstreamed/postgresql/OWNERS b/upstreamed/postgresql/OWNERS new file mode 100644 index 000000000..9f1a364b5 --- /dev/null +++ b/upstreamed/postgresql/OWNERS @@ -0,0 +1,14 @@ +approvers: +- prydonius +- tompizmor +- sameersbn +- carrodher +- juan131 +- desaintmartin +reviewers: +- prydonius +- tompizmor +- sameersbn +- carrodher +- juan131 +- desaintmartin \ No newline at end of file diff --git a/upstreamed/postgresql/README.md b/upstreamed/postgresql/README.md new file mode 100644 index 000000000..be84efb2c --- /dev/null +++ b/upstreamed/postgresql/README.md @@ -0,0 +1,238 @@ +# PostgreSQL + +[PostgreSQL](https://www.postgresql.org/) is an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. + +## TL;DR; + +```console +$ helm install stable/postgresql +``` + +## Introduction + +This chart bootstraps a [PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. + +## Prerequisites + +- Kubernetes 1.4+ with Beta APIs enabled +- PV provisioner support in the underlying infrastructure + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release stable/postgresql +``` + +The command deploys PostgreSQL on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following tables lists the configurable parameters of the PostgreSQL chart and their default values. + +| Parameter | Description | Default | +|-----------------------------------------------|----------------------------------------------------|---------------------------------------------------------- | +| `global.imageRegistry` | Global Docker Image registry | `nil` | +| `image.registry` | PostgreSQL Image registry | `docker.io` | +| `image.repository` | PostgreSQL Image name | `bitnami/postgresql` | +| `image.tag` | PostgreSQL Image tag | `{VERSION}` | +| `image.pullPolicy` | PostgreSQL Image pull policy | `Always` | +| `image.pullSecrets` | Specify Image pull secrets | `nil` (does not add image pull secrets to deployed pods) | +| `image.debug` | Specify if debug values should be set | `false` | +| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | +| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` | +| `volumePermissions.image.tag` | Init container volume-permissions image tag | `latest` | +| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy| `Always` | +| `volumePermissions.securityContext.runAsUser` | User ID for the init container | `0` | +| `replication.enabled` | Would you like to enable replication | `false` | +| `replication.user` | Replication user | `repl_user` | +| `replication.password` | Replication user password | `repl_password` | +| `replication.slaveReplicas` | Number of slaves replicas | `1` | +| `postgresqlUsername` | PostgreSQL admin user | `postgres` | +| `postgresqlPassword` | PostgreSQL admin password | _random 10 character alphanumeric string_ | +| `postgresqlDatabase` | PostgreSQL database | `nil` | +| `postgresqlConfiguration` | Runtime Config Parameters | `nil` | +| `pgHbaConfiguration` | Content of pg\_hba.conf | `nil (do not create pg_hba.conf)` | +| `initdbScripts` | List of initdb scripts | `nil` | +| `service.type` | Kubernetes Service type | `ClusterIP` | +| `service.port` | PostgreSQL port | `5432` | +| `service.nodePort` | Kubernetes Service nodePort | `nil` | +| `service.annotations` | Annotations for PostgreSQL service | {} | +| `service.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `nil` | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.storageClass` | PVC Storage Class for PostgreSQL volume | `nil` | +| `persistence.accessMode` | PVC Access Mode for PostgreSQL volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` | +| `persistence.annotations` | Annotations for the PVC | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `affinity` | Affinity labels for pod assignment | `{}` | +| `tolerations` | Toleration labels for pod assignment | `[]` | +| `terminationGracePeriodSeconds` | Seconds the pod needs to terminate gracefully | `nil` | +| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `livenessProbe.enabled` | Would you like a livessProbed to be enabled | `true` | +| `networkPolicy.enabled` | Enable NetworkPolicy | `false` | +| `networkPolicy.allowExternal` | Don't require client label for connections | `true` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | +| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | +| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | +| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | +| `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 | +| `readinessProbe.periodSeconds` | How often to perform the probe | 10 | +| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | +| `metrics.enabled` | Start a prometheus exporter | `false` | +| `metrics.service.type` | Kubernetes Service type | `ClusterIP` | +| `metrics.service.annotatios` | Additional annotations for metrics exporter pod | `{}` | +| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` | +| `metrics.image.registry` | PostgreSQL Image registry | `docker.io` | +| `metrics.image.repository` | PostgreSQL Image name | `wrouesnel/postgres_exporter` | +| `metrics.image.tag` | PostgreSQL Image tag | `{VERSION}` | +| `metrics.image.pullPolicy` | PostgreSQL Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify Image pull secrets | `nil` (does not add image pull secrets to deployed pods) | +| `extraEnv` | Any extra environment variables you would like to pass on to the pod | `{}` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```console +$ helm install --name my-release \ + --set postgresqlPassword=secretpassword,postgresqlDatabase=my-database \ + stable/postgresql +``` + +The above command sets the PostgreSQL `postgres` account password to `secretpassword`. Additionally it creates a database named `my-database`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```console +$ helm install --name my-release -f values.yaml stable/postgresql +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +### postgresql.conf / pg_hba.conf files as configMap + +This helm chart also supports to customize the whole configuration file. + +Add your custom file to "files/postgresql.conf" in your working directory. This file will be mounted as configMap to the containers and it will be used for configuring the PostgreSQL server. + +Alternatively, you can specify PostgreSQL configuration parameters using the `postgresqlConfiguration` parameter as a dict, using camelCase, e.g. {"sharedBuffers": "500MB"}. + +## Initialize a fresh instance + +The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder `files/docker-entrypoint-initdb.d` so they can be consumed as a ConfigMap. + +Alternatively, you can specify custom scripts using the `initdbScripts` parameter as dict. + +The allowed extensions are `.sh`, `.sql` and `.sql.gz`. + +## Production and horizontal scaling + +The following repo contains the recommended production settings for PostgreSQL server in an alternative [values file](values-production.yaml). Please read carefully the comments in the values-production.yaml file to set up your environment + +To horizontally scale this chart, first download the [values-production.yaml](values-production.yaml) file to your local folder, then: + +```console +$ helm install --name my-release -f ./values-production.yaml stable/postgresql +$ kubectl scale statefulset my-postgresql-slave --replicas=3 +``` + +## Persistence + +The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image stores the PostgreSQL data and configurations at the `/bitnami/postgresql` path of the container. + +Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +See the [Configuration](#configuration) section to configure the PVC or to disable persistence. + +## Metrics + +The chart optionally can start a metrics exporter for [prometheus](https://prometheus.io). The metrics endpoint (port 9187) is not exposed and it is expected that the metrics are collected from inside the k8s cluster using something similar as the described in the [example Prometheus scrape configuration](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml). + +The exporter allows to create custom metrics from additional SQL queries. See the Chart's `values.yaml` for an example and consult the [exporters documentation](https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file) for more details. + +## NetworkPolicy + +To enable network policy for PostgreSQL, install [a networking plugin that implements the Kubernetes NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), and set `networkPolicy.enabled` to `true`. + +For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting the DefaultDeny namespace annotation. Note: this will enforce policy for _all_ pods in the namespace: + +```console +$ kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}" +``` + +With NetworkPolicy enabled, traffic will be limited to just port 5432. + +For more precise policy, set `networkPolicy.allowExternal=false`. This will only allow pods with the generated client label to connect to PostgreSQL. +This label will be displayed in the output of a successful install. + +## Upgrade + +In order to upgrade from the `0.X.X` branch to `1.X.X`, you should follow the below steps: + + - Obtain the service name (`SERVICE_NAME`) and password (`OLD_PASSWORD`) of the existing postgresql chart. You can find the instructions to obtain the password in the NOTES.txt, the service name can be obtained by running + + ```console +$ kubectl get svc + ``` + +- Install (not upgrade) the new version + +```console +$ helm repo update +$ helm install --name my-release stable/postgresql +``` + +- Connect to the new pod (you can obtain the name by running `kubectl get pods`): + +```console +$ kubectl exec -it NAME bash +``` + +- Once logged in, create a dump file from the previous database using `pg_dump`, for that we should connect to the previous postgresql chart: + +```console +$ pg_dump -h SERVICE_NAME -U postgres DATABASE_NAME > /tmp/backup.sql +``` + +After run above command you should be prompted for a password, this password is the previous chart password (`OLD_PASSWORD`). +This operation could take some time depending on the database size. + +- Once you have the backup file, you can restore it with a command like the one below: + +```console +$ psql -U postgres DATABASE_NAME < /tmp/backup.sql +``` + +In this case, you are accessing to the local postgresql, so the password should be the new one (you can find it in NOTES.txt). + +If you want to restore the database and the database schema does not exist, it is necessary to first follow the steps described below. + +```console +$ psql -U postgres +postgres=# drop database DATABASE_NAME; +postgres=# create database DATABASE_NAME; +postgres=# create user USER_NAME; +postgres=# alter role USER_NAME with password 'BITNAMI_USER_PASSWORD'; +postgres=# grant all privileges on database DATABASE_NAME to USER_NAME; +postgres=# alter database DATABASE_NAME owner to USER_NAME; +``` diff --git a/upstreamed/postgresql/files/README.md b/upstreamed/postgresql/files/README.md new file mode 100644 index 000000000..1813a2fea --- /dev/null +++ b/upstreamed/postgresql/files/README.md @@ -0,0 +1 @@ +Copy here your postgresql.conf and/or pg_hba.conf files to use it as a config map. diff --git a/bitnami/postgresql/files/docker-entrypoint-initdb.d/README.md b/upstreamed/postgresql/files/docker-entrypoint-initdb.d/README.md similarity index 100% rename from bitnami/postgresql/files/docker-entrypoint-initdb.d/README.md rename to upstreamed/postgresql/files/docker-entrypoint-initdb.d/README.md diff --git a/bitnami/postgresql/templates/NOTES.txt b/upstreamed/postgresql/templates/NOTES.txt similarity index 79% rename from bitnami/postgresql/templates/NOTES.txt rename to upstreamed/postgresql/templates/NOTES.txt index a85ddbb94..8b30cfbec 100644 --- a/bitnami/postgresql/templates/NOTES.txt +++ b/upstreamed/postgresql/templates/NOTES.txt @@ -4,11 +4,11 @@ WARNING By specifying "serviceType=LoadBalancer" and not specifying "postgresqlPassword" - you have most likely exposed the PostgreSQL service externally without any + you have most likely exposed the PostgreSQL service externally without any authentication mechanism. For security reasons, we strongly suggest that you switch to "ClusterIP" or - "NodePort". As alternative, you can also specify a valid password on the + "NodePort". As an alternative, you can also specify a valid password on the "postgresqlPassword" parameter. ------------------------------------------------------------------------------- @@ -27,7 +27,12 @@ To get the password for "{{ .Values.postgresqlUsername }}" run: To connect to your database run the following command: - kubectl run {{ template "postgresql.fullname" . }}-client --rm --tty -i --image bitnami/postgresql --env="PGPASSWORD=$POSTGRESQL_PASSWORD" --command -- psql --host {{ template "postgresql.fullname" . }} -U {{ .Values.postgresqlUsername }} + kubectl run {{ template "postgresql.fullname" . }}-client --rm --tty -i --image bitnami/postgresql --env="PGPASSWORD=$POSTGRESQL_PASSWORD" {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} + --labels="{{ template "postgresql.fullname" . }}-client=true" {{- end }} --command -- psql --host {{ template "postgresql.fullname" . }} -U {{ .Values.postgresqlUsername }} + +{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} +Note: Since NetworkPolicy is enabled, only pods with label {{ template "postgresql.fullname" . }}-client=true" will be able to connect to this PostgreSQL cluster. +{{- end }} To connect to your database from outside the cluster execute the following commands: diff --git a/upstreamed/postgresql/templates/_helpers.tpl b/upstreamed/postgresql/templates/_helpers.tpl new file mode 100644 index 000000000..f62c720d2 --- /dev/null +++ b/upstreamed/postgresql/templates/_helpers.tpl @@ -0,0 +1,107 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "postgresql.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "postgresql.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "postgresql.master.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if .Values.replication.enabled -}} +{{- printf "%s-%s-%s" .Release.Name $name "master" | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for networkpolicy. +*/}} +{{- define "postgresql.networkPolicy.apiVersion" -}} +{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion -}} +"extensions/v1beta1" +{{- else if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion -}} +"networking.k8s.io/v1" +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "postgresql.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Return the proper PostgreSQL image name +*/}} +{{- define "postgresql.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name to change the volume permissions +*/}} +{{- define "postgresql.volumePermissions.image" -}} +{{- $registryName := .Values.volumePermissions.image.registry -}} +{{- $repositoryName := .Values.volumePermissions.image.repository -}} +{{- $tag := .Values.volumePermissions.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + + +{{/* +Return the proper PostgreSQL metrics image name +*/}} +{{- define "metrics.image" -}} +{{- $registryName := default "docker.io" .Values.metrics.image.registry -}} +{{- $tag := default "latest" .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName .Values.metrics.image.repository $tag -}} +{{- end -}} diff --git a/upstreamed/postgresql/templates/configmap.yaml b/upstreamed/postgresql/templates/configmap.yaml new file mode 100644 index 000000000..7c18c01c5 --- /dev/null +++ b/upstreamed/postgresql/templates/configmap.yaml @@ -0,0 +1,26 @@ +{{ if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "postgresql.fullname" . }}-configuration + labels: + app: {{ template "postgresql.name" . }} + chart: {{ template "postgresql.chart" . }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +data: +{{- if (.Files.Glob "files/postgresql.conf") }} +{{ (.Files.Glob "files/postgresql.conf").AsConfig | indent 2 }} +{{- else if .Values.postgresqlConfiguration }} + postgresql.conf: | +{{- range $key, $value := default dict .Values.postgresqlConfiguration }} + {{ $key | snakecase }}={{ $value }} +{{- end }} +{{- end }} +{{- if (.Files.Glob "files/pg_hba.conf") }} +{{ (.Files.Glob "files/pg_hba.conf").AsConfig | indent 2 }} +{{- else if .Values.pgHbaConfiguration }} + pg_hba.conf: | +{{ .Values.pgHbaConfiguration | indent 4 }} +{{- end }} +{{ end }} diff --git a/bitnami/postgresql/templates/initialization-configmap.yaml b/upstreamed/postgresql/templates/initialization-configmap.yaml similarity index 71% rename from bitnami/postgresql/templates/initialization-configmap.yaml rename to upstreamed/postgresql/templates/initialization-configmap.yaml index 657590e73..078d50823 100644 --- a/bitnami/postgresql/templates/initialization-configmap.yaml +++ b/upstreamed/postgresql/templates/initialization-configmap.yaml @@ -3,9 +3,12 @@ kind: ConfigMap metadata: name: {{ template "postgresql.fullname" . }}-init-scripts labels: - app: "{{ template "postgresql.name" . }}" + app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} data: -{{ (.Files.Glob "files/docker-entrypoint-initdb.d/*").AsConfig | indent 2 }} \ No newline at end of file +{{ (.Files.Glob "files/docker-entrypoint-initdb.d/*").AsConfig | indent 2 }} +{{- with .Values.initdbScripts }} +{{ toYaml . | indent 2 }} +{{- end }} diff --git a/bitnami/postgresql/templates/metrics-deployment.yaml b/upstreamed/postgresql/templates/metrics-deployment.yaml similarity index 78% rename from bitnami/postgresql/templates/metrics-deployment.yaml rename to upstreamed/postgresql/templates/metrics-deployment.yaml index b86220fbf..fb6e0d9d9 100644 --- a/bitnami/postgresql/templates/metrics-deployment.yaml +++ b/upstreamed/postgresql/templates/metrics-deployment.yaml @@ -6,13 +6,18 @@ metadata: labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + release: {{ .Release.Name | quote}} + heritage: {{ .Release.Service | quote }} spec: + selector: + matchLabels: + release: {{ .Release.Name | quote }} + app: {{ template "postgresql.name" . }} + role: metrics template: metadata: labels: - release: "{{ .Release.Name }}" + release: {{ .Release.Name | quote }} app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} role: metrics @@ -43,8 +48,15 @@ spec: image: {{ template "metrics.image" . }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} env: - - name: DATA_SOURCE_NAME - value: {{ printf "postgresql://%s:%s@%s:%d/?sslmode=disable" (.Values.postgresqlUsername) (.Values.postgresqlPassword) ( include "postgresql.fullname" . ) (int .Values.service.port) | quote }} + - name: DATA_SOURCE_URI + value: {{ printf "%s:%d/?sslmode=disable" ( include "postgresql.fullname" . ) (int .Values.service.port) | quote }} + - name: DATA_SOURCE_PASS + valueFrom: + secretKeyRef: + name: {{ template "postgresql.fullname" . }} + key: postgresql-password + - name: DATA_SOURCE_USER + value: {{ .Values.postgresqlUsername }} {{- if .Values.livenessProbe.enabled }} livenessProbe: httpGet: diff --git a/bitnami/postgresql/templates/metrics-svc.yaml b/upstreamed/postgresql/templates/metrics-svc.yaml similarity index 72% rename from bitnami/postgresql/templates/metrics-svc.yaml rename to upstreamed/postgresql/templates/metrics-svc.yaml index e1af27873..0559c8cfd 100644 --- a/bitnami/postgresql/templates/metrics-svc.yaml +++ b/upstreamed/postgresql/templates/metrics-svc.yaml @@ -6,16 +6,15 @@ metadata: labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} annotations: {{ toYaml .Values.metrics.service.annotations | indent 4 }} spec: type: {{ .Values.metrics.service.type }} - {{ if eq .Values.metrics.service.type "LoadBalancer" -}} {{ if .Values.metrics.service.loadBalancerIP -}} + {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerIP }} loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }} - {{ end -}} - {{- end -}} + {{- end }} ports: - name: metrics port: 9187 @@ -24,4 +23,4 @@ spec: app: {{ template "postgresql.name" . }} release: {{ .Release.Name }} role: metrics -{{- end }} \ No newline at end of file +{{- end }} diff --git a/upstreamed/postgresql/templates/networkpolicy.yaml b/upstreamed/postgresql/templates/networkpolicy.yaml new file mode 100644 index 000000000..40496a763 --- /dev/null +++ b/upstreamed/postgresql/templates/networkpolicy.yaml @@ -0,0 +1,29 @@ +{{- if .Values.networkPolicy.enabled }} +kind: NetworkPolicy +apiVersion: {{ template "postgresql.networkPolicy.apiVersion" . }} +metadata: + name: {{ template "postgresql.fullname" . }} + labels: + app: {{ template "postgresql.name" . }} + chart: {{ template "postgresql.chart" . }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +spec: + podSelector: + matchLabels: + app: {{ template "postgresql.name" . }} + release: {{ .Release.Name | quote }} + ingress: + # Allow inbound connections + - ports: + - port: 5432 + {{- if not .Values.networkPolicy.allowExternal }} + from: + - podSelector: + matchLabels: + {{ template "postgresql.fullname" . }}-client: "true" + {{- end }} + # Allow prometheus scrapes + - ports: + - port: 9187 +{{- end }} diff --git a/bitnami/postgresql/templates/secrets.yaml b/upstreamed/postgresql/templates/secrets.yaml similarity index 88% rename from bitnami/postgresql/templates/secrets.yaml rename to upstreamed/postgresql/templates/secrets.yaml index e123512a7..3ba26396f 100644 --- a/bitnami/postgresql/templates/secrets.yaml +++ b/upstreamed/postgresql/templates/secrets.yaml @@ -5,8 +5,8 @@ metadata: labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} type: Opaque data: {{ if .Values.postgresqlPassword }} diff --git a/bitnami/postgresql/templates/statefulset-slaves.yaml b/upstreamed/postgresql/templates/statefulset-slaves.yaml similarity index 69% rename from bitnami/postgresql/templates/statefulset-slaves.yaml rename to upstreamed/postgresql/templates/statefulset-slaves.yaml index c9fab8147..450a636f3 100644 --- a/bitnami/postgresql/templates/statefulset-slaves.yaml +++ b/upstreamed/postgresql/templates/statefulset-slaves.yaml @@ -20,9 +20,9 @@ spec: role: slave template: metadata: - name: "{{ template "postgresql.fullname" . }}" + name: {{ template "postgresql.fullname" . }} labels: - app: "{{ template "postgresql.name" . }}" + app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} @@ -42,23 +42,49 @@ spec: {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} + {{- if .Values.terminationGracePeriodSeconds }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- end }} + {{- if and .Values.persistence.enabled .Values.securityContext.enabled}} + initContainers: + - name: init-chmod-data + image: {{ template "postgresql.volumePermissions.image" . }} + imagePullPolicy: "{{ .Values.volumePermissions.image.pullPolicy }}" + command: + - sh + - -c + - | + chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} /bitnami + if [ -d /bitnami/postgresql/data ]; then + chmod 0700 /bitnami/postgresql/data; + fi + securityContext: + runAsUser: {{ .Values.volumePermissions.securityContext.runAsUser }} + volumeMounts: + - name: data + mountPath: /bitnami/postgresql + {{ end }} containers: - - name: "{{ template "postgresql.fullname" . }}" - image: "{{ template "postgresql.image" . }}" + - name: {{ template "postgresql.fullname" . }} + image: {{ template "postgresql.image" . }} imagePullPolicy: "{{ .Values.image.pullPolicy }}" resources: -{{ toYaml .Values.Resources | indent 10 }} +{{ toYaml .Values.resources | indent 10 }} env: {{- if .Values.image.debug}} - name: BASH_DEBUG - value: 1 + value: "1" - name: NAMI_DEBUG - value: 1 + value: "1" {{- end }} - name: POSTGRESQL_REPLICATION_MODE value: "slave" @@ -84,7 +110,7 @@ spec: command: - sh - -c - - exec pg_isready -U {{ default "" .Values.postgresqlUsername | quote }} --host $POD_IP + - exec pg_isready -U {{ .Values.postgresqlUsername | quote }} --host $POD_IP initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} @@ -97,7 +123,7 @@ spec: command: - sh - -c - - exec pg_isready -U {{ default "" .Values.postgresqlUsername | quote }} --host $POD_IP + - exec pg_isready -U {{ .Values.postgresqlUsername | quote }} --host $POD_IP initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} @@ -109,13 +135,18 @@ spec: - name: data mountPath: /bitnami/postgresql {{ end }} - {{ if (.Files.Glob "files/postgresql.conf") }} + {{ if or (.Files.Glob "files/postgresql.conf") .Values.postgresqlConfiguration }} - name: postgresql-config mountPath: /opt/bitnami/postgresql/conf/postgresql.conf subPath: postgresql.conf {{ end }} + {{ if or (.Files.Glob "files/pg_hba.conf") .Values.pgHbaConfiguration }} + - name: postgresql-config + mountPath: /opt/bitnami/postgresql/conf/pg_hba.conf + subPath: pg_hba.conf + {{ end }} volumes: - {{ if (.Files.Glob "files/postgresql.conf") }} + {{ if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration }} - name: postgresql-config configMap: name: {{ template "postgresql.fullname" . }}-configuration @@ -124,10 +155,12 @@ spec: volumeClaimTemplates: - metadata: name: data + {{- with .Values.persistence.annotations }} annotations: - {{- range $key, $value := .Values.persistence.annotations }} + {{- range $key, $value := . }} {{ $key }}: {{ $value }} {{- end }} + {{- end }} spec: accessModes: {{- range .Values.persistence.accessModes }} @@ -148,5 +181,3 @@ spec: emptyDir: {} {{- end }} {{- end }} - - diff --git a/bitnami/postgresql/templates/statefulset.yaml b/upstreamed/postgresql/templates/statefulset.yaml similarity index 68% rename from bitnami/postgresql/templates/statefulset.yaml rename to upstreamed/postgresql/templates/statefulset.yaml index e6d4a77bf..4ba233c9a 100644 --- a/bitnami/postgresql/templates/statefulset.yaml +++ b/upstreamed/postgresql/templates/statefulset.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1beta2 kind: StatefulSet metadata: - name: "{{ template "postgresql.master.fullname" . }}" + name: {{ template "postgresql.master.fullname" . }} labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} @@ -19,7 +19,7 @@ spec: role: master template: metadata: - name: "{{ template "postgresql.fullname" . }}" + name: {{ template "postgresql.fullname" . }} labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} @@ -41,18 +41,50 @@ spec: {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} + {{- if .Values.terminationGracePeriodSeconds }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- end }} + {{- if and .Values.persistence.enabled .Values.securityContext.enabled}} + initContainers: + - name: init-chmod-data + image: {{ template "postgresql.volumePermissions.image" . }} + imagePullPolicy: "{{ .Values.volumePermissions.image.pullPolicy }}" + command: + - sh + - -c + - | + chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} /bitnami + if [ -d /bitnami/postgresql/data ]; then + chmod 0700 /bitnami/postgresql/data; + fi + securityContext: + runAsUser: {{ .Values.volumePermissions.securityContext.runAsUser }} + volumeMounts: + - name: data + mountPath: /bitnami/postgresql + {{ end }} containers: - - name: "{{ template "postgresql.fullname" . }}" - image: "{{ template "postgresql.image" . }}" + - name: {{ template "postgresql.fullname" . }} + image: {{ template "postgresql.image" . }} imagePullPolicy: "{{ .Values.image.pullPolicy }}" resources: -{{ toYaml .Values.Resources | indent 10 }} +{{ toYaml .Values.resources | indent 10 }} env: + {{- if .Values.image.debug}} + - name: BASH_DEBUG + value: "1" + - name: NAMI_DEBUG + value: "1" + {{- end }} {{- if .Values.replication.enabled }} - name: POSTGRESQL_REPLICATION_MODE value: "master" @@ -75,6 +107,9 @@ spec: value: {{ .Values.postgresqlDatabase | quote }} - name: POD_IP valueFrom: { fieldRef: { fieldPath: status.podIP } } +{{- if .Values.extraEnv }} +{{ toYaml .Values.extraEnv | indent 8 }} +{{- end }} ports: - name: postgresql containerPort: {{ .Values.service.port }} @@ -84,7 +119,7 @@ spec: command: - sh - -c - - exec pg_isready -U {{ default "" .Values.postgresqlUsername | quote }} --host $POD_IP + - exec pg_isready -U {{ .Values.postgresqlUsername | quote }} --host $POD_IP initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} @@ -97,7 +132,7 @@ spec: command: - sh - -c - - exec pg_isready -U {{ default "" .Values.postgresqlUsername | quote }} --host $POD_IP + - exec pg_isready -U {{ .Values.postgresqlUsername | quote }} --host $POD_IP initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} @@ -111,13 +146,18 @@ spec: - name: data mountPath: /bitnami/postgresql {{ end }} - {{ if (.Files.Glob "files/postgresql.conf") }} + {{ if or (.Files.Glob "files/postgresql.conf") .Values.postgresqlConfiguration }} - name: postgresql-config mountPath: /opt/bitnami/postgresql/conf/postgresql.conf subPath: postgresql.conf {{ end }} + {{ if or (.Files.Glob "files/pg_hba.conf") .Values.pgHbaConfiguration }} + - name: postgresql-config + mountPath: /opt/bitnami/postgresql/conf/pg_hba.conf + subPath: pg_hba.conf + {{ end }} volumes: - {{ if (.Files.Glob "files/postgresql.conf") }} + {{ if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration }} - name: postgresql-config configMap: name: {{ template "postgresql.fullname" . }}-configuration @@ -129,10 +169,12 @@ spec: volumeClaimTemplates: - metadata: name: data + {{- with .Values.persistence.annotations }} annotations: - {{- range $key, $value := .Values.persistence.annotations }} + {{- range $key, $value := . }} {{ $key }}: {{ $value }} {{- end }} + {{- end }} spec: accessModes: {{- range .Values.persistence.accessModes }} @@ -152,5 +194,3 @@ spec: - name: data emptyDir: {} {{- end }} - - diff --git a/bitnami/postgresql/templates/svc-headless.yaml b/upstreamed/postgresql/templates/svc-headless.yaml similarity index 74% rename from bitnami/postgresql/templates/svc-headless.yaml rename to upstreamed/postgresql/templates/svc-headless.yaml index 738123ca6..9414d609a 100644 --- a/bitnami/postgresql/templates/svc-headless.yaml +++ b/upstreamed/postgresql/templates/svc-headless.yaml @@ -5,8 +5,8 @@ metadata: labels: app: {{ template "postgresql.name" . }} chart: {{ template "postgresql.chart" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} spec: type: ClusterIP clusterIP: None @@ -16,4 +16,4 @@ spec: targetPort: postgresql selector: app: {{ template "postgresql.name" . }} - release: "{{ .Release.Name }}" + release: {{ .Release.Name | quote }} diff --git a/upstreamed/postgresql/templates/svc.yaml b/upstreamed/postgresql/templates/svc.yaml new file mode 100644 index 000000000..6b44457d4 --- /dev/null +++ b/upstreamed/postgresql/templates/svc.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "postgresql.fullname" . }} + labels: + app: {{ template "postgresql.name" . }} + chart: {{ template "postgresql.chart" . }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} + {{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + ports: + - name: postgresql + port: {{ .Values.service.port }} + targetPort: postgresql + {{- if .Values.service.nodePort }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + selector: + app: {{ template "postgresql.name" . }} + release: {{ .Release.Name | quote }} + role: master diff --git a/bitnami/postgresql/values-production.yaml b/upstreamed/postgresql/values-production.yaml similarity index 62% rename from bitnami/postgresql/values-production.yaml rename to upstreamed/postgresql/values-production.yaml index c22dcd08b..ed33072f4 100644 --- a/bitnami/postgresql/values-production.yaml +++ b/upstreamed/postgresql/values-production.yaml @@ -1,28 +1,47 @@ +## Global Docker image registry +### Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +### +## global: +## imageRegistry: + ## Bitnami PostgreSQL image version ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ ## image: registry: docker.io repository: bitnami/postgresql - tag: 10.5.0-debian-9 + tag: 10.6.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## pullPolicy: Always - + ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName - + # - myRegistrKeySecretName + ## Set to true if you would like to see extra information on logs ## It turns BASH and NAMI debugging in minideb ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging debug: false +## +## Init containers parameters: +## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup +## +volumePermissions: + image: + registry: docker.io + repository: bitnami/minideb + tag: latest + pullPolicy: Always + securityContext: + runAsUser: 0 + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## @@ -51,13 +70,50 @@ postgresqlUsername: postgres ## # postgresqlDatabase: -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer +## PostgreSQL configuration +## Specify runtime configuration parameters as a dict, using camelCase, e.g. +## {"sharedBuffers": "500MB"} +## Alternatively, you can put your postgresql.conf under the files/ directory +## ref: https://www.postgresql.org/docs/current/static/runtime-config.html ## +# postgresqlConfiguration: + +## PostgreSQL client authentication configuration +## Specify content for pg_hba.conf +## Default: do not create pg_hba.conf +## Alternatively, you can put your pg_hba.conf under the files/ directory +# pgHbaConfiguration: |- +# local all all trust +# host all all localhost trust +# host mydatabase mysuser 192.168.0.0/24 md5 + +## initdb scripts +## Specify dictionnary of scripts to be run at first boot +## Alternatively, you can put your scripts under the files/docker-entrypoint-initdb.d directory +## +# initdbScripts: +# my_init_script.sh:| +# #!/bin/sh +# echo "Do something." + +## PostgreSQL service configuration service: + ## PosgresSQL service type type: ClusterIP port: 5432 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + annotations: {} + ## Set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + # loadBalancerIP: + ## PostgreSQL data Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning @@ -87,6 +143,18 @@ resources: memory: 256Mi cpu: 250m +networkPolicy: + ## Enable creation of NetworkPolicy resources. + ## + enabled: false + + ## The Policy model to apply. When set to false, only pods with the correct + ## client label will have network access to the port PostgreSQL is listening + ## on. When true, PostgreSQL will accept connections from any source + ## (with the correct destination port). + ## + allowExternal: true + ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: @@ -106,16 +174,16 @@ readinessProbe: successThreshold: 1 ## Configure metrics exporter -## +## metrics: - enabled: false + enabled: true # resources: {} # podAnnotations: {} service: type: ClusterIP - annotations: {} - # prometheus.io/scrape: "true" - # prometheus.io/port: "9187" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9187" loadBalancerIP: image: registry: docker.io @@ -145,7 +213,7 @@ metrics: timeoutSeconds: 5 failureThreshold: 6 successThreshold: 1 - + readinessProbe: enabled: true initialDelaySeconds: 5 @@ -153,3 +221,6 @@ metrics: timeoutSeconds: 5 failureThreshold: 6 successThreshold: 1 + +# Define custom environment variables to pass to the image here +extraEnv: {} diff --git a/bitnami/postgresql/values.yaml b/upstreamed/postgresql/values.yaml similarity index 59% rename from bitnami/postgresql/values.yaml rename to upstreamed/postgresql/values.yaml index aa3a33389..ad5c0e3b8 100644 --- a/bitnami/postgresql/values.yaml +++ b/upstreamed/postgresql/values.yaml @@ -1,28 +1,47 @@ +## Global Docker image registry +### Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +### +## global: +## imageRegistry: + ## Bitnami PostgreSQL image version ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ ## image: registry: docker.io repository: bitnami/postgresql - tag: 10.5.0-debian-9 + tag: 10.6.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## pullPolicy: Always - + ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName - + # - myRegistrKeySecretName + ## Set to true if you would like to see extra information on logs ## It turns BASH and NAMI debugging in minideb ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging debug: false +## +## Init containers parameters: +## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup +## +volumePermissions: + image: + registry: docker.io + repository: bitnami/minideb + tag: latest + pullPolicy: Always + securityContext: + runAsUser: 0 + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## @@ -51,13 +70,55 @@ postgresqlUsername: postgres ## # postgresqlDatabase: -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer +## PostgreSQL configuration +## Specify runtime configuration parameters as a dict, using camelCase, e.g. +## {"sharedBuffers": "500MB"} +## Alternatively, you can put your postgresql.conf under the files/ directory +## ref: https://www.postgresql.org/docs/current/static/runtime-config.html ## +# postgresqlConfiguration: + +## PostgreSQL client authentication configuration +## Specify content for pg_hba.conf +## Default: do not create pg_hba.conf +## Alternatively, you can put your pg_hba.conf under the files/ directory +# pgHbaConfiguration: |- +# local all all trust +# host all all localhost trust +# host mydatabase mysuser 192.168.0.0/24 md5 + +## initdb scripts +## Specify dictionnary of scripts to be run at first boot +## Alternatively, you can put your scripts under the files/docker-entrypoint-initdb.d directory +## +# initdbScripts: +# my_init_script.sh:| +# #!/bin/sh +# echo "Do something." + +## Optional duration in seconds the pod needs to terminate gracefully. +## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods +## +# terminationGracePeriodSeconds: 30 + +## PostgreSQL service configuration service: + ## PosgresSQL service type type: ClusterIP port: 5432 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + + ## Provide any additional annotations which may be required. This can be used to + annotations: {} + ## Set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + # loadBalancerIP: + ## PostgreSQL data Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning @@ -73,10 +134,12 @@ persistence: size: 8Gi annotations: {} -## Node labels and tolerations for pod assignment +## Node, affinity and tolerations labels for pod assignment ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature nodeSelector: {} +affinity: {} tolerations: [] ## Configure resource requests and limits @@ -87,6 +150,18 @@ resources: memory: 256Mi cpu: 250m +networkPolicy: + ## Enable creation of NetworkPolicy resources. + ## + enabled: false + + ## The Policy model to apply. When set to false, only pods with the correct + ## client label will have network access to the port PostgreSQL is listening + ## on. When true, PostgreSQL will accept connections from any source + ## (with the correct destination port). + ## + allowExternal: true + ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: @@ -106,16 +181,16 @@ readinessProbe: successThreshold: 1 ## Configure metrics exporter -## +## metrics: enabled: false # resources: {} # podAnnotations: {} service: type: ClusterIP - annotations: {} - # prometheus.io/scrape: "true" - # prometheus.io/port: "9187" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9187" loadBalancerIP: image: registry: docker.io @@ -145,7 +220,7 @@ metrics: timeoutSeconds: 5 failureThreshold: 6 successThreshold: 1 - + readinessProbe: enabled: true initialDelaySeconds: 5 @@ -153,3 +228,6 @@ metrics: timeoutSeconds: 5 failureThreshold: 6 successThreshold: 1 + +# Define custom environment variables to pass to the image here +extraEnv: {} diff --git a/upstreamed/prestashop/Chart.yaml b/upstreamed/prestashop/Chart.yaml index c65ad3932..fdee3369a 100644 --- a/upstreamed/prestashop/Chart.yaml +++ b/upstreamed/prestashop/Chart.yaml @@ -1,6 +1,6 @@ name: prestashop -version: 3.1.4 -appVersion: 1.7.4-3 +version: 4.1.1 +appVersion: 1.7.4-4 description: A popular open source ecommerce solution. Professional tools are easily accessible to increase online sales including instant guest checkout, abandoned cart reminders and automated Email marketing. diff --git a/upstreamed/prestashop/README.md b/upstreamed/prestashop/README.md index 82011318b..fcb748120 100644 --- a/upstreamed/prestashop/README.md +++ b/upstreamed/prestashop/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the PrestaShop chart an | Parameter | Description | Default | |---------------------------------------|----------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | PrestaShop image registry | `docker.io` | | `image.repository` | PrestaShop image name | `bitnami/prestashop` | | `image.tag` | PrestaShop image tag | `{VERSION}` | @@ -82,12 +83,10 @@ The following table lists the configurable parameters of the PrestaShop chart an | `externalTrafficPolicy` | Set to `Local` to preserve the client source IP | `Local` | | `sessionAffinity` | Configures the session affinity | `None` | | `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | -| `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.prestashop.storageClass` | PVC Storage Class for PrestaShop volume | `nil` (uses alpha storage class annotation) | -| `persistence.prestashop.accessMode` | PVC Access Mode for PrestaShop volume | `ReadWriteOnce` | -| `persistence.prestashop.size` | PVC Storage Request for PrestaShop volume | `8Gi` | +| `persistence.storageClass` | PVC Storage Class for PrestaShop volume | `nil` (uses alpha storage class annotation) | +| `persistence.existingClaim` | An Existing PVC name for Apache volume | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | PVC Access Mode for PrestaShop volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for PrestaShop volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | | `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 600 | | `livenessProbe.periodSeconds` | How often to perform the probe | 3 | @@ -99,6 +98,15 @@ The following table lists the configurable parameters of the PrestaShop chart an | `readinessProbe.timeoutSeconds` | When the probe times out | 5 | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/prestashop](http://github.com/bitnami/bitnami-docker-prestashop). For more information please refer to the [bitnami/prestashop](http://github.com/bitnami/bitnami-docker-prestashop) image documentation. diff --git a/upstreamed/prestashop/requirements.lock b/upstreamed/prestashop/requirements.lock index c79564cd6..43c77d9fe 100644 --- a/upstreamed/prestashop/requirements.lock +++ b/upstreamed/prestashop/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.8 + version: 5.2.3 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-10-04T13:28:11.27444912Z +generated: 2018-11-07T18:41:04.985875501Z diff --git a/upstreamed/prestashop/templates/NOTES.txt b/upstreamed/prestashop/templates/NOTES.txt index 417ad210a..15f0040d2 100644 --- a/upstreamed/prestashop/templates/NOTES.txt +++ b/upstreamed/prestashop/templates/NOTES.txt @@ -23,16 +23,17 @@ host. To configure PrestaShop with the URL of your service: export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) {{- if .Values.mariadb.mariadbRootPassword }} - export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) + export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} {{- end }} + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-password}" | base64 --decode) 2. Complete your PrestaShop deployment by running: {{- if .Values.mariadb.enabled }} helm upgrade {{ .Release.Name }} stable/prestashop \ - --set prestashopHost=$APP_HOST,prestashopPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} + --set prestashopHost=$APP_HOST,prestashopPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$DATABASE_ROOT_PASSWORD{{ end }},mariadb.db.password=$APP_DATABASE_PASSWORD {{- else }} ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## diff --git a/upstreamed/prestashop/templates/_helpers.tpl b/upstreamed/prestashop/templates/_helpers.tpl index 4bf8b34cb..681bf841f 100644 --- a/upstreamed/prestashop/templates/_helpers.tpl +++ b/upstreamed/prestashop/templates/_helpers.tpl @@ -43,3 +43,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "prestashop.serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper Prestashop image name +*/}} +{{- define "prestashop.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/prestashop/templates/apache-pvc.yaml b/upstreamed/prestashop/templates/apache-pvc.yaml deleted file mode 100644 index e4775ca0f..000000000 --- a/upstreamed/prestashop/templates/apache-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.persistence.enabled -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "prestashop.fullname" . }}-apache - labels: - app: {{ template "prestashop.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - accessModes: - - {{ .Values.persistence.apache.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.apache.size | quote }} -{{- if .Values.persistence.apache.storageClass }} -{{- if (eq "-" .Values.persistence.apache.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.apache.storageClass }}" -{{- end }} -{{- end }} -{{- end -}} diff --git a/upstreamed/prestashop/templates/deployment.yaml b/upstreamed/prestashop/templates/deployment.yaml index 086ee3fa7..260057ead 100644 --- a/upstreamed/prestashop/templates/deployment.yaml +++ b/upstreamed/prestashop/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "prestashop.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "prestashop.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "prestashop.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -128,22 +141,40 @@ spec: resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: - - name: prestashop-data - mountPath: /bitnami/prestashop - - name: apache-data - mountPath: /bitnami/apache + - mountPath: /bitnami/apache + name: prestashop-data + subPath: apache + - mountPath: /bitnami/prestashop + name: prestashop-data + subPath: prestashop +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: +{{ toYaml .Values.metrics.resources | indent 12 }} +{{- end }} volumes: - name: prestashop-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "prestashop.fullname" . }}-prestashop - {{- else }} - emptyDir: {} - {{- end }} - - name: apache-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "prestashop.fullname" . }}-apache + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "prestashop.fullname" . }}-prestashop{{- end }} {{- else }} emptyDir: {} {{- end }} diff --git a/upstreamed/prestashop/templates/prestashop-pvc.yaml b/upstreamed/prestashop/templates/prestashop-pvc.yaml index 2bffffbad..cbee4e6a6 100644 --- a/upstreamed/prestashop/templates/prestashop-pvc.yaml +++ b/upstreamed/prestashop/templates/prestashop-pvc.yaml @@ -10,15 +10,15 @@ metadata: heritage: "{{ .Release.Service }}" spec: accessModes: - - {{ .Values.persistence.prestashop.accessMode | quote }} + - {{ .Values.persistence.accessMode | quote }} resources: requests: - storage: {{ .Values.persistence.prestashop.size | quote }} -{{- if .Values.persistence.prestashop.storageClass }} -{{- if (eq "-" .Values.persistence.prestashop.storageClass) }} + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistence.prestashop.storageClass }}" + storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} {{- end }} {{- end -}} diff --git a/upstreamed/prestashop/values.yaml b/upstreamed/prestashop/values.yaml index ff885fc06..f8a511ff2 100644 --- a/upstreamed/prestashop/values.yaml +++ b/upstreamed/prestashop/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami PrestaShop image version ## ref: https://hub.docker.com/r/bitnami/prestashop/tags/ ## image: registry: docker.io repository: bitnami/prestashop - tag: 1.7.4-3-debian-9 + tag: 1.7.4-4 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -94,6 +100,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -153,28 +161,22 @@ sessionAffinity: "None" ## persistence: enabled: true - apache: - ## apache data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 1Gi - prestashop: - ## prestashop data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi + ## Prestashop Data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + accessMode: ReadWriteOnce + size: 8Gi ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ @@ -198,3 +200,32 @@ readinessProbe: timeoutSeconds: 3 failureThreshold: 6 successThreshold: 1 + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/rabbitmq/.helmignore b/upstreamed/rabbitmq/.helmignore index 6b8710a71..acbcabf42 100644 --- a/upstreamed/rabbitmq/.helmignore +++ b/upstreamed/rabbitmq/.helmignore @@ -1 +1,2 @@ .git +OWNERS diff --git a/upstreamed/rabbitmq/Chart.yaml b/upstreamed/rabbitmq/Chart.yaml index c43fce9aa..e885b07de 100644 --- a/upstreamed/rabbitmq/Chart.yaml +++ b/upstreamed/rabbitmq/Chart.yaml @@ -1,5 +1,5 @@ name: rabbitmq -version: 3.4.1 +version: 3.6.3 appVersion: 3.7.8 description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP) keywords: @@ -13,4 +13,6 @@ sources: maintainers: - name: Bitnami email: containers@bitnami.com +- name: desaintmartin + email: cedric@desaintmartin.fr engine: gotpl diff --git a/upstreamed/rabbitmq/OWNERS b/upstreamed/rabbitmq/OWNERS index 2c3e9fa1a..0e93555cf 100644 --- a/upstreamed/rabbitmq/OWNERS +++ b/upstreamed/rabbitmq/OWNERS @@ -1,12 +1,14 @@ approvers: -- prydonius -- tompizmor -- sameersbn - carrodher +- desaintmartin - juan131 +- prydonius +- sameersbn +- tompizmor reviewers: -- prydonius -- tompizmor -- sameersbn - carrodher +- desaintmartin - juan131 +- prydonius +- sameersbn +- tompizmor diff --git a/upstreamed/rabbitmq/README.md b/upstreamed/rabbitmq/README.md index 75cccef1b..e95717064 100644 --- a/upstreamed/rabbitmq/README.md +++ b/upstreamed/rabbitmq/README.md @@ -45,62 +45,64 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the RabbitMQ chart and their default values. -| Parameter | Description | Default | -|-----------------------------|---------------------------------------------------------|----------------------------------------------------------| -| `image.registry` | Rabbitmq Image registry | `docker.io` | -| `image.repository` | Rabbitmq Image name | `bitnami/rabbitmq` | -| `image.tag` | Rabbitmq Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | -| `image.debug` | Specify if debug values should be set | `false` | -| `rbacEnabled` | Specify if rbac is enabled in your cluster | `true` | -| `rabbitmq.username` | RabbitMQ application username | `user` | -| `rabbitmq.password` | RabbitMQ application password | _random 10 character long alphanumeric string_ | -| `rabbitmq.erlangCookie` | Erlang cookie | _random 32 character long alphanumeric string_ | -| `rabbitmq.amqpPort` | Amqp port | `5672` | -| `rabbitmq.distPort` | Erlang distribution server port | `25672` | -| `rabbitmq.nodePort` | Node port override, if serviceType NodePort | _random avaliable between 30000-32767_ | -| `rabbitmq.managerPort` | RabbitMQ Manager port | `15672` | -| `rabbitmq.diskFreeLimit` | Disk free limit | `"6GiB"` | -| `rabbitmq.plugins` | configuration file for plugins to enable | `[rabbitmq_management,rabbitmq_peer_discovery_k8s].` | -| `rabbitmq.clustering.address_type` | Switch clustering mode | `ip` or `hostname` -| `rabbitmq.clustering.k8s_domain` | Customize internal k8s cluster domain | `cluster.local` -| `rabbitmq.ulimitNofiles` | Max File Descriptor limit | `65536` | -| `rabbitmq.configuration` | rabbitmq.conf content | see values.yaml | -| `serviceType` | Kubernetes Service type | `ClusterIP` | -| `persistence.enabled` | Use a PVC to persist data | `false` | -| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | -| `persistence.size` | Size of data volume | `8Gi` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | -| `resources` | resource needs and limits to apply to the pod | {} | -| `nodeSelector` | Node labels for pod assignment | {} | -| `affinity` | Affinity settings for pod assignment | {} | -| `tolerations` | Toleration labels for pod assignment | [] | -| `ingress.enabled` | enable ingress for management console | `false` | -| `ingress.tls` | enable ingress with tls | `false` | -| `ingress.tlsSecret` | tls type secret to be used | `myTlsSecret` | -| `ingress.annotations` | ingress annotations as an array | [] | -| `livenessProbe.enabled` | would you like a livenessProbed to be enabled | `true` | -| `livenessProbe.initialDelaySeconds` | number of seconds | 120 | -| `livenessProbe.timeoutSeconds` | number of seconds | 5 | -| `livenessProbe.periodSeconds` | number of seconds | 5 | -| `livenessProbe.failureThreshold` | number of failures | 6 | -| `livenessProbe.successThreshold` | number of successes | 1 | -| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | -| `readinessProbe.initialDelaySeconds` | number of seconds | 10 | -| `readinessProbe.timeoutSeconds` | number of seconds | 3 | -| `readinessProbe.periodSeconds ` | number of seconds | 5 | -| `readinessProbe.failureThreshold` | number of failures | 3 | -| `readinessProbe.successThreshold` | number of successes | 1 | -| `metrics.enabled` | Start a side-car prometheus exporter | `false` | -| `metrics.image.registry` | Exporter image registry | `docker.io` | -| `metrics.image.repository` | Exporter image name | `kbudde/rabbitmq-exporter` | -| `metrics.image.tag` | Exporter image tag | `v0.29.0` | -| `metrics.image.pullPolicy` | Exporter image pull policy | `IfNotPresent` | -| `metrics.resources` | Exporter resource requests/limit | `nil` | +| Parameter | Description | Default | +| ------------------------------------ | ------------------------------------------------ | ------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `image.registry` | Rabbitmq Image registry | `docker.io` | +| `image.repository` | Rabbitmq Image name | `bitnami/rabbitmq` | +| `image.tag` | Rabbitmq Image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `image.debug` | Specify if debug values should be set | `false` | +| `rbacEnabled` | Specify if rbac is enabled in your cluster | `true` | +| `rabbitmq.username` | RabbitMQ application username | `user` | +| `rabbitmq.password` | RabbitMQ application password | _random 10 character long alphanumeric string_ | +| `rabbitmq.erlangCookie` | Erlang cookie | _random 32 character long alphanumeric string_ | +| `rabbitmq.amqpPort` | Amqp port | `5672` | +| `rabbitmq.distPort` | Erlang distribution server port | `25672` | +| `rabbitmq.nodePort` | Node port override, if serviceType NodePort | _random available between 30000-32767_ | +| `rabbitmq.managerPort` | RabbitMQ Manager port | `15672` | +| `rabbitmq.diskFreeLimit` | Disk free limit | `"6GiB"` | +| `rabbitmq.plugins` | configuration file for plugins to enable | `[rabbitmq_management,rabbitmq_peer_discovery_k8s].` | +| `rabbitmq.clustering.address_type` | Switch clustering mode | `ip` or `hostname` | +| `rabbitmq.clustering.k8s_domain` | Customize internal k8s cluster domain | `cluster.local` | +| `rabbitmq.ulimitNofiles` | Max File Descriptor limit | `65536` | +| `rabbitmq.configuration` | rabbitmq.conf content | see values.yaml | +| `serviceType` | Kubernetes Service type | `ClusterIP` | +| `persistence.enabled` | Use a PVC to persist data | `false` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `resources` | resource needs and limits to apply to the pod | {} | +| `nodeSelector` | Node labels for pod assignment | {} | +| `affinity` | Affinity settings for pod assignment | {} | +| `tolerations` | Toleration labels for pod assignment | [] | +| `ingress.enabled` | enable ingress for management console | `false` | +| `ingress.tls` | enable ingress with tls | `false` | +| `ingress.tlsSecret` | tls type secret to be used | `myTlsSecret` | +| `ingress.annotations` | ingress annotations as an array | [] | +| `livenessProbe.enabled` | would you like a livenessProbed to be enabled | `true` | +| `livenessProbe.initialDelaySeconds` | number of seconds | 120 | +| `livenessProbe.timeoutSeconds` | number of seconds | 5 | +| `livenessProbe.periodSeconds` | number of seconds | 5 | +| `livenessProbe.failureThreshold` | number of failures | 6 | +| `livenessProbe.successThreshold` | number of successes | 1 | +| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | +| `readinessProbe.initialDelaySeconds` | number of seconds | 10 | +| `readinessProbe.timeoutSeconds` | number of seconds | 3 | +| `readinessProbe.periodSeconds` | number of seconds | 5 | +| `readinessProbe.failureThreshold` | number of failures | 3 | +| `readinessProbe.successThreshold` | number of successes | 1 | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Exporter image registry | `docker.io` | +| `metrics.image.repository` | Exporter image name | `kbudde/rabbitmq-exporter` | +| `metrics.image.tag` | Exporter image tag | `v0.29.0` | +| `metrics.image.pullPolicy` | Exporter image pull policy | `IfNotPresent` | +| `metrics.resources` | Exporter resource requests/limit | `nil` | +| `podLabels` | Additional labels for the statefulset pod(s). | {} | The above parameters map to the env variables defined in [bitnami/rabbitmq](http://github.com/bitnami/bitnami-docker-rabbitmq). For more information please refer to the [bitnami/rabbitmq](http://github.com/bitnami/bitnami-docker-rabbitmq) image documentation. @@ -123,7 +125,9 @@ $ helm install --name my-release -f values.yaml stable/rabbitmq > **Tip**: You can use the default [values.yaml](values.yaml) ## Production configuration + A standard configuration is provided by default that will run on most development environments. To operate this chart in a production environment, we recommend you use the alternative file values-production.yaml provided in this repository. + ```bash $ helm install --name my-release -f values-production.yaml stable/rabbitmq ``` diff --git a/upstreamed/rabbitmq/templates/NOTES.txt b/upstreamed/rabbitmq/templates/NOTES.txt index f7794c752..43e752b6a 100644 --- a/upstreamed/rabbitmq/templates/NOTES.txt +++ b/upstreamed/rabbitmq/templates/NOTES.txt @@ -38,7 +38,7 @@ NOTE: It may take a few minutes for the LoadBalancer IP to be available. To Access the RabbitMQ AMQP port: - echo "URL : amqp://$SERVICE_IP:{{ .Values.rabbitmq.nodePort }}/" + echo "URL : amqp://$SERVICE_IP:{{ .Values.rabbitmq.amqpPort }}/" To Access the RabbitMQ Management interface: @@ -48,8 +48,8 @@ To Access the RabbitMQ Management interface: To Access the RabbitMQ AMQP port: - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "rabbitmq.fullname" . }} {{ .Values.rabbitmq.nodePort }}:{{ .Values.rabbitmq.nodePort }} - echo "URL : amqp://127.0.0.1:{{ .Values.rabbitmq.nodePort }}/" + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "rabbitmq.fullname" . }} {{ .Values.rabbitmq.amqpPort }}:{{ .Values.rabbitmq.amqpPort }} + echo "URL : amqp://127.0.0.1:{{ .Values.rabbitmq.amqpPort }}/" To Access the RabbitMQ Management interface: diff --git a/upstreamed/rabbitmq/templates/_helpers.tpl b/upstreamed/rabbitmq/templates/_helpers.tpl index 9c785ecad..b6e5b889d 100644 --- a/upstreamed/rabbitmq/templates/_helpers.tpl +++ b/upstreamed/rabbitmq/templates/_helpers.tpl @@ -31,6 +31,29 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Return the proper RabbitMQ image name +*/}} +{{- define "rabbitmq.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + {{/* Return the proper metrics image name */}} diff --git a/upstreamed/rabbitmq/templates/statefulset.yaml b/upstreamed/rabbitmq/templates/statefulset.yaml index 3ce2b086f..f7ec51c3b 100644 --- a/upstreamed/rabbitmq/templates/statefulset.yaml +++ b/upstreamed/rabbitmq/templates/statefulset.yaml @@ -20,6 +20,9 @@ spec: app: {{ template "rabbitmq.name" . }} release: "{{ .Release.Name }}" chart: {{ template "rabbitmq.chart" . }} + {{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} + {{- end }} {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} @@ -49,7 +52,7 @@ spec: terminationGracePeriodSeconds: 10 containers: - name: rabbitmq - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "rabbitmq.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} command: - bash @@ -93,7 +96,7 @@ spec: {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: - command: ["sh", "-c", "test \"$(curl -f --user {{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.rabbitmq.managerPort }}/api/healthchecks/node)\" = '{\"status\":\"ok\"}'"] + command: ["sh", "-c", "test \"$(curl -sS -f --user {{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.rabbitmq.managerPort }}/api/healthchecks/node)\" = '{\"status\":\"ok\"}'"] initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} @@ -103,7 +106,7 @@ spec: {{- if .Values.readinessProbe.enabled }} readinessProbe: exec: - command: ["sh", "-c", "test \"$(curl -f --user {{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.rabbitmq.managerPort }}/api/healthchecks/node)\" = '{\"status\":\"ok\"}'"] + command: ["sh", "-c", "test \"$(curl -sS -f --user {{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.rabbitmq.managerPort }}/api/healthchecks/node)\" = '{\"status\":\"ok\"}'"] initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} @@ -184,7 +187,7 @@ spec: path: /metrics port: metrics initialDelaySeconds: 5 - timeoutSeconds: 1 + timeoutSeconds: 5 resources: {{ toYaml .Values.metrics.resources | indent 10 }} {{- end }} diff --git a/upstreamed/rabbitmq/templates/svc-headless.yaml b/upstreamed/rabbitmq/templates/svc-headless.yaml index 888bd2583..c66f3d978 100644 --- a/upstreamed/rabbitmq/templates/svc-headless.yaml +++ b/upstreamed/rabbitmq/templates/svc-headless.yaml @@ -16,9 +16,6 @@ spec: - name: amqp port: {{ .Values.rabbitmq.amqpPort }} targetPort: amqp - {{- if (and (eq .Values.serviceType "NodePort") (not (empty .Values.rabbitmq.nodePort))) }} - nodePort: {{ .Values.rabbitmq.nodePort }} - {{- end }} - name: dist port: {{ .Values.rabbitmq.distPort }} targetPort: dist diff --git a/upstreamed/rabbitmq/values-production.yaml b/upstreamed/rabbitmq/values-production.yaml index d308b32ea..cbe5c0dd1 100644 --- a/upstreamed/rabbitmq/values-production.yaml +++ b/upstreamed/rabbitmq/values-production.yaml @@ -1,21 +1,27 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami RabbitMQ image version ## ref: https://hub.docker.com/r/bitnami/rabbitmq/tags/ ## image: registry: docker.io repository: bitnami/rabbitmq - tag: 3.7.8-debian-9 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: IfNotPresent + tag: 3.7.8 ## set to true if you would like to see extra information on logs ## it turns BASH and NAMI debugging in minideb ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging debug: false + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ @@ -23,8 +29,7 @@ image: # pullSecrets: # - myRegistrKeySecretName - -## does your cluster have rbac enabled? +## does your cluster have rbac enabled? assume yes by default rbacEnabled: true ## section of specific values for rabbitmq @@ -49,6 +54,16 @@ rabbitmq: ## nodePort: 5672 + ## Amqp port + ## ref: https://github.com/bitnami/bitnami-docker-rabbitmq#environment-variables + ## + amqpPort: 5672 + + ## Dist port + ## ref: https://github.com/bitnami/bitnami-docker-rabbitmq#environment-variables + ## + distPort: 25672 + ## Node name to cluster with. e.g.: `clusternode@hostname` ## ref: https://github.com/bitnami/bitnami-docker-rabbitmq#environment-variables ## @@ -73,7 +88,7 @@ rabbitmq: ## Plugins to enable plugins: |- - [rabbitmq_management,rabbitmq_peer_discovery_k8s]. + [rabbitmq_management, rabbitmq_peer_discovery_k8s]. ## Clustering settings clustering: @@ -96,6 +111,9 @@ rabbitmq: ## Kubernetes service type serviceType: ClusterIP +# Additional pod labels to apply +podLabels: {} + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## @@ -105,6 +123,7 @@ securityContext: runAsUser: 1001 persistence: + ## this enables PVC templates that will create one per pod enabled: true ## rabbitmq data Persistent Volume Storage Class @@ -139,6 +158,9 @@ nodeSelector: tolerations: [] affinity: {} +## annotations for rabbitmq pods +podAnnotations: {} + ## Configure the ingress resource that allows you to access the ## Wordpress installation. Set up the URL ## ref: http://kubernetes.io/docs/user-guide/ingress/ @@ -170,7 +192,7 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: true - #The following settings are to configure the frequency of the lifeness and readiness probes +## The following settings are to configure the frequency of the lifeness and readiness probes livenessProbe: enabled: true initialDelaySeconds: 120 diff --git a/upstreamed/rabbitmq/values.yaml b/upstreamed/rabbitmq/values.yaml index 2e37e2a9d..3f60ec6d7 100644 --- a/upstreamed/rabbitmq/values.yaml +++ b/upstreamed/rabbitmq/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami RabbitMQ image version ## ref: https://hub.docker.com/r/bitnami/rabbitmq/tags/ ## image: registry: docker.io repository: bitnami/rabbitmq - tag: 3.7.8-debian-9 + tag: 3.7.8 ## set to true if you would like to see extra information on logs ## it turns BASH and NAMI debugging in minideb @@ -105,6 +111,9 @@ rabbitmq: ## Kubernetes service type serviceType: ClusterIP +# Additional pod labels to apply +podLabels: {} + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## diff --git a/upstreamed/redis/Chart.yaml b/upstreamed/redis/Chart.yaml index e8bb354eb..f11ed45bb 100644 --- a/upstreamed/redis/Chart.yaml +++ b/upstreamed/redis/Chart.yaml @@ -1,5 +1,5 @@ name: redis -version: 4.1.3 +version: 4.2.10 appVersion: 4.0.11 description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. keywords: @@ -13,4 +13,6 @@ sources: maintainers: - name: Bitnami email: containers@bitnami.com +- name: desaintmartin + email: cedric@desaintmartin.fr engine: gotpl diff --git a/upstreamed/redis/OWNERS b/upstreamed/redis/OWNERS index e74df3ff3..0e93555cf 100644 --- a/upstreamed/redis/OWNERS +++ b/upstreamed/redis/OWNERS @@ -1,12 +1,14 @@ approvers: -- prydonius -- tompizmor -- sameersbn - carrodher +- desaintmartin - juan131 -reviewers: - prydonius -- tompizmor - sameersbn +- tompizmor +reviewers: - carrodher -- juan131 \ No newline at end of file +- desaintmartin +- juan131 +- prydonius +- sameersbn +- tompizmor diff --git a/upstreamed/redis/README.md b/upstreamed/redis/README.md index 6470fbfb3..a14da7269 100644 --- a/upstreamed/redis/README.md +++ b/upstreamed/redis/README.md @@ -58,7 +58,7 @@ This version removes the `chart` label from the `spec.selector.matchLabels` which is immutable since `StatefulSet apps/v1beta2`. It has been inadvertently added, causing any subsequent upgrade to fail. See https://github.com/helm/charts/issues/7726. -It also fixes https://github.com/helm/charts/issues/7726 where a deployment `extensions/v1beta1` can not be upgraded if `spec.selector` is not explicitely set. +It also fixes https://github.com/helm/charts/issues/7726 where a deployment `extensions/v1beta1` can not be upgraded if `spec.selector` is not explicitly set. Finally, it fixes https://github.com/helm/charts/issues/7803 by removing mutable labels in `spec.VolumeClaimTemplate.metadata.labels` so that it is upgradable. @@ -76,8 +76,9 @@ kubectl patch deployments my-release-redis-metrics --type=json -p='[{"op": "remo The following table lists the configurable parameters of the Redis chart and their default values. -| Parameter | Description | Default | -|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------| +| Parameter | Description | Default | +|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | Redis Image registry | `docker.io` | | `image.repository` | Redis Image name | `bitnami/redis` | | `image.tag` | Redis Image tag | `{VERSION}` | @@ -104,7 +105,7 @@ The following table lists the configurable parameters of the Redis chart and the | `metrics.extraArgs` | Extra arguments for the binary; possible values [here](https://github.com/oliver006/redis_exporter#flags) | {} | | `metrics.podLabels` | Additional labels for Metrics exporter pod | {} | | `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | {} | -| `metrics.service.type` | Kubernetes Service type (redis metrics) | `LoadBalancer` | +| `metrics.service.type` | Kubernetes Service type (redis metrics) | `ClusterIP` | | `metrics.service.annotations` | Annotations for the services to monitor (redis master and redis slave service) | {} | | `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` | | `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | @@ -149,10 +150,10 @@ The following table lists the configurable parameters of the Redis chart and the | `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` | | `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | | `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | -| `volumePermissions.image.repository` | Init container volume-permissions image name | `alpine` | -| `volumePermissions.image.tag` | Init container volume-permissions image tag | `3.8` | +| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` | +| `volumePermissions.image.tag` | Init container volume-permissions image tag | `latest` | | `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` | -| `slave.serviceType` | Kubernetes Service type (redis slave) | `LoadBalancer` | +| `slave.service.type` | Kubernetes Service type (redis slave) | `ClusterIP` | | `slave.service.nodePort` | Kubernetes Service nodePort (redis slave) | `nil` | | `slave.service.annotations` | annotations for redis slave service | {} | | `slave.service.loadBalancerIP` | LoadBalancerIP if Redis slave service type is `LoadBalancer` | `nil` | diff --git a/upstreamed/redis/templates/_helpers.tpl b/upstreamed/redis/templates/_helpers.tpl index 9efb959e1..0b28c4466 100644 --- a/upstreamed/redis/templates/_helpers.tpl +++ b/upstreamed/redis/templates/_helpers.tpl @@ -43,13 +43,26 @@ Return the appropriate apiVersion for networkpolicy. {{- end -}} {{/* -Return the proper image name +Return the proper Redis image name */}} {{- define "redis.image" -}} -{{- $registryName := .Values.image.registry -}} +{{- $registryName := .Values.image.registry -}} {{- $repositoryName := .Values.image.repository -}} {{- $tag := .Values.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/upstreamed/redis/templates/metrics-svc.yaml b/upstreamed/redis/templates/metrics-svc.yaml index 269f1fc60..a2105152c 100644 --- a/upstreamed/redis/templates/metrics-svc.yaml +++ b/upstreamed/redis/templates/metrics-svc.yaml @@ -8,8 +8,10 @@ metadata: chart: {{ template "redis.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" +{{- if .Values.metrics.service.annotations }} annotations: {{ toYaml .Values.metrics.service.annotations | indent 4 }} +{{- end }} spec: type: {{ .Values.metrics.service.type }} {{ if eq .Values.metrics.service.type "LoadBalancer" -}} {{ if .Values.metrics.service.loadBalancerIP -}} diff --git a/upstreamed/redis/templates/redis-master-statefulset.yaml b/upstreamed/redis/templates/redis-master-statefulset.yaml index eb4526b06..ebe65b69e 100644 --- a/upstreamed/redis/templates/redis-master-statefulset.yaml +++ b/upstreamed/redis/templates/redis-master-statefulset.yaml @@ -13,7 +13,7 @@ spec: release: "{{ .Release.Name }}" role: master app: {{ template "redis.name" . }} - serviceName: "redis-master" + serviceName: {{ template "redis.fullname" . }}-master template: metadata: labels: diff --git a/upstreamed/redis/templates/redis-slave-deployment.yaml b/upstreamed/redis/templates/redis-slave-deployment.yaml index d587f55fc..b5afd1883 100644 --- a/upstreamed/redis/templates/redis-slave-deployment.yaml +++ b/upstreamed/redis/templates/redis-slave-deployment.yaml @@ -9,6 +9,10 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: +{{- if .Values.slave.updateStrategy }} + strategy: +{{ toYaml .Values.slave.updateStrategy | indent 4 }} +{{- end }} {{- if .Values.cluster.slaveCount }} replicas: {{ .Values.cluster.slaveCount }} {{- end }} diff --git a/upstreamed/redis/templates/redis-slave-svc.yaml b/upstreamed/redis/templates/redis-slave-svc.yaml index c2dd4fa34..f2de1b9b8 100644 --- a/upstreamed/redis/templates/redis-slave-svc.yaml +++ b/upstreamed/redis/templates/redis-slave-svc.yaml @@ -8,8 +8,8 @@ metadata: chart: {{ template "redis.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - annotations: {{- if .Values.slave.service.annotations }} + annotations: {{ toYaml .Values.slave.service.annotations | indent 4 }} {{- end }} spec: diff --git a/upstreamed/redis/values-production.yaml b/upstreamed/redis/values-production.yaml index abda34409..94d56e4f7 100644 --- a/upstreamed/redis/values-production.yaml +++ b/upstreamed/redis/values-production.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Redis image version ## ref: https://hub.docker.com/r/bitnami/redis/tags/ ## @@ -7,7 +13,7 @@ image: ## Bitnami Redis image tag ## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links ## - tag: 4.0.11-debian-9 + tag: 4.0.11 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -73,6 +79,13 @@ password: ## Use existing secret (ignores previous password) # existingSecret: +## Persist data to a persistent volume +persistence: {} + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + ## ## Redis Master parameters ## @@ -113,6 +126,10 @@ master: # requests: # memory: 256Mi # cpu: 100m + ## Use an alternate scheduler, e.g. "stork". + ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ + ## + # schedulerName: ## Configure extra options for Redis Master liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) @@ -146,6 +163,7 @@ master: service: ## Redis Master Service type type: ClusterIP + port: 6379 ## Specify the nodePort value for the LoadBalancer and NodePort service types. ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport @@ -170,14 +188,12 @@ master: ## persistence: enabled: true - ## The path the volume will be mounted at, useful when using different ## Redis images. path: /bitnami/redis/data - - ## The subdirectory of the volume to mount to, useful in dev environments and one PV for multiple services. + ## The subdirectory of the volume to mount to, useful in dev environments + ## and one PV for multiple services. subPath: "" - ## redis data Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning @@ -198,10 +214,11 @@ master: ## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions # rollingUpdatePartition: + ## ## Redis Slave properties -## Note: serviceType and service are mandatory parameters -## The rest of the parameters, if undefined, will inherit those declared in Redis Master +## Note: service.type is a mandatory parameter +## The rest of the parameters are either optional or, if undefined, will inherit those declared in Redis Master ## slave: ## Slave Service properties @@ -220,8 +237,6 @@ slave: annotations: {} loadBalancerIP: - ## Redis slave optional overrides - ## Redis port # port: 6379 ## Redis command arguments @@ -263,6 +278,11 @@ slave: # nodeSelector: {"beta.kubernetes.io/arch": "amd64"} # tolerations: [] + ## Use an alternate scheduler, e.g. "stork". + ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ + ## + # schedulerName: + ## Redis slave pod Annotation and Labels # podLabels: {} # podAnnotations: {} @@ -295,9 +315,9 @@ metrics: ## Use serviceLoadBalancerIP to request a specific static IP, ## otherwise leave blank # loadBalancerIP: - annotations: {} - # prometheus.io/scrape: "true" - # prometheus.io/port: "9121" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9121" ## Metrics exporter resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ @@ -321,11 +341,10 @@ metrics: ## Init containers parameters: ## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup ## - volumePermissions: image: registry: docker.io - repository: busybox + repository: bitnami/minideb tag: latest pullPolicy: IfNotPresent diff --git a/upstreamed/redis/values.yaml b/upstreamed/redis/values.yaml index e2958451c..0ceb1f17a 100644 --- a/upstreamed/redis/values.yaml +++ b/upstreamed/redis/values.yaml @@ -1,3 +1,9 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Redis image version ## ref: https://hub.docker.com/r/bitnami/redis/tags/ ## @@ -7,7 +13,7 @@ image: ## Bitnami Redis image tag ## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links ## - tag: 4.0.11-debian-9 + tag: 4.0.11 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -41,8 +47,8 @@ serviceAccount: ## Specifies whether a ServiceAccount should be created ## create: false - # The name of the ServiceAccount to use. - # If not set and create is true, a name is generated using the fullname template + ## The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the fullname template name: rbac: @@ -172,7 +178,6 @@ master: loadBalancerIP: ## Redis Master Pod Security Context - ## securityContext: enabled: true fsGroup: 1001 @@ -212,13 +217,13 @@ master: ## ## Redis Slave properties -## Note: serviceType and service are mandatory parameters -## The rest of the parameters, if undefined, will inherit those declared in Redis Master +## Note: service.type is a mandatory parameter +## The rest of the parameters are either optional or, if undefined, will inherit those declared in Redis Master ## slave: ## Slave Service properties service: - ## Redis Slave Service type + ## Redis Slave Service type type: ClusterIP ## Specify the nodePort value for the LoadBalancer and NodePort service types. ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport @@ -240,6 +245,10 @@ slave: # extraFlags: [] ## Comma-separated list of Redis commands to disable # disableCommands: "" + ## deployment update stategy + # updateStrategy: + # rollingUpdate: + # maxUnavailable: 0 ## Redis Slave pod/node affinity/anti-affinity ## @@ -310,9 +319,9 @@ metrics: ## Use serviceLoadBalancerIP to request a specific static IP, ## otherwise leave blank # loadBalancerIP: - annotations: {} - # prometheus.io/scrape: "true" - # prometheus.io/port: "9121" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9121" ## Metrics exporter resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ @@ -336,11 +345,10 @@ metrics: ## Init containers parameters: ## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup ## - volumePermissions: image: registry: docker.io - repository: busybox + repository: bitnami/minideb tag: latest pullPolicy: IfNotPresent diff --git a/upstreamed/redmine/.helmignore b/upstreamed/redmine/.helmignore index 6b8710a71..acbcabf42 100644 --- a/upstreamed/redmine/.helmignore +++ b/upstreamed/redmine/.helmignore @@ -1 +1,2 @@ .git +OWNERS diff --git a/upstreamed/redmine/Chart.yaml b/upstreamed/redmine/Chart.yaml index 5cfd55579..c16428609 100644 --- a/upstreamed/redmine/Chart.yaml +++ b/upstreamed/redmine/Chart.yaml @@ -1,5 +1,5 @@ name: redmine -version: 5.0.2 +version: 6.0.2 appVersion: 3.4.6 description: A flexible project management web application. keywords: diff --git a/upstreamed/redmine/README.md b/upstreamed/redmine/README.md index 9d75fb8e9..30a7efc5a 100644 --- a/upstreamed/redmine/README.md +++ b/upstreamed/redmine/README.md @@ -55,45 +55,50 @@ helm install --name my-release stable/redmine --set databaseType.mariadb=false,d The following table lists the configurable parameters of the Redmine chart and their default values. -| Parameter | Description | Default | -| --------------------------------- | ---------------------------------------- | ------------------------------------------------------- | -| `image.registry` | Redmine image registry | `docker.io` | -| `image.repository` | Redmine image name | `bitnami/redmine` | -| `image.tag` | Redmine image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | -| `image.pullSecrets` | Specify image pull secrets | `nil` | -| `redmineUsername` | User of the application | `user` | -| `redminePassword` | Application password | _random 10 character long alphanumeric string_ | -| `redmineEmail` | Admin email | `user@example.com` | -| `redmineLanguage` | Redmine default data language | `en` | -| `extraVars` | Environment variables, passed to redmine | `nil` | -| `smtpHost` | SMTP host | `nil` | -| `smtpPort` | SMTP port | `nil` | -| `smtpUser` | SMTP user | `nil` | -| `smtpPassword` | SMTP password | `nil` | -| `smtpTls` | Use TLS encryption with SMTP | `nil` | -| `databaseType.postgresql` | Select postgresql database | `false` | -| `databaseType.mariadb` | Select mariadb database | `true` | -| `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `postgresql.postgresqlPassword` | PostgreSQL admin password | `nil` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `serviceLoadBalancerSourceRanges` | An array of load balancer sources | `0.0.0.0/0` | -| `ingress.enabled` | Enable or disable the ingress | `false` | -| `ingress.hostname` | The virtual host name | `redmine.cluster.local` | -| `ingress.annotations` | An array of service annotations | `nil` | -| `ingress.tls[i].secretName` | The secret kubernetes.io/tls | `nil` | -| `ingress.tls[i].hosts[j]` | The virtual host name | `nil` | -| `networkPolicyApiVersion` | The kubernetes network API version | `extensions/v1beta1` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.existingClaim` | The name of an existing PVC | `nil` | -| `persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request | `8Gi` | -| `podDisruptionBudget.enabled` | Pod Disruption Budget toggle | `false` | -| `podDisruptionBudget.minAvailable`| Minimum available pods | `nil` | -| `podDisruptionBudget.maxUnavailable`| Maximum unavailable pods | `nil` | -| `replicas` | The number of pod replicas (See [Replicas](#replicas)) | `1` | -| `resources` | Resources allocation (Requests and Limits) | `{}` | +| Parameter | Description | Default | +| ----------------------------------- | ------------------------------------------ | ------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registr y | `nil` | +| `image.registry` | Redmine image registry | `docker.io` | +| `image.repository` | Redmine image name | `bitnami/redmine` | +| `image.tag` | Redmine image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `image.pullSecrets` | Specify image pull secrets | `nil` | +| `redmineUsername` | User of the application | `user` | +| `redminePassword` | Application password | _random 10 character long alphanumeric string_ | +| `redmineEmail` | Admin email | `user@example.com` | +| `redmineLanguage` | Redmine default data language | `en` | +| `extraVars` | Environment variables, passed to redmine | `nil` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `smtpTls` | Use TLS encryption with SMTP | `nil` | +| `databaseType.postgresql` | Select postgresql database | `false` | +| `databaseType.mariadb` | Select mariadb database | `true` | +| `mariadb.rootUser.password` | MariaDB admin password | `nil` | +| `postgresql.postgresqlPassword` | PostgreSQL admin password | `nil` | +| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `serviceLoadBalancerSourceRanges` | An array of load balancer sources | `0.0.0.0/0` | +| `ingress.enabled` | Enable or disable the ingress | `false` | +| `ingress.hosts[0].name` | Hostname to your Redmine installation | `redmine.local ` | +| `ingress.hosts[0].path` | Path within the url structure | `/` | +| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ingress.hosts[0].certManager` | Add annotations for cert-manager | `false` | +| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `redmine.local-tls-secret` | +| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.existingClaim` | The name of an existing PVC | `nil` | +| `persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request | `8Gi` | +| `podDisruptionBudget.enabled` | Pod Disruption Budget toggle | `false` | +| `podDisruptionBudget.minAvailable` | Minimum available pods | `nil` | +| `podDisruptionBudget.maxUnavailable`| Maximum unavailable pods | `nil` | +| `replicas` | The number of pod replicas | `1` | +| `resources` | Resources allocation (Requests and Limits) | `{}` | The above parameters map to the env variables defined in [bitnami/redmine](http://github.com/bitnami/bitnami-docker-redmine). For more information please refer to the [bitnami/redmine](http://github.com/bitnami/bitnami-docker-redmine) image documentation. diff --git a/upstreamed/redmine/requirements.lock b/upstreamed/redmine/requirements.lock index 143e9783b..6b8afb646 100644 --- a/upstreamed/redmine/requirements.lock +++ b/upstreamed/redmine/requirements.lock @@ -1,9 +1,9 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.1 - name: postgresql repository: https://kubernetes-charts.storage.googleapis.com/ - version: 0.18.1 -digest: sha256:bd7da903db69d89a8de155f6259a2ef20de455280360674b2955bb6515c13eee -generated: 2018-09-25T11:26:31.244834331+02:00 + version: 2.1.0 +digest: sha256:0634de3cb0459ae2959df51ccac306fff4ae4618410bf6fae996ab085dbad62f +generated: 2018-10-24T11:56:52.143391+02:00 diff --git a/upstreamed/redmine/requirements.yaml b/upstreamed/redmine/requirements.yaml index df2235b73..23f977360 100644 --- a/upstreamed/redmine/requirements.yaml +++ b/upstreamed/redmine/requirements.yaml @@ -4,6 +4,6 @@ dependencies: repository: https://kubernetes-charts.storage.googleapis.com/ condition: databaseType.mariadb - name: postgresql - version: 0.x.x + version: 2.x.x repository: https://kubernetes-charts.storage.googleapis.com/ condition: databaseType.postgresql diff --git a/upstreamed/redmine/templates/NOTES.txt b/upstreamed/redmine/templates/NOTES.txt index 1fd91d57f..ae5f30ebf 100644 --- a/upstreamed/redmine/templates/NOTES.txt +++ b/upstreamed/redmine/templates/NOTES.txt @@ -17,7 +17,9 @@ {{- else if .Values.ingress.enabled }} - echo "Redmine URL: http://{{ .Values.ingress.hostname }}/" + {{- range .Values.ingress.hosts }} + echo "Redmine URL: http://{{ .name }}/" + {{- end }} {{- else if contains "ClusterIP" .Values.serviceType }} diff --git a/upstreamed/redmine/templates/_helpers.tpl b/upstreamed/redmine/templates/_helpers.tpl index 55d4531f3..2139bc563 100644 --- a/upstreamed/redmine/templates/_helpers.tpl +++ b/upstreamed/redmine/templates/_helpers.tpl @@ -30,3 +30,34 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "redmine.postgresql.fullname" -}} {{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Redmine image name +*/}} +{{- define "redmine.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "redmine.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/upstreamed/redmine/templates/deployment.yaml b/upstreamed/redmine/templates/deployment.yaml index e8ac5171a..4579fbfb4 100644 --- a/upstreamed/redmine/templates/deployment.yaml +++ b/upstreamed/redmine/templates/deployment.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "redmine.fullname" . }} labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: @@ -17,7 +17,7 @@ spec: metadata: labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" spec: {{- if .Values.image.pullSecrets }} @@ -28,7 +28,7 @@ spec: {{- end }} containers: - name: {{ template "redmine.fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "redmine.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} resources: {{ toYaml .Values.resources | indent 10 }} @@ -43,7 +43,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redmine.postgresql.fullname" . }} - key: postgres-password + key: postgresql-password {{- else }} - name: REDMINE_DB_MYSQL value: {{ template "redmine.mariadb.fullname" . }} diff --git a/upstreamed/redmine/templates/ingress.yaml b/upstreamed/redmine/templates/ingress.yaml index 8b9a2962f..fd5ddd69f 100644 --- a/upstreamed/redmine/templates/ingress.yaml +++ b/upstreamed/redmine/templates/ingress.yaml @@ -1,23 +1,36 @@ {{- if .Values.ingress.enabled }} -apiVersion: {{ required "A valid .Values.networkPolicyApiVersion entry required!" .Values.networkPolicyApiVersion }} +{{- range .Values.ingress.hosts }} +apiVersion: extensions/v1beta1 kind: Ingress metadata: -{{- if .Values.ingress.annotations }} + name: "{{- printf "%s-%s" .name $.Release.Name | trunc 63 | trimSuffix "-" -}}" + labels: + app: {{ template "redmine.fullname" $ }} + chart: {{ template "redmine.chart" $ }} + release: "{{ $.Release.Name }}" + heritage: "{{ $.Release.Service }}" annotations: -{{ toYaml .Values.ingress.annotations | indent 4 }} -{{- end }} - name: {{ template "redmine.fullname" . }} + {{- if .certManager }} + kubernetes.io/tls-acme: "true" + {{- end }} + {{- range $key, $value := .annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: rules: - - host: {{ .Values.ingress.hostname | quote }} + - host: {{ .name }} http: paths: - - path: / + - path: {{ default "/" .path }} backend: - serviceName: {{ template "redmine.fullname" . }} + serviceName: {{ template "redmine.fullname" $ }} servicePort: 80 -{{- if .Values.ingress.tls }} +{{- if .tls }} tls: -{{ toYaml .Values.ingress.tls | indent 4 }} -{{- end -}} + - secretName: {{ .tlsSecret }} + hosts: + - {{ .name }} +{{- end }} +--- +{{- end }} {{- end }} diff --git a/upstreamed/redmine/templates/pdb.yaml b/upstreamed/redmine/templates/pdb.yaml index f545eb493..2dfea68e4 100644 --- a/upstreamed/redmine/templates/pdb.yaml +++ b/upstreamed/redmine/templates/pdb.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "redmine.fullname" . }} labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: diff --git a/upstreamed/redmine/templates/pvc.yaml b/upstreamed/redmine/templates/pvc.yaml index 3fda4c2ec..2dd5cf083 100644 --- a/upstreamed/redmine/templates/pvc.yaml +++ b/upstreamed/redmine/templates/pvc.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "redmine.fullname" . }} labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: diff --git a/upstreamed/redmine/templates/secrets.yaml b/upstreamed/redmine/templates/secrets.yaml index d2513b650..4624c9df8 100644 --- a/upstreamed/redmine/templates/secrets.yaml +++ b/upstreamed/redmine/templates/secrets.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "redmine.fullname" . }} labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque diff --git a/upstreamed/redmine/templates/svc.yaml b/upstreamed/redmine/templates/svc.yaml index 2725587ba..72cb9f298 100644 --- a/upstreamed/redmine/templates/svc.yaml +++ b/upstreamed/redmine/templates/svc.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "redmine.fullname" . }} labels: app: {{ template "redmine.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "redmine.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: diff --git a/upstreamed/redmine/values.yaml b/upstreamed/redmine/values.yaml index 8f31ed7b5..a4049c52a 100644 --- a/upstreamed/redmine/values.yaml +++ b/upstreamed/redmine/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami Redmine image version ## ref: https://hub.docker.com/r/bitnami/redmine/tags/ ## image: registry: docker.io repository: bitnami/redmine - tag: 3.4.6-debian-9 + tag: 3.4.6 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -63,6 +69,8 @@ databaseType: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -106,6 +114,8 @@ mariadb: ## ## PostgreSQL chart configuration ## +## https://github.com/helm/charts/blob/master/stable/postgresql/values.yaml +## postgresql: ## PostgreSQL admin password ## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#setting-the-root-password-on-first-run @@ -143,20 +153,36 @@ serviceType: LoadBalancer serviceLoadBalancerSourceRanges: - 0.0.0.0/0 +## Configure the ingress resource that allows you to access the +## Redmine installation. Set up the URL +## ref: http://kubernetes.io/docs/user-guide/ingress/ +## ingress: + ## Set to true to enable ingress record generation enabled: false - hostname: redmine.cluser.local - annotations: - # kubernetes.io/ingress.class: nginx - # ingress.kubernetes.io/whitelist-source-range: "10.0.0.0/24,172.10.0.1" - tls: - # - secretName: redmine.cluster.local - # hosts: - # - redmine.cluster.local -## For Kubernetes v1.4, v1.5 and v1.6, use 'extensions/v1beta1' -## For Kubernetes v1.7, use 'networking.k8s.io/v1' -networkPolicyApiVersion: extensions/v1beta1 + ## The list of hostnames to be covered with this ingress record. + ## Most likely this will be just one host, but in the event more hosts are needed, this is an array + hosts: + - name: redmine.local + + ## Set this to true in order to enable TLS on the ingress record + ## A side effect of this will be that the backend wordpress service will be connected at port 443 + tls: false + + ## Set this to true in order to add the corresponding annotations for cert-manager + certManager: false + + ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS + tlsSecret: redmine.local-tls + + ## Ingress annotations done as key:value pairs + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/annotations.md + ## + ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + annotations: + # kubernetes.io/ingress.class: nginx ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ diff --git a/upstreamed/suitecrm/Chart.yaml b/upstreamed/suitecrm/Chart.yaml index f3c9e131b..955e6c3fc 100644 --- a/upstreamed/suitecrm/Chart.yaml +++ b/upstreamed/suitecrm/Chart.yaml @@ -1,6 +1,6 @@ name: suitecrm -version: 3.1.2 -appVersion: 7.10.9 +version: 4.1.0 +appVersion: 7.10.10 description: SuiteCRM is a completely open source enterprise-grade Customer Relationship Management (CRM) application. SuiteCRM is a software fork of the popular customer relationship management (CRM) system SugarCRM. keywords: - suitecrm diff --git a/upstreamed/suitecrm/README.md b/upstreamed/suitecrm/README.md index 7123777c2..b32bd5ddf 100644 --- a/upstreamed/suitecrm/README.md +++ b/upstreamed/suitecrm/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the SuiteCRM chart and | Parameter | Description | Default | |-------------------------------------|-------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | SuiteCRM image registry | `docker.io` | | `image.repository` | SuiteCRM image name | `bitnami/suitecrm` | | `image.tag` | SuiteCRM image tag | `{VERSION}` | @@ -79,15 +80,21 @@ The following table lists the configurable parameters of the SuiteCRM chart and | `mariadb.rootUser.password` | MariaDB admin password | `nil` | | `serviceType` | Kubernetes Service type | `LoadBalancer` | | `externalTrafficPolicy` | Set to `Local` to preserve the client source IP | `Cluster` | -| `sessionAffinity` | Configures the session affinity | `ClientIP` | | `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.apache.storageClass` | PVC Storage Class for apache volume | `nil` (uses alpha storage class annotation) | -| `persistence.apache.accessMode` | PVC Access Mode for apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for apache volume | `1Gi` | -| `persistence.suitecrm.storageClass` | PVC Storage Class for SuiteCRM volume | `nil` (uses alpha storage class annotation) | -| `persistence.suitecrm.accessMode` | PVC Access Mode for SuiteCRM volume | `ReadWriteOnce` | -| `persistence.suitecrm.size` | PVC Storage Request for SuiteCRM volume | `8Gi` | +| `persistence.storageClass` | PVC Storage Class for SuiteCRM volume | `nil` (uses alpha storage class annotation) | +| `persistence.existingClaim` | An Existing PVC name for SuiteCRM volume | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | PVC Access Mode for SuiteCRM volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for SuiteCRM volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/suitecrm](http://github.com/bitnami/bitnami-docker-suitecrm). For more information please refer to the [bitnami/suitecrm](http://github.com/bitnami/bitnami-docker-suitecrm) image documentation. diff --git a/upstreamed/suitecrm/requirements.lock b/upstreamed/suitecrm/requirements.lock index d79e27764..27720bedc 100644 --- a/upstreamed/suitecrm/requirements.lock +++ b/upstreamed/suitecrm/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.2 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:57:28.148036179+02:00 +generated: 2018-10-30T04:38:18.642026163Z diff --git a/upstreamed/suitecrm/templates/NOTES.txt b/upstreamed/suitecrm/templates/NOTES.txt index 99fd56c09..10457248f 100644 --- a/upstreamed/suitecrm/templates/NOTES.txt +++ b/upstreamed/suitecrm/templates/NOTES.txt @@ -12,27 +12,29 @@ host. To configure SuiteCRM with the URL of your service: {{- if contains "NodePort" .Values.serviceType }} - export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") + export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "suitecrm.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") {{- else if contains "LoadBalancer" .Values.serviceType }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "suitecrm.fullname" . }}' - export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) + export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "suitecrm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "suitecrm.fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) {{- if .Values.mariadb.mariadbRootPassword }} - export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) + export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "suitecrm.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} {{- end }} + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "suitecrm.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-password}" | base64 --decode) + 2. Complete your SuiteCRM deployment by running: {{- if .Values.mariadb.enabled }} helm upgrade {{ .Release.Name }} stable/suitecrm \ - --set suitecrmHost=$APP_HOST,suitecrmPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} + --set suitecrmHost=$APP_HOST,suitecrmPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$DATABASE_ROOT_PASSWORD{{ end }},mariadb.db.password=$APP_DATABASE_PASSWORD {{- else }} ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## @@ -47,7 +49,7 @@ host. To configure SuiteCRM with the URL of your service: {{- if eq .Values.serviceType "ClusterIP" }} echo "SuiteCRM URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} $POD_NAME 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "suitecrm.fullname" . }} $POD_NAME 8080:80 {{- else }} @@ -58,7 +60,7 @@ host. To configure SuiteCRM with the URL of your service: 2. Get your SuiteCRM login credentials by running: echo Username : {{ .Values.suitecrmUsername }} - echo Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) + echo Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "suitecrm.fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) {{- end }} {{- else -}} diff --git a/upstreamed/suitecrm/templates/_helpers.tpl b/upstreamed/suitecrm/templates/_helpers.tpl index fbeb1a6ca..b3b4e56c4 100644 --- a/upstreamed/suitecrm/templates/_helpers.tpl +++ b/upstreamed/suitecrm/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "suitecrm.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -10,7 +10,7 @@ Expand the name of the chart. Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "fullname" -}} +{{- define "suitecrm.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -43,3 +43,36 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} {{- default (include "serviceIP" .) $host -}} {{- end -}} + +{{/* +Return the proper SuiteCRM image name +*/}} +{{- define "suitecrm.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/suitecrm/templates/apache-pvc.yaml b/upstreamed/suitecrm/templates/apache-pvc.yaml deleted file mode 100644 index 488212ba9..000000000 --- a/upstreamed/suitecrm/templates/apache-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.persistence.enabled -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "fullname" . }}-apache - labels: - app: {{ template "name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - accessModes: - - {{ .Values.persistence.apache.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.apache.size | quote }} -{{- if .Values.persistence.apache.storageClass }} -{{- if (eq "-" .Values.persistence.apache.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.apache.storageClass }}" -{{- end }} -{{- end }} -{{- end -}} diff --git a/upstreamed/suitecrm/templates/deployment.yaml b/upstreamed/suitecrm/templates/deployment.yaml index a7b5d61a9..0dd991547 100644 --- a/upstreamed/suitecrm/templates/deployment.yaml +++ b/upstreamed/suitecrm/templates/deployment.yaml @@ -2,23 +2,32 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }} + name: {{ template "suitecrm.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: selector: matchLabels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} release: "{{ .Release.Name }}" template: metadata: labels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} release: "{{ .Release.Name }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + - name: {{ template "suitecrm.fullname" . }} + image: {{ template "suitecrm.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -71,7 +84,7 @@ spec: - name: SUITECRM_PASSWORD valueFrom: secretKeyRef: - name: {{ template "fullname" . }} + name: {{ template "suitecrm.fullname" . }} key: suitecrm-password - name: SUITECRM_EMAIL value: {{ .Values.suitecrmEmail | quote }} @@ -86,7 +99,7 @@ spec: - name: SUITECRM_SMTP_PASSWORD valueFrom: secretKeyRef: - name: {{ template "fullname" . }} + name: {{ template "suitecrm.fullname" . }} key: suitecrm-smtp-password - name: SUITECRM_SMTP_PROTOCOL value: {{ .Values.suitecrmSmtpProtocol | quote }} @@ -116,20 +129,38 @@ spec: volumeMounts: - name: suitecrm-data mountPath: /bitnami/suitecrm - - name: apache-data + subPath: suitecrm + - name: suitecrm-data mountPath: /bitnami/apache + subPath: apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: +{{ toYaml .Values.metrics.resources | indent 12 }} +{{- end }} volumes: - name: suitecrm-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }}-suitecrm - {{- else }} - emptyDir: {} - {{- end }} - - name: apache-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "fullname" . }}-apache + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "suitecrm.fullname" . }}-suitecrm{{- end }} {{- else }} emptyDir: {} {{- end }} diff --git a/upstreamed/suitecrm/templates/secrets.yaml b/upstreamed/suitecrm/templates/secrets.yaml index 28be00b52..58cbfb899 100644 --- a/upstreamed/suitecrm/templates/secrets.yaml +++ b/upstreamed/suitecrm/templates/secrets.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "fullname" . }} + name: {{ template "suitecrm.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/upstreamed/suitecrm/templates/suitecrm-pvc.yaml b/upstreamed/suitecrm/templates/suitecrm-pvc.yaml index d8a9cd7a9..18a7ac50e 100644 --- a/upstreamed/suitecrm/templates/suitecrm-pvc.yaml +++ b/upstreamed/suitecrm/templates/suitecrm-pvc.yaml @@ -2,23 +2,23 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "fullname" . }}-suitecrm + name: {{ template "suitecrm.fullname" . }}-suitecrm labels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: accessModes: - - {{ .Values.persistence.suitecrm.accessMode | quote }} + - {{ .Values.persistence.accessMode | quote }} resources: requests: - storage: {{ .Values.persistence.suitecrm.size | quote }} -{{- if .Values.persistence.suitecrm.storageClass }} -{{- if (eq "-" .Values.persistence.suitecrm.storageClass) }} + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistence.suitecrm.storageClass }}" + storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} {{- end }} {{- end -}} diff --git a/upstreamed/suitecrm/templates/svc.yaml b/upstreamed/suitecrm/templates/svc.yaml index e76116bd8..582dd67fe 100644 --- a/upstreamed/suitecrm/templates/svc.yaml +++ b/upstreamed/suitecrm/templates/svc.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "suitecrm.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -15,7 +15,6 @@ spec: {{- if (or (eq .Values.serviceType "LoadBalancer") (eq .Values.serviceType "NodePort")) }} externalTrafficPolicy: {{ .Values.externalTrafficPolicy | quote }} {{- end }} - sessionAffinity: {{ .Values.sessionAffinity | quote }} ports: - name: http port: 80 @@ -24,6 +23,6 @@ spec: port: 443 targetPort: https selector: - app: {{ template "name" . }} + app: {{ template "suitecrm.name" . }} release: "{{ .Release.Name }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/upstreamed/suitecrm/values.yaml b/upstreamed/suitecrm/values.yaml index b5f14d1d5..f21a2b8ca 100644 --- a/upstreamed/suitecrm/values.yaml +++ b/upstreamed/suitecrm/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami SuiteCRM image version ## ref: https://hub.docker.com/r/bitnami/suitecrm/tags/ ## image: registry: docker.io repository: bitnami/suitecrm - tag: 7.10.9-debian-9 + tag: 7.10.10 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -89,6 +95,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -138,38 +146,27 @@ serviceType: LoadBalancer ## ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport externalTrafficPolicy: Cluster -## Control where client requests go, to the same pod or round-robin -## Values: ClientIP or None -## ref: https://kubernetes.io/docs/user-guide/services/ -sessionAffinity: "ClientIP" - ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## persistence: enabled: true - apache: - ## apache data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 1Gi - suitecrm: - ## suitecrm data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi + ## suitecrm data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + accessMode: ReadWriteOnce + size: 8Gi ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ @@ -178,3 +175,31 @@ resources: {} # requests: # memory: 512Mi # cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/testlink/Chart.yaml b/upstreamed/testlink/Chart.yaml index 65dda538b..f5d553450 100644 --- a/upstreamed/testlink/Chart.yaml +++ b/upstreamed/testlink/Chart.yaml @@ -1,6 +1,6 @@ name: testlink -version: 3.0.3 -appVersion: 1.9.17 +version: 3.2.0 +appVersion: 1.9.18 description: Web-based test management system that facilitates software quality assurance. icon: https://bitnami.com/assets/stacks/testlink/img/testlink-stack-220x234.png keywords: diff --git a/upstreamed/testlink/README.md b/upstreamed/testlink/README.md index e2de7bb08..96a153337 100644 --- a/upstreamed/testlink/README.md +++ b/upstreamed/testlink/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the TestLink chart and | Parameter | Description | Default | |-------------------------------------|-----------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | TestLink image registry | `docker.io` | | `image.repository` | TestLink image name | `bitnami/testlink` | | `image.tag` | TestLink image tag | `{VERSION}` | @@ -83,6 +84,15 @@ The following table lists the configurable parameters of the TestLink chart and | `persistence.testlink.accessMode` | PVC Access Mode for TestLink volume | `ReadWriteOnce` | | `persistence.testlink.size` | PVC Storage Request for TestLink volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/testlink](http://github.com/bitnami/bitnami-docker-testlink). For more information please refer to the [bitnami/testlink](http://github.com/bitnami/bitnami-docker-testlink) image documentation. diff --git a/upstreamed/testlink/requirements.lock b/upstreamed/testlink/requirements.lock index 3ef50c173..372f51d02 100644 --- a/upstreamed/testlink/requirements.lock +++ b/upstreamed/testlink/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.2 digest: sha256:0593b73b2163fbbbae061de1aa2b8280d43f8a423a91e1c7375c0b6c86784b1c -generated: 2018-09-25T11:58:55.304406377+02:00 +generated: 2018-10-29T13:32:38.278217012Z diff --git a/upstreamed/testlink/templates/_helpers.tpl b/upstreamed/testlink/templates/_helpers.tpl index 078f1bf70..66ae49b00 100644 --- a/upstreamed/testlink/templates/_helpers.tpl +++ b/upstreamed/testlink/templates/_helpers.tpl @@ -21,4 +21,37 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this */}} {{- define "testlink.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the proper Testlink image name +*/}} +{{- define "testlink.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/testlink/templates/deployment.yaml b/upstreamed/testlink/templates/deployment.yaml index d8646ec6d..234cb3dcc 100644 --- a/upstreamed/testlink/templates/deployment.yaml +++ b/upstreamed/testlink/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -30,9 +39,13 @@ spec: nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "testlink.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -114,6 +127,29 @@ spec: mountPath: /bitnami/testlink - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: testlink-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/testlink/values.yaml b/upstreamed/testlink/values.yaml index 350ea4001..3782df9ab 100644 --- a/upstreamed/testlink/values.yaml +++ b/upstreamed/testlink/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami TestLink image version ## ref: https://hub.docker.com/r/bitnami/testlink/tags/ ## image: registry: docker.io repository: bitnami/testlink - tag: 1.9.17-debian-9 + tag: 1.9.18 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -82,6 +88,8 @@ smtpConnectionMode: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -162,3 +170,31 @@ resources: requests: memory: 512Mi cpu: 300m + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/wordpress/Chart.yaml b/upstreamed/wordpress/Chart.yaml index 5b7d156ea..6269db98e 100644 --- a/upstreamed/wordpress/Chart.yaml +++ b/upstreamed/wordpress/Chart.yaml @@ -1,5 +1,5 @@ name: wordpress -version: 3.1.1 +version: 4.0.0 appVersion: 4.9.8 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/upstreamed/wordpress/README.md b/upstreamed/wordpress/README.md index c7f1a24e6..8f491cb5e 100644 --- a/upstreamed/wordpress/README.md +++ b/upstreamed/wordpress/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the WordPress chart and | Parameter | Description | Default | |----------------------------------|--------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | | `image.registry` | WordPress image registry | `docker.io` | | `image.repository` | WordPress image name | `bitnami/wordpress` | | `image.tag` | WordPress image tag | `{VERSION}` | @@ -79,10 +80,12 @@ The following table lists the configurable parameters of the WordPress chart and | `externalDatabase.password` | Password for the above username | `nil` | | `externalDatabase.database` | Name of the existing database | `bitnami_wordpress` | | `externalDatabase.port` | Database port number | `3306` | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `serviceExternalTrafficPolicy` | Enable client source IP preservation | `Cluster` | -| `nodePorts.http` | Kubernetes http node port | `""` | -| `nodePorts.https` | Kubernetes https node port | `""` | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | | `healthcheckHttps` | Use https for liveliness and readiness | `false` | | `ingress.enabled` | Enable ingress controller resource | `false` | | `ingress.hosts[0].name` | Hostname to your WordPress installation | `wordpress.local` | @@ -102,6 +105,15 @@ The following table lists the configurable parameters of the WordPress chart and | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | List of node taints to tolerate | `[]` | | `affinity` | Map of node/pod affinities | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/wordpress](http://github.com/bitnami/bitnami-docker-wordpress). For more information please refer to the [bitnami/wordpress](http://github.com/bitnami/bitnami-docker-wordpress) image documentation. diff --git a/upstreamed/wordpress/requirements.lock b/upstreamed/wordpress/requirements.lock index 28c3b284d..6621b2d70 100644 --- a/upstreamed/wordpress/requirements.lock +++ b/upstreamed/wordpress/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 5.0.4 + version: 5.2.0 digest: sha256:5c711356a05ffeaffafba333092229eadc8ba3cc377b56861988517ac77b7609 -generated: 2018-09-25T12:00:13.171071112+02:00 +generated: 2018-10-16T08:51:10.026782+02:00 diff --git a/upstreamed/wordpress/templates/NOTES.txt b/upstreamed/wordpress/templates/NOTES.txt index 9f520118b..31937e0a5 100644 --- a/upstreamed/wordpress/templates/NOTES.txt +++ b/upstreamed/wordpress/templates/NOTES.txt @@ -8,22 +8,23 @@ {{ if .tls }}https{{ else }}http{{ end }}://{{ .name }}/admin {{- end }} -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' +{{- $port:=.Values.service.port | toString }} export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "WordPress URL: http://$SERVICE_IP/" - echo "WordPress Admin URL: http://$SERVICE_IP/admin" + echo "WordPress URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" + echo "WordPress Admin URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/admin" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- else if contains "ClusterIP" .Values.service.type }} echo "WordPress URL: http://127.0.0.1:8080/" echo "WordPress Admin URL: http://127.0.0.1:8080/admin" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fullname" . }} 8080:{{ .Values.service.port }} -{{- else if contains "NodePort" .Values.serviceType }} +{{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") diff --git a/upstreamed/wordpress/templates/_helpers.tpl b/upstreamed/wordpress/templates/_helpers.tpl index 1e52d321c..82efe816c 100644 --- a/upstreamed/wordpress/templates/_helpers.tpl +++ b/upstreamed/wordpress/templates/_helpers.tpl @@ -22,3 +22,36 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper WordPress image name +*/}} +{{- define "wordpress.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/upstreamed/wordpress/templates/deployment.yaml b/upstreamed/wordpress/templates/deployment.yaml index 5fe006650..f545250f9 100644 --- a/upstreamed/wordpress/templates/deployment.yaml +++ b/upstreamed/wordpress/templates/deployment.yaml @@ -19,6 +19,15 @@ spec: app: {{ template "fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -26,9 +35,13 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + - name: wordpress + image: {{ template "wordpress.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ALLOW_EMPTY_PASSWORD @@ -140,6 +153,29 @@ spec: subPath: php resources: {{ toYaml .Values.resources | indent 10 }} +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + {{ toYaml .Values.metrics.resources | indent 10 }} +{{- end }} volumes: - name: wordpress-data {{- if .Values.persistence.enabled }} diff --git a/upstreamed/wordpress/templates/svc.yaml b/upstreamed/wordpress/templates/svc.yaml index f6c399313..636f6abf3 100644 --- a/upstreamed/wordpress/templates/svc.yaml +++ b/upstreamed/wordpress/templates/svc.yaml @@ -8,22 +8,22 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: {{ .Values.serviceType }} - {{- if (or (eq .Values.serviceType "LoadBalancer") (eq .Values.serviceType "NodePort")) }} - externalTrafficPolicy: {{ .Values.serviceExternalTrafficPolicy | quote }} + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} ports: - name: http - port: 80 + port: {{ .Values.service.port }} targetPort: http - {{- if (and (eq .Values.serviceType "NodePort") (not (empty .Values.nodePorts.http)))}} - nodePort: {{ .Values.nodePorts.http }} + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} {{- end }} - name: https - port: 443 + port: {{ .Values.service.httpsPort }} targetPort: https - {{- if (and (eq .Values.serviceType "NodePort") (not (empty .Values.nodePorts.https)))}} - nodePort: {{ .Values.nodePorts.https }} + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} {{- end }} selector: app: {{ template "fullname" . }} diff --git a/upstreamed/wordpress/templates/tests/test-mariadb-connection.yaml b/upstreamed/wordpress/templates/tests/test-mariadb-connection.yaml index 95ccb38ad..c9bcdf2b8 100644 --- a/upstreamed/wordpress/templates/tests/test-mariadb-connection.yaml +++ b/upstreamed/wordpress/templates/tests/test-mariadb-connection.yaml @@ -8,7 +8,7 @@ metadata: spec: containers: - name: {{ .Release.Name }}-credentials-test - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ template "wordpress.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: MARIADB_HOST diff --git a/upstreamed/wordpress/values-production.yaml b/upstreamed/wordpress/values-production.yaml index 8988ce797..13b843613 100644 --- a/upstreamed/wordpress/values-production.yaml +++ b/upstreamed/wordpress/values-production.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami WordPress image version ## ref: https://hub.docker.com/r/bitnami/wordpress/tags/ ## image: registry: docker.io repository: bitnami/wordpress - tag: 4.9.8-debian-9 + tag: 4.9.8 pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -85,6 +91,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -128,23 +136,28 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP ## -serviceType: ClusterIP -## -## serviceType: NodePort -## nodePorts: -## http: -## https: -nodePorts: - http: "" - https: "" -## Enable client source IP preservation -## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip -## -serviceExternalTrafficPolicy: Local +service: + type: ClusterIP + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Local ## Allow health checks to be pointed at the https port healthcheckHttps: false + ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: @@ -254,3 +267,27 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} + +## Prometheus Exporter / Metrics +## +metrics: + enabled: true + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {} diff --git a/upstreamed/wordpress/values.yaml b/upstreamed/wordpress/values.yaml index d1707badd..35293f72f 100644 --- a/upstreamed/wordpress/values.yaml +++ b/upstreamed/wordpress/values.yaml @@ -1,10 +1,16 @@ +## Global Docker image registry +## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## +# global: +# imageRegistry: + ## Bitnami WordPress image version ## ref: https://hub.docker.com/r/bitnami/wordpress/tags/ ## image: registry: docker.io repository: bitnami/wordpress - tag: 4.9.8-debian-9 + tag: 4.9.8 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -89,6 +95,8 @@ externalDatabase: ## ## MariaDB chart configuration ## +## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml +## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters enabled: true @@ -132,19 +140,23 @@ mariadb: ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP ## -serviceType: LoadBalancer -## -## serviceType: NodePort -## nodePorts: -## http: -## https: -nodePorts: - http: "" - https: "" -## Enable client source IP preservation -## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip -## -serviceExternalTrafficPolicy: Cluster +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster ## Allow health checks to be pointed at the https port healthcheckHttps: false @@ -252,3 +264,31 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistrKeySecretName + ## Metrics exporter pod Annotation and Labels + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: {}