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

feat: allow adding extra ports and manifests #151

Merged
merged 6 commits into from
Oct 1, 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ and their default values.
| `ingress.hosts` | List of Ingress Hosts | `[]` |
| `ingress.paths` | List of Ingress Paths | `["/"]` |
| `ingress.extraPaths` | List of extra Ingress Paths | `[]` |
| `extraPorts` | List of extra ports to expose from the pods | `[]` |
| `extraManifests` | List of extra manifests to deploy within the chart | `[]` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
2 changes: 1 addition & 1 deletion charts/verdaccio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A lightweight private node.js proxy registry
name: verdaccio
version: 4.17.0
version: 4.18.0
appVersion: 5.31.1
home: https://verdaccio.org
icon: https://cdn.verdaccio.dev/logos/default.png
Expand Down
4 changes: 4 additions & 0 deletions charts/verdaccio/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
ports:
- containerPort: 4873
name: http
{{- range .Values.extraPorts }}
- containerPort: {{ .port }}
name: {{ .targetPort }}
{{- end }}
livenessProbe:
httpGet:
path: /-/ping
Expand Down
8 changes: 8 additions & 0 deletions charts/verdaccio/templates/extra-manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ range .Values.extraManifests }}
---
{{ if typeIs "string" . }}
{{- tpl . $ }}
{{- else }}
{{- tpl (toYaml .) $ }}
{{- end }}
{{ end }}
13 changes: 12 additions & 1 deletion charts/verdaccio/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ spec:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: {{ .Values.service.name }}
name: {{ .Values.service.name | default "http"}}
{{- if contains "NodePort" .Values.service.type }}
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
{{- end }}
{{- range .Values.extraPorts }}
- port: {{ .port }}
{{- if .name }}
name: {{ .name }}
{{- end }}
targetPort: {{ .targetPort }}
protocol: {{ .protocol | default "TCP" }}
{{- if .nodePort }}
nodePort: {{ .nodePort }}
{{- end }}
{{- end }}
selector:
{{- include "verdaccio.selectorLabels" . | nindent 4 }}
type: {{ .Values.service.type }}
23 changes: 23 additions & 0 deletions charts/verdaccio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,26 @@ annotations: {}
## Pod Topology Spread Constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraints: []

# Extra ports to expose from the pod
extraPorts: []
# Example to add a metrics port to the pod and service
# - port: 9090 # Port to expose on the pod
# name: metrics # Name of the port in the service
# targetPort: metrics # Name of the port in the pod and in the targetPort for the service
# protocol: TCP # Optional, defaults to TCP
# nodePort: 30090 # Optional

# Additional manifests to deploy within the chart
## Can be useful to deploy additional secrets, serviceMonitors, etc
extraManifests: []
# - apiVersion: monitoring.coreos.com/v1
# kind: ServiceMonitor
# metadata:
# name: verdaccio
# spec:
# selector:
# matchLabels:
# app: verdaccio
# endpoints:
# - port: metrics
Loading