Skip to content

Commit

Permalink
Added a choice to disable the whoami app
Browse files Browse the repository at this point in the history
  • Loading branch information
kyfelipe committed Jan 19, 2021
1 parent 4cd3de5 commit 43e5cec
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 110 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
14 changes: 7 additions & 7 deletions charts/vkpr/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 13 additions & 14 deletions charts/vkpr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
14 changes: 7 additions & 7 deletions charts/vkpr/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion charts/vkpr/templates/keycloak-data-volume.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if .Values.keycloak.enabled -}}
{{- if eq .Values.keycloak.postgresql.enabled false -}}
# apenas para h2
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand Down
4 changes: 2 additions & 2 deletions charts/vkpr/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions charts/vkpr/templates/serviceaccount.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/vkpr/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
105 changes: 35 additions & 70 deletions charts/vkpr/values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 43e5cec

Please sign in to comment.