From aac50149464da8508caea5768207ad6e8be43ebf Mon Sep 17 00:00:00 2001 From: Christian Kreuzberger Date: Wed, 18 May 2022 16:59:12 +0200 Subject: [PATCH] chore: Remove ingress, cleanup helm chart (#309) Signed-off-by: Christian Kreuzberger --- chart/Chart.yaml | 6 ++-- chart/templates/NOTES.txt | 32 ++++++------------- chart/templates/ingress.yaml | 61 ------------------------------------ chart/values.yaml | 19 ++--------- 4 files changed, 16 insertions(+), 102 deletions(-) delete mode 100644 chart/templates/ingress.yaml diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 4f8bb9a..5096f9f 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: prometheus-service -description: A Helm chart for Kubernetes +description: A Helm chart for Keptn's prometheus-service # A chart can be either an 'application' or a 'library' chart. # @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.0.0-dev # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.7.1" +appVersion: "0.0.0-dev" diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index 35d95eb..de2207d 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -1,22 +1,10 @@ -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 }}{{ .path }} - {{- 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 "prometheus-service.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 }} - 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 "prometheus-service.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prometheus-service.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 "prometheus-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} +Thanks for deploying Keptn's prometheus-service! + +You can find more information on the following pages: + +* https://github.com/keptn-contrib/prometheus-service +* https://keptn.sh/docs/0.15.x/monitoring/prometheus/install/ + +IMPORTANT: You must apply below manifest (contains role-binding for prometheus) in order for prometheus-service to be able to communicate with Prometheus: + + kubectl -n monitoring apply -f https://raw.githubusercontent.com/keptn-contrib/prometheus-service/{{ .Chart.Version }}/deploy/role.yaml diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml deleted file mode 100644 index b9f05f0..0000000 --- a/chart/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "prometheus-service.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "prometheus-service.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 710f17c..97efa93 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -10,6 +10,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" +# Prometheus specific configuration prometheus: namespace: "monitoring" # K8s namespace where prometheus is installed namespace_am: "monitoring" # K8s namespace where prometheus-alertmanager is installed @@ -28,6 +29,7 @@ distributor: queueGroup: enabled: true # Enable connection via Nats queue group to support exactly-once message processing +# Note: Remote Control Plane is currently not supported by prometheus-service - please keep this setting disabled remoteControlPlane: enabled: false # Enables remote execution plane mode api: @@ -66,22 +68,6 @@ service: type: ClusterIP port: 8080 -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: # Resource limits and requests limits: cpu: 500m @@ -90,6 +76,7 @@ resources: # Resource limits and requests cpu: 50m memory: 32Mi +# Note: We don't recommend turning on auto-scaling autoscaling: enabled: false minReplicas: 1