diff --git a/stable/testlink/Chart.yaml b/stable/testlink/Chart.yaml index f5d553450d..bb8c198d85 100644 --- a/stable/testlink/Chart.yaml +++ b/stable/testlink/Chart.yaml @@ -1,5 +1,5 @@ name: testlink -version: 3.2.0 +version: 4.0.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 diff --git a/stable/testlink/README.md b/stable/testlink/README.md index 96a1533371..04d9eb2214 100644 --- a/stable/testlink/README.md +++ b/stable/testlink/README.md @@ -75,7 +75,13 @@ The following table lists the configurable parameters of the TestLink chart and | `mariadb.db.user` | Database user to create | `bn_testlink` | | `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.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.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | | `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | diff --git a/stable/testlink/templates/NOTES.txt b/stable/testlink/templates/NOTES.txt index a13e2981bb..f4ff8c371d 100644 --- a/stable/testlink/templates/NOTES.txt +++ b/stable/testlink/templates/NOTES.txt @@ -1,24 +1,25 @@ {{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}} 1. Get the TestLink 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 "TestLink 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 "fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "TestLink URL: http://$SERVICE_IP/" +{{- $port:=.Values.service.port | toString }} + echo "TestLink URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" -{{- else if contains "ClusterIP" .Values.serviceType }} +{{- else if contains "ClusterIP" .Values.service.type }} echo "TestLink 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 }} @@ -39,6 +40,6 @@ host. To configure TestLink to use and external database host: 1. Complete your TestLink deployment by running: - helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/testlink + helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/testlink {{- end }} diff --git a/stable/testlink/templates/svc.yaml b/stable/testlink/templates/svc.yaml index 6736e04769..2c712f3f21 100644 --- a/stable/testlink/templates/svc.yaml +++ b/stable/testlink/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/stable/testlink/values.yaml b/stable/testlink/values.yaml index 3782df9ab6..5e688176bf 100644 --- a/stable/testlink/values.yaml +++ b/stable/testlink/values.yaml @@ -133,7 +133,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/