diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..532bf13 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +lint: + @find ./charts/* -type d -maxdepth 0 | xargs -I{} bash -c "helm lint {}" + +template: + # helm template ./charts/$(chart) + helm install chart --dry-run ./charts/$(chart) diff --git a/charts/ledger/Chart.yaml b/charts/ledger/Chart.yaml index 1f67c28..ffff596 100644 --- a/charts/ledger/Chart.yaml +++ b/charts/ledger/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: ledger description: A ledger for your CD pipeline -version: 0.1.6 +version: 0.1.7 appVersion: 0.1.5 sources: - https://github.com/stenic/helm-charts/tree/master/charts/ledger diff --git a/charts/ledger/templates/NOTES.txt b/charts/ledger/templates/NOTES.txt index fb65fdf..047ecfb 100644 --- a/charts/ledger/templates/NOTES.txt +++ b/charts/ledger/templates/NOTES.txt @@ -1,21 +1,34 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ledger.fullname" . }}) +1. Get your 'admin' user password by running: + printf $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "ledger.fullname" . }} -o jsonpath="{.data.ledger-admin-password}" | base64 --decode);echo + +{{ if .Values.ingress.enabled }} +2. Visit Ledger on: +{{- range .Values.ingress.hosts }} + - http://{{ .host }}/ +{{- end -}} + +{{ else }} +2. Get the Ledger URL to visit by running these commands in the same shell: +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "ledger.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT + echo http://$NODE_IP:$NODE_PORT/login {{- else if contains "LoadBalancer" .Values.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 "ledger.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ledger.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ledger.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 + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "ledger.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "ledger.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") + echo http://$SERVICE_IP:{{ .Values.service.port }}/login +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo http://127.0.0.1:8080 + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:8080 +{{ end }} {{- end }} + +{{- if .Values.persistence.enabled }} +{{- else }} +################################################################################# +###### WARNING: Persistence is disabled!!! You will lose your data when ##### +###### the Ledger pod is terminated. ##### +################################################################################# +{{- end }} \ No newline at end of file