Skip to content

Commit

Permalink
Ledger: Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed May 10, 2020
1 parent dbea743 commit bf35123
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion charts/ledger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
49 changes: 31 additions & 18 deletions charts/ledger/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit bf35123

Please sign in to comment.