Skip to content

Commit

Permalink
simplify Ingress configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
apetruhin committed Apr 26, 2024
1 parent d7f2742 commit c78d671
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/coroot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: coroot
description: A monitoring and troubleshooting tool for microservice architectures.
type: application
version: 0.10.6
version: 0.10.7
appVersion: "1.0.0"
dependencies:
- name: prometheus
Expand Down
41 changes: 41 additions & 0 deletions charts/coroot/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
CHART NAME: {{ .Chart.Name }}
CHART VERSION: {{ .Chart.Version }}
COROOT VERSION: {{ .Chart.AppVersion }}

Please wait until Coroot's components are deployed. You can monitor the status by:

kubectl -n {{ .Release.Namespace }} get pods

Please wait until all the pods are in the "Running" STATUS and READY.

{{ if .Values.corootCE.ingress.enabled }}
Visit Coroot at the ingress URL(s):
{{- if .Values.corootCE.ingress.hostname }}
http{{ if $.Values.corootCE.ingress.tls }}s{{ end }}://{{ .Values.corootCE.ingress.hostname }}{{ .Values.corootCE.ingress.path }}
{{- end }}
{{- range $host := .Values.corootCE.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.corootCE.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}

or
{{ else if contains "NodePort" .Values.corootCE.service.type}}
Get the Coroot URL by running these commands in the same shell:
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "coroot.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT

or
{{ else if contains "LoadBalancer" .Values.corootCE.service.type }}
Get the Coroot URL by running these commands in the same shell:
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 "coroot.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "coroot.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.corootCE.service.port }}

or
{{ end }}
Forward the Coroot port to your machine:

kubectl --namespace {{ .Release.Namespace }} port-forward service/{{ include "coroot.fullname" . }} 8080:{{ .Values.corootCE.service.port }}

Then, you can access Coroot at http://127.0.0.1:8080

For more information on running Coroot, visit https://coroot.com/docs/coroot-community-edition/getting-started/installation

19 changes: 19 additions & 0 deletions charts/coroot/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ spec:
{{- end }}
{{- end }}
rules:
{{- if .Values.corootCE.ingress.hostname }}
- host: {{ .Values.corootCE.ingress.hostname | quote }}
http:
paths:
- path: {{ .Values.corootCE.ingress.path }}
{{- if and .Values.corootCE.ingress.pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .Values.corootCE.ingress.pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- range .Values.corootCE.ingress.hosts }}
- host: {{ .host | quote }}
http:
Expand Down
3 changes: 3 additions & 0 deletions charts/coroot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ corootCE:
ingress:
enabled: false
className: ""
hostname:
path: /
pathType: ImplementationSpecific
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
Expand Down

0 comments on commit c78d671

Please sign in to comment.