Support different port/targetPort for service in helm chart (#19889)

This commit is contained in:
Robert Fairburn 2024-06-24 10:43:47 -05:00 committed by GitHub
parent 74db826a52
commit 40d5a84e84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,7 @@ name: fleet
keywords:
- fleet
- osquery
version: v6.0.3
version: v6.1.0
home: https://github.com/fleetdm/fleet
sources:
- https://github.com/fleetdm/fleet.git

View file

@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "fleet.fullname" . -}}
{{- $svcPort := .Values.fleet.listenPort -}}
{{- $svcPort := ternary .Values.fleet.listenPort .Values.fleet.servicePort (eq .Values.fleet.servicePort nil) -}}
{{- 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}}

View file

@ -19,7 +19,8 @@ spec:
release: {{ .Release.Name }}
ports:
- name: fleet
port: {{ .Values.fleet.listenPort }}
port: {{ ternary .Values.fleet.listenPort .Values.fleet.servicePort (eq .Values.fleet.servicePort nil) }}
targetPort: {{ .Values.fleet.listenPort }}
{{- if .Values.gke.ingress.useGKEIngress }}
{{- if .Values.gke.ingress.nodePort }}
nodePort: {{ .Values.gke.ingress.nodePort }}

View file

@ -56,7 +56,10 @@ ingress:
## Section: Fleet
# All of the settings relating to configuring the Fleet server
fleet:
# Will also be the targetPort for the service
listenPort: 8080
# servicePort is optional. Use if the service port needs to differ from the listenPort above.
# servicePort: 9080
# Name of the Secret resource storing S3 bucket and optionally TLS secrets
secretName: fleet
# Whether or not to run `fleet db prepare` to run SQL migrations before starting Fleet
@ -205,7 +208,8 @@ gke:
environments:
# MDM Settings
# The following environment variable is required if you are using
# Fleet's macOS MDM features.
# Fleet's macOS MDM features. In a production environment, it is recommended that
# you store this private key in a secret and use envsFrom to reference the secret below.
# To more information: https://fleetdm.com/docs/using-fleet/fleet-server-configuration#server-private-key
FLEET_SERVER_PRIVATE_KEY: ""