Skip to content

Commit

Permalink
Make nodeport optional
Browse files Browse the repository at this point in the history
In some use cases, users of kafdrop may opt for clusterIP or other K8s
Service Types.
This help avoid errors from helm when installing the service.
Such error may be expressed as:
```
Forbidden: ... may not be used when `type` is 'ClusterIP'
```
Ref:
1. kubernetes/kubectl#221
2. Similar issue: helm/charts#16940

Signed-off-by: Luong Vo <vo.tran.thanh.luong@gmail.com>
  • Loading branch information
luong-komorebi authored and actions-user committed Apr 26, 2020
1 parent e75bfbb commit 330acf1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ spec:
targetPort: http
protocol: TCP
name: http
nodePort: {{ .Values.service.nodePort }}
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

0 comments on commit 330acf1

Please sign in to comment.