Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

feat(helm): add multiple service types to gateway #962

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions installation/kubernetes/helm/vmclarity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ secrets.
| gateway.replicas | int | `1` | Number of replicas for the gateway |
| gateway.resources.limits | object | `{}` | The resources limits for the gateway containers |
| gateway.resources.requests | object | `{}` | The requested resources for the gateway containers |
| gateway.service.annotations | object | `{}` | Annotations set for service |
| gateway.service.clusterIP | string | `""` | Dedicated IP address used for service |
| gateway.service.externalTrafficPolicy | string | `"Cluster"` | External Traffic Policy configuration Set the field to Cluster to route external traffic to all ready endpoints and Local to only route to ready node-local endpoints. |
| gateway.service.nodePorts | object | `{"http":""}` | NodePort configurations |
| gateway.service.ports | object | `{"http":80}` | Port configurations |
| gateway.service.type | string | `"ClusterIP"` | Service type: ClusterIP, NodePort, LoadBalancer |
| gateway.serviceAccount.automountServiceAccountToken | bool | `false` | Allows auto mount of ServiceAccountToken on the serviceAccount created. Can be set to false if pods using this serviceAccount do not need to use K8s API. |
| gateway.serviceAccount.create | bool | `true` | Enable creation of ServiceAccount |
| gateway.serviceAccount.name | string | `""` | The name of the ServiceAccount to use. If not set and create is true, it will use the component's calculated name. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
{{- if .Values.gateway.resources }}
resources: {{- toYaml .Values.gateway.resources | nindent 12 }}
{{- end }}
ports:
- containerPort: 8080
name: gateway-http
volumes:
- name: gateway-config
configMap:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "vmclarity.gateway.name" . }}-hl
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "vmclarity.gateway.labels.standard" . | nindent 4 }}
{{- if (not (empty .Values.gateway.service.annotations)) }}
annotations: {{ .Values.gateway.service.annotations }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: http
protocol: TCP
port: {{ .Values.gateway.service.ports.http }}
targetPort: gateway-http
selector: {{- include "vmclarity.gateway.labels.matchLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ metadata:
name: {{ include "vmclarity.gateway.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "vmclarity.gateway.labels.standard" . | nindent 4 }}
{{- if (not (empty .Values.gateway.service.annotations)) }}
annotations: {{ .Values.gateway.service.annotations }}
{{- end }}
spec:
type: ClusterIP
type: {{ .Values.gateway.service.type }}
{{- if and .Values.gateway.service.clusterIP (eq .Values.gateway.service.type "ClusterIP") }}
clusterIP: {{ .Values.gateway.service.clusterIP }}
{{- end }}
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
port: {{ .Values.gateway.service.ports.http }}
targetPort: gateway-http
{{- if and (or (eq .Values.gateway.service.type "NodePort") (eq .Values.gateway.service.type "LoadBalancer")) (not (empty .Values.gateway.service.nodePorts.http)) }}
nodePort: {{ .Values.gateway.service.nodePorts.http }}
{{- end }}
{{- if and (or (eq .Values.gateway.service.type "NodePort") (eq .Values.gateway.service.type "LoadBalancer")) (not (empty .Values.gateway.service.externalTrafficPolicy)) }}
externalTrafficPolicy: {{ .Values.gateway.service.externalTrafficPolicy }}
{{- end }}
selector: {{- include "vmclarity.gateway.labels.matchLabels" . | nindent 4 }}
17 changes: 17 additions & 0 deletions installation/kubernetes/helm/vmclarity/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,23 @@ gateway:
drop:
- ALL

service:
# -- Service type: ClusterIP, NodePort, LoadBalancer
type: ClusterIP
# -- Port configurations
ports:
http: 80
# -- NodePort configurations
nodePorts:
http: ""
# -- Dedicated IP address used for service
clusterIP: ""
# -- Annotations set for service
annotations: {}
# -- External Traffic Policy configuration
# Set the field to Cluster to route external traffic to all ready endpoints and Local to only route to ready node-local endpoints.
externalTrafficPolicy: Cluster

postgresql:
image:
# -- Postgresql container registry
Expand Down