diff --git a/charts/podinfo/README.md b/charts/podinfo/README.md index 2275286..b6198aa 100644 --- a/charts/podinfo/README.md +++ b/charts/podinfo/README.md @@ -69,12 +69,14 @@ Parameter | Description | Default `serviceAccount.enabled` | specifies whether a service account should be created | `false` `serviceAccount.name` | the name of the service account to use, if not set and create is true, a name is generated using the fullname template | None `linkerd.profile.enabled` | create Linkerd service profile | `false` +`serviceMonitor.enabled` | specifies whether a Prometheus Operator service monitor should be created | `false` +`serviceMonitor.interval` | Prometheus scraping interval | `15s` Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, ```console $ helm install stable/podinfo --name my-release \ - --set=image.tag=0.0.2,service.type=NodePort + --set=serviceMonitor.enabled=true,serviceMonitor.interval=5s ``` Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, diff --git a/charts/podinfo/templates/NOTES.txt b/charts/podinfo/templates/NOTES.txt index d82f62e..044fb00 100644 --- a/charts/podinfo/templates/NOTES.txt +++ b/charts/podinfo/templates/NOTES.txt @@ -11,9 +11,8 @@ 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 -w {{ template "podinfo.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "podinfo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "podinfo.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }} + kubectl -n {{ .Release.Namespace }} port-forward deploy/{{ template "podinfo.fullname" . }} 8080:{{ .Values.service.externalPort }} {{- end }} diff --git a/charts/podinfo/templates/deployment.yaml b/charts/podinfo/templates/deployment.yaml index 95c381a..c6b9854 100644 --- a/charts/podinfo/templates/deployment.yaml +++ b/charts/podinfo/templates/deployment.yaml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: {{ template "podinfo.fullname" . }} labels: - app: {{ template "podinfo.name" . }} + app: {{ template "podinfo.fullname" . }} chart: {{ template "podinfo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -17,13 +17,11 @@ spec: maxUnavailable: 1 selector: matchLabels: - app: {{ template "podinfo.name" . }} - release: {{ .Release.Name }} + app: {{ template "podinfo.fullname" . }} template: metadata: labels: - app: {{ template "podinfo.name" . }} - release: {{ .Release.Name }} + app: {{ template "podinfo.fullname" . }} annotations: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.service.httpPort }}" diff --git a/charts/podinfo/templates/service.yaml b/charts/podinfo/templates/service.yaml index 9daa442..2780d44 100644 --- a/charts/podinfo/templates/service.yaml +++ b/charts/podinfo/templates/service.yaml @@ -25,6 +25,5 @@ spec: name: grpc {{- end }} selector: - app: {{ template "podinfo.name" . }} - release: {{ .Release.Name }} + app: {{ template "podinfo.fullname" . }} {{- end }} \ No newline at end of file diff --git a/charts/podinfo/templates/tests/jwt.yaml b/charts/podinfo/templates/tests/jwt.yaml index 1721e34..1cefd7a 100644 --- a/charts/podinfo/templates/tests/jwt.yaml +++ b/charts/podinfo/templates/tests/jwt.yaml @@ -16,7 +16,7 @@ metadata: spec: containers: - name: tools - image: giantswarm/tiny-tools + image: curlimages/curl:7.69.0 command: - sh - -c @@ -25,6 +25,5 @@ spec: curl -sH "Authorization: Bearer ${TOKEN}" ${PODINFO_SVC}/token/validate | grep test env: - name: PODINFO_SVC - value: {{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }} + value: "{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }}" restartPolicy: Never - diff --git a/charts/podinfo/templates/tests/service.yaml b/charts/podinfo/templates/tests/service.yaml index 861b555..bd81825 100644 --- a/charts/podinfo/templates/tests/service.yaml +++ b/charts/podinfo/templates/tests/service.yaml @@ -16,7 +16,7 @@ metadata: spec: containers: - name: curl - image: giantswarm/tiny-tools + image: curlimages/curl:7.69.0 command: - sh - -c @@ -24,5 +24,5 @@ spec: curl -s ${PODINFO_SVC}/api/info | grep version env: - name: PODINFO_SVC - value: {{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }} + value: "{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }}" restartPolicy: Never diff --git a/charts/podinfo/values.yaml b/charts/podinfo/values.yaml index e84d6ef..0639365 100644 --- a/charts/podinfo/values.yaml +++ b/charts/podinfo/values.yaml @@ -56,6 +56,10 @@ linkerd: profile: enabled: false +serviceMonitor: + enabled: false + interval: 15s + ingress: enabled: false annotations: {}