From 18dc75d9c0d80f8f0de1743bd52dde5cd183fe4f Mon Sep 17 00:00:00 2001 From: Bitnami Containers Date: Tue, 21 Feb 2017 12:49:34 +0000 Subject: [PATCH 1/5] tomcat: update to `bitnami/tomcat:9.0.0.M17-r2` --- incubator/tomcat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/tomcat/values.yaml b/incubator/tomcat/values.yaml index 355be7c5f..709dd1d72 100644 --- a/incubator/tomcat/values.yaml +++ b/incubator/tomcat/values.yaml @@ -1,7 +1,7 @@ ## Bitnami Tomcat image version ## ref: https://hub.docker.com/r/bitnami/tomcat/tags/ ## -image: bitnami/tomcat:9.0.0.M17-r1 +image: bitnami/tomcat:9.0.0.M17-r2 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images From 3aab78d14936d0db4e9ea18da13962b0e018eae4 Mon Sep 17 00:00:00 2001 From: Bitnami Containers Date: Tue, 21 Feb 2017 12:49:34 +0000 Subject: [PATCH 2/5] tomcat: bump chart version to `0.4.5` --- incubator/tomcat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/tomcat/Chart.yaml b/incubator/tomcat/Chart.yaml index 5ac23d539..22bb1f955 100644 --- a/incubator/tomcat/Chart.yaml +++ b/incubator/tomcat/Chart.yaml @@ -1,5 +1,5 @@ name: tomcat -version: 0.4.4 +version: 0.4.5 description: Chart for Apache Tomcat keywords: - tomcat From 37c1bb64f0d4264ab51c4018e7265989628a05c3 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 12:23:37 +0530 Subject: [PATCH 3/5] tomcat: add alpha and beta storageclass annotation support --- incubator/tomcat/README.md | 24 ++++++++++++------------ incubator/tomcat/templates/pvc.yaml | 6 +++++- incubator/tomcat/values.yaml | 5 ++++- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/incubator/tomcat/README.md b/incubator/tomcat/README.md index 9e5a490f0..77ff87d04 100644 --- a/incubator/tomcat/README.md +++ b/incubator/tomcat/README.md @@ -43,18 +43,18 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Tomcat chart and their default values. -| Parameter | Description | Default | -|----------------------------|---------------------------------------|-------------------------------------------| -| `image` | Tomcat image | `bitnami/tomcat:{VERSION}` | -| `imagePullPolicy` | Image pull policy | `IfNotPresent` | -| `tomcatUsername` | Tomcat admin user | `user` | -| `tomcatPassword` | Tomcat admin password | _random 10 character alphanumeric string_ | -| `serviceType` | Kubernetes Service type | `LoadBalancer` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for Tomcat volume | `generic` | -| `persistence.accessMode` | PVC Access Mode for Tomcat volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for Tomcat volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| Parameter | Description | Default | +|----------------------------|---------------------------------------|---------------------------------------------| +| `image` | Tomcat image | `bitnami/tomcat:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `IfNotPresent` | +| `tomcatUsername` | Tomcat admin user | `user` | +| `tomcatPassword` | Tomcat admin password | _random 10 character alphanumeric string_ | +| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `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` | +| `persistence.size` | PVC Storage Request for Tomcat volume | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | The above parameters map to the env variables defined in [bitnami/tomcat](http://github.com/bitnami/bitnami-docker-tomcat). For more information please refer to the [bitnami/tomcat](http://github.com/bitnami/bitnami-docker-tomcat) image documentation. diff --git a/incubator/tomcat/templates/pvc.yaml b/incubator/tomcat/templates/pvc.yaml index 250603780..14c4e2fc0 100644 --- a/incubator/tomcat/templates/pvc.yaml +++ b/incubator/tomcat/templates/pvc.yaml @@ -9,7 +9,11 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- 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 }} diff --git a/incubator/tomcat/values.yaml b/incubator/tomcat/values.yaml index 709dd1d72..f0455d702 100644 --- a/incubator/tomcat/values.yaml +++ b/incubator/tomcat/values.yaml @@ -28,7 +28,10 @@ serviceType: LoadBalancer ## persistence: enabled: true - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi From 5959681e6e9e8f02997ecfcb9941aaa161cc3604 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 12:24:26 +0530 Subject: [PATCH 4/5] tomcat: fix command to fetch password from secrets volume --- incubator/tomcat/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/tomcat/templates/NOTES.txt b/incubator/tomcat/templates/NOTES.txt index 01a38bf61..a060426bb 100644 --- a/incubator/tomcat/templates/NOTES.txt +++ b/incubator/tomcat/templates/NOTES.txt @@ -27,4 +27,4 @@ 2. Login with the following credentials echo Username: {{ .Values.tomcatUsername }} - echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.tomcat-password[*]}"`)) + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.tomcat-password}" | base64 --decode) From 81d1ba103e75f612566120cb2310ec59dfc625db Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 12:25:40 +0530 Subject: [PATCH 5/5] tomcat: increase resource name truncation and trim - suffix --- incubator/tomcat/templates/_helpers.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/incubator/tomcat/templates/_helpers.tpl b/incubator/tomcat/templates/_helpers.tpl index 234480de7..f0d83d2ed 100644 --- a/incubator/tomcat/templates/_helpers.tpl +++ b/incubator/tomcat/templates/_helpers.tpl @@ -3,14 +3,14 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}}