Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm: allow container port configuration #1606

Merged
merged 1 commit into from
Oct 4, 2024
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
8 changes: 6 additions & 2 deletions helm/sealed-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,18 @@ The command removes all the Kubernetes components associated with the chart and
| `additionalVolumes` | Extra Volumes for the Sealed Secrets Controller Deployment | `{}` |
| `additionalVolumeMounts` | Extra volumeMounts for the Sealed Secrets Controller container | `{}` |
| `hostNetwork` | Sealed Secrets pods' hostNetwork | `false` |
| `containerPorts.http` | Controller HTTP Port on the Host and Container | `8080` |
| `containerPorts.metrics` | Metrics HTTP Port on the Host and Container | `8081` |
| `hostPorts.http` | Controller HTTP Port on the Host | `""` |
| `hostPorts.metrics` | Metrics HTTP Port on the Host | `""` |
| `dnsPolicy` | Sealed Secrets pods' dnsPolicy | `""` |

### Traffic Exposure Parameters

| Name | Description | Value |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `service.type` | Sealed Secret service type | `ClusterIP` |
| `service.loadBalancerClass` | Sealed Secret service loadBalancerClass | `` |
| `service.loadBalancerClass` | Sealed Secret service loadBalancerClass | `""` |
| `service.port` | Sealed Secret service HTTP port | `8080` |
| `service.nodePort` | Node port for HTTP | `""` |
| `service.annotations` | Additional custom annotations for Sealed Secret service | `{}` |
Expand Down Expand Up @@ -214,7 +218,7 @@ The command removes all the Kubernetes components associated with the chart and
| `metrics.dashboards.annotations` | Annotations to be added to the Grafana dashboard ConfigMap | `{}` |
| `metrics.dashboards.namespace` | Namespace where Grafana dashboard ConfigMap is deployed | `""` |
| `metrics.service.type` | Sealed Secret Metrics service type | `ClusterIP` |
| `metrics.service.loadBalancerClass` | Sealed Secret service Metrics loadBalancerClass | `` |
| `metrics.service.loadBalancerClass` | Sealed Secret Metrics service loadBalancerClass | `""` |
| `metrics.service.port` | Sealed Secret service Metrics HTTP port | `8081` |
| `metrics.service.nodePort` | Node port for HTTP | `""` |
| `metrics.service.annotations` | Additional custom annotations for Sealed Secret Metrics service | `{}` |
Expand Down
26 changes: 22 additions & 4 deletions helm/sealed-secrets/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ spec:
- --log-format
- {{ .Values.logFormat }}
{{- end }}
{{- if .Values.containerPorts.http }}
- --listen-addr
- {{ printf ":%s" (.Values.containerPorts.http | toString ) }}
{{- end }}
{{- if .Values.containerPorts.metrics }}
- --listen-metrics-addr
- {{ printf ":%s" (.Values.containerPorts.metrics | toString) }}
{{- end }}
{{- end }}
image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand All @@ -146,10 +154,20 @@ spec:
resource: limits.memory
{{- end }}
ports:
- containerPort: 8080
name: http
- containerPort: 8081
name: metrics
- name: http
containerPort: {{ .Values.containerPorts.http | default "8080" }}
{{- if .Values.hostNetwork }}
hostPort: {{ .Values.containerPorts.http }}
{{- else if .Values.hostPorts.http }}
hostPort: {{ .Values.hostPorts.http }}
{{- end }}
- name: metrics
containerPort: {{ .Values.containerPorts.metrics | default "8081" }}
{{- if .Values.hostNetwork }}
hostPort: {{ .Values.containerPorts.metrics }}
{{- else if .Values.hostPorts.metrics }}
hostPort: {{ .Values.hostPorts.metrics }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe: {{- include "sealed-secrets.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
Expand Down
18 changes: 17 additions & 1 deletion helm/sealed-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,25 @@ additionalVolumes: []
additionalVolumeMounts: []
## @param hostNetwork Sealed Secrets pods' hostNetwork
hostNetwork: false
## Sealed Secrets controller ports to open
## If hostNetwork true: the hostPort is set identical to the containerPort
## @param containerPorts.http Controller HTTP Port on the Host and Container
## @param containerPorts.metrics Metrics HTTP Port on the Host and Container
##
containerPorts:
http: 8080
metrics: 8081
## Sealed Secrets controller ports to be exposed as hostPort
## If hostNetwork is false, only the ports specified here will be exposed (or not if set to an empty string)
## @param hostPorts.http Controller HTTP Port on the Host
## @param hostPorts.metrics Metrics HTTP Port on the Host
##
hostPorts:
http: ""
metrics: ""

## @param dnsPolicy Sealed Secrets pods' dnsPolicy
dnsPolicy: ""

## @section Traffic Exposure Parameters

## Sealed Secret service parameters
Expand Down
Loading