From 43e5cecba0d9e38fe3237ea355323ae760d1a294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20C=C3=B4rtes?= Date: Tue, 19 Jan 2021 09:26:59 -0300 Subject: [PATCH] Added a choice to disable the whoami app --- CHANGELOG.md | 7 ++ charts/vkpr/templates/NOTES.txt | 14 +-- charts/vkpr/templates/deployment.yaml | 27 +++-- charts/vkpr/templates/ingress.yaml | 14 +-- .../vkpr/templates/keycloak-data-volume.yaml | 1 - charts/vkpr/templates/service.yaml | 4 +- charts/vkpr/templates/serviceaccount.yaml | 8 -- .../vkpr/templates/tests/test-connection.yaml | 2 +- charts/vkpr/values.yaml | 105 ++++++------------ 9 files changed, 72 insertions(+), 110 deletions(-) delete mode 100644 charts/vkpr/templates/serviceaccount.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0dc7b0..4ad7f2c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Release Notes +## Version 0.8.3 - 2020-01-19 + +Improvements: + +- Added alias in nginx ingress dependency +- Added a choice to disable the whoami app + ## Version 0.8.1 - 2020-10-21 Upgrades: diff --git a/charts/vkpr/templates/NOTES.txt b/charts/vkpr/templates/NOTES.txt index e2cf5705..751d41e2 100644 --- a/charts/vkpr/templates/NOTES.txt +++ b/charts/vkpr/templates/NOTES.txt @@ -1,20 +1,20 @@ 1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} +{{- if .Values.whoami.ingress.enabled }} +{{- range $host := .Values.whoami.ingress.hosts }} {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + http{{ if $.Values.whoami.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} {{- end }} {{- end }} -{{- else if contains "NodePort" .Values.service.type }} +{{- else if contains "NodePort" .Values.whoami.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "vkpr.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.service.type }} +{{- else if contains "LoadBalancer" .Values.whoami.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "vkpr.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "vkpr.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} + echo http://$SERVICE_IP:{{ .Values.whoami.service.port }} +{{- else if contains "ClusterIP" .Values.whoami.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "vkpr.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 diff --git a/charts/vkpr/templates/deployment.yaml b/charts/vkpr/templates/deployment.yaml index ceaa87c2..f121a9b1 100644 --- a/charts/vkpr/templates/deployment.yaml +++ b/charts/vkpr/templates/deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "vkpr.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.whoami.replicaCount }} selector: matchLabels: {{- include "vkpr.selectorLabels" . | nindent 6 }} @@ -14,19 +14,18 @@ spec: labels: {{- include "vkpr.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.whoami.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "vkpr.serviceAccountName" . }} + {{- end }} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- toYaml .Values.whoami.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- toYaml .Values.whoami.securityContext | nindent 12 }} + image: "{{ .Values.whoami.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.whoami.image.pullPolicy }} ports: - name: http containerPort: 80 @@ -40,16 +39,16 @@ spec: path: / port: http resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} + {{- toYaml .Values.whoami.resources | nindent 12 }} + {{- with .Values.whoami.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.whoami.affinity }} affinity: {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- end }} + {{- with .Values.whoami.tolerations }} tolerations: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} diff --git a/charts/vkpr/templates/ingress.yaml b/charts/vkpr/templates/ingress.yaml index 5e5cd9a7..ab8646ce 100644 --- a/charts/vkpr/templates/ingress.yaml +++ b/charts/vkpr/templates/ingress.yaml @@ -1,6 +1,6 @@ -{{- if .Values.ingress.enabled -}} +{{- if .Values.whoami.ingress.enabled -}} {{- $fullName := include "vkpr.fullname" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.whoami.service.port -}} {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} @@ -11,23 +11,23 @@ metadata: name: {{ $fullName }} labels: {{- include "vkpr.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} + {{- with .Values.whoami.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if .Values.ingress.tls }} + {{- if .Values.whoami.ingress.tls }} tls: - {{- range .Values.ingress.tls }} + {{- range .Values.whoami.ingress.tls }} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} secretName: {{ .secretName }} + {{- end }} {{- end }} -{{- end }} rules: - {{- range .Values.ingress.hosts }} + {{- range .Values.whoami.ingress.hosts }} - host: {{ .host | quote }} http: paths: diff --git a/charts/vkpr/templates/keycloak-data-volume.yaml b/charts/vkpr/templates/keycloak-data-volume.yaml index 1a19183e..e2dd0dda 100644 --- a/charts/vkpr/templates/keycloak-data-volume.yaml +++ b/charts/vkpr/templates/keycloak-data-volume.yaml @@ -1,6 +1,5 @@ {{- if .Values.keycloak.enabled -}} {{- if eq .Values.keycloak.postgresql.enabled false -}} -# apenas para h2 apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/vkpr/templates/service.yaml b/charts/vkpr/templates/service.yaml index 412e926a..57bf8d10 100644 --- a/charts/vkpr/templates/service.yaml +++ b/charts/vkpr/templates/service.yaml @@ -5,9 +5,9 @@ metadata: labels: {{- include "vkpr.labels" . | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: {{ .Values.whoami.service.type }} ports: - - port: {{ .Values.service.port }} + - port: {{ .Values.whoami.service.port }} targetPort: http protocol: TCP name: http diff --git a/charts/vkpr/templates/serviceaccount.yaml b/charts/vkpr/templates/serviceaccount.yaml deleted file mode 100644 index 73f1a6ff..00000000 --- a/charts/vkpr/templates/serviceaccount.yaml +++ /dev/null @@ -1,8 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "vkpr.serviceAccountName" . }} - labels: -{{ include "vkpr.labels" . | nindent 4 }} -{{- end -}} diff --git a/charts/vkpr/templates/tests/test-connection.yaml b/charts/vkpr/templates/tests/test-connection.yaml index 68282414..16b84da9 100644 --- a/charts/vkpr/templates/tests/test-connection.yaml +++ b/charts/vkpr/templates/tests/test-connection.yaml @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "vkpr.fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "vkpr.fullname" . }}:{{ .Values.whoami.service.port }}'] restartPolicy: Never diff --git a/charts/vkpr/values.yaml b/charts/vkpr/values.yaml index 0b14e83e..c24580ae 100644 --- a/charts/vkpr/values.yaml +++ b/charts/vkpr/values.yaml @@ -1,8 +1,39 @@ -# Default values for vkpr. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +# Default values for VKPR -# subchart defaults +# VKPR Template +nameOverride: "" +fullnameOverride: "" + +whoami: + enabled: true + replicaCount: 1 + image: + repository: containous/whoami + pullPolicy: IfNotPresent + imagePullSecrets: [ ] + service: + type: ClusterIP + port: 80 + ingress: + enabled: true + annotations: { } + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: whoami.local + paths: ["/"] + tls: [ ] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + podSecurityContext: { } + securityContext: { } + resources: { } + nodeSelector: { } + tolerations: [ ] + affinity: { } + +# VKPR subchart defaults nginx-ingress: enabled: true controller: @@ -60,72 +91,6 @@ acme: # ingress: # class: kong -# -# auto-generated entries below -# -replicaCount: 1 - -image: - repository: containous/whoami - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: whoami.local - paths: [] - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} - # BACKUP STACK velero: enabled: false