Skip to content

Commit

Permalink
feat(helm): enable NodePort customization (#6770)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 authored May 24, 2023
1 parent c5b6b63 commit 530308a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ controlPlane:
injectorFailurePolicy: Fail

service:
apiServer:
http:
# -- Port on which Http api server Service is exposed on Node for service of type NodePort
nodePort: 30681
https:
# -- Port on which Https api server Service is exposed on Node for service of type NodePort
nodePort: 30682

# -- Whether to create a service resource.
enabled: true

Expand Down Expand Up @@ -150,6 +158,8 @@ controlPlane:
loadBalancerIP:
# -- Additional annotations to put on the Global Zone Sync Service
annotations: { }
# -- Port on which Global Zone Sync Service is exposed on Node for service of type NodePort
nodePort: 30685
# -- Port on which Global Zone Sync Service is exposed
port: 5685

Expand Down
3 changes: 3 additions & 0 deletions deployments/charts/kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ A Helm chart for the Kuma Control Plane
| controlPlane.affinity | object | `{"podAntiAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ include \"kuma.name\" . }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ .Release.Name }}"]},{"key":"app","operator":"In","values":["{{ include \"kuma.name\" . }}-control-plane"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":100}]}}` | Affinity placement rule for the Kuma Control Plane pods. This is rendered as a template, so you can reference other helm variables or includes. |
| controlPlane.topologySpreadConstraints | string | `nil` | Topology spread constraints rule for the Kuma Control Plane pods. This is rendered as a template, so you can use variables to generate match labels. |
| controlPlane.injectorFailurePolicy | string | `"Fail"` | Failure policy of the mutating webhook implemented by the Kuma Injector component |
| controlPlane.service.apiServer.http.nodePort | int | `30681` | Port on which Http api server Service is exposed on Node for service of type NodePort |
| controlPlane.service.apiServer.https.nodePort | int | `30682` | Port on which Https api server Service is exposed on Node for service of type NodePort |
| controlPlane.service.enabled | bool | `true` | Whether to create a service resource. |
| controlPlane.service.name | string | `nil` | Optionally override of the Kuma Control Plane Service's name |
| controlPlane.service.type | string | `"ClusterIP"` | Service type of the Kuma Control Plane |
Expand All @@ -51,6 +53,7 @@ A Helm chart for the Kuma Control Plane
| controlPlane.globalZoneSyncService.type | string | `"LoadBalancer"` | Service type of the Global-zone sync |
| controlPlane.globalZoneSyncService.loadBalancerIP | string | `nil` | Optionally specify IP to be used by cloud provider when configuring load balancer |
| controlPlane.globalZoneSyncService.annotations | object | `{}` | Additional annotations to put on the Global Zone Sync Service |
| controlPlane.globalZoneSyncService.nodePort | int | `30685` | Port on which Global Zone Sync Service is exposed on Node for service of type NodePort |
| controlPlane.globalZoneSyncService.port | int | `5685` | Port on which Global Zone Sync Service is exposed |
| controlPlane.defaults.skipMeshCreation | bool | `false` | Whether to skip creating the default Mesh |
| controlPlane.automountServiceAccountToken | bool | `true` | Whether to automountServiceAccountToken for cp. Optionally set to false |
Expand Down
6 changes: 3 additions & 3 deletions deployments/charts/kuma/templates/cp-global-sync-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ spec:
ports:
- port: {{ .Values.controlPlane.globalZoneSyncService.port }}
appProtocol: grpc
{{- if eq .Values.controlPlane.globalZoneSyncService.type "NodePort" }}
nodePort: 30685
{{- end }}
{{- if and (eq .Values.controlPlane.globalZoneSyncService.type "NodePort") .Values.controlPlane.globalZoneSyncService.nodePort }}
nodePort: {{ .Values.controlPlane.globalZoneSyncService.nodePort }}
{{- end }}
name: global-zone-sync
selector:
app: {{ include "kuma.name" . }}-control-plane
Expand Down
6 changes: 6 additions & 0 deletions deployments/charts/kuma/templates/cp-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ spec:
- port: 5681
name: http-api-server
appProtocol: http
{{- if and (eq .Values.controlPlane.service.type "NodePort") .Values.controlPlane.service.apiServer.http.nodePort }}
nodePort: {{ .Values.controlPlane.service.apiServer.http.nodePort }}
{{- end }}
- port: 5682
name: https-api-server
appProtocol: http
{{- if and (eq .Values.controlPlane.service.type "NodePort") .Values.controlPlane.service.apiServer.https.nodePort }}
nodePort: {{ .Values.controlPlane.service.apiServer.https.nodePort }}
{{- end }}
{{- if ne .Values.controlPlane.environment "universal" }}
- port: 443
name: https-admission-server
Expand Down
10 changes: 10 additions & 0 deletions deployments/charts/kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ controlPlane:
injectorFailurePolicy: Fail

service:
apiServer:
http:
# -- Port on which Http api server Service is exposed on Node for service of type NodePort
nodePort: 30681
https:
# -- Port on which Https api server Service is exposed on Node for service of type NodePort
nodePort: 30682

# -- Whether to create a service resource.
enabled: true

Expand Down Expand Up @@ -150,6 +158,8 @@ controlPlane:
loadBalancerIP:
# -- Additional annotations to put on the Global Zone Sync Service
annotations: { }
# -- Port on which Global Zone Sync Service is exposed on Node for service of type NodePort
nodePort: 30685
# -- Port on which Global Zone Sync Service is exposed
port: 5685

Expand Down

0 comments on commit 530308a

Please sign in to comment.