Skip to content

Commit 417e902

Browse files
jchanamjuanpicado
andauthored
feat: allow adding extra ports and manifests (#151)
* Allow using extra ports and extra manifests * Bump up version * Revert service name fix * Give a default name for port in service * Fix port on example --------- Co-authored-by: Juan Picado <[email protected]>
1 parent 7fe397d commit 417e902

File tree

6 files changed

+50
-2
lines changed

6 files changed

+50
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ and their default values.
136136
| `ingress.hosts` | List of Ingress Hosts | `[]` |
137137
| `ingress.paths` | List of Ingress Paths | `["/"]` |
138138
| `ingress.extraPaths` | List of extra Ingress Paths | `[]` |
139+
| `extraPorts` | List of extra ports to expose from the pods | `[]` |
140+
| `extraManifests` | List of extra manifests to deploy within the chart | `[]` |
139141

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

charts/verdaccio/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A lightweight private node.js proxy registry
33
name: verdaccio
4-
version: 4.17.0
4+
version: 4.18.0
55
appVersion: 5.31.1
66
home: https://verdaccio.org
77
icon: https://cdn.verdaccio.dev/logos/default.png

charts/verdaccio/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
ports:
6464
- containerPort: 4873
6565
name: http
66+
{{- range .Values.extraPorts }}
67+
- containerPort: {{ .port }}
68+
name: {{ .targetPort }}
69+
{{- end }}
6670
livenessProbe:
6771
httpGet:
6872
path: /-/ping
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{ range .Values.extraManifests }}
2+
---
3+
{{ if typeIs "string" . }}
4+
{{- tpl . $ }}
5+
{{- else }}
6+
{{- tpl (toYaml .) $ }}
7+
{{- end }}
8+
{{ end }}

charts/verdaccio/templates/service.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,23 @@ spec:
2727
- port: {{ .Values.service.port }}
2828
targetPort: http
2929
protocol: TCP
30-
name: {{ .Values.service.name }}
30+
name: {{ .Values.service.name | default "http"}}
3131
{{- if contains "NodePort" .Values.service.type }}
3232
{{- if .Values.service.nodePort }}
3333
nodePort: {{ .Values.service.nodePort }}
3434
{{- end }}
3535
{{- end }}
36+
{{- range .Values.extraPorts }}
37+
- port: {{ .port }}
38+
{{- if .name }}
39+
name: {{ .name }}
40+
{{- end }}
41+
targetPort: {{ .targetPort }}
42+
protocol: {{ .protocol | default "TCP" }}
43+
{{- if .nodePort }}
44+
nodePort: {{ .nodePort }}
45+
{{- end }}
46+
{{- end }}
3647
selector:
3748
{{- include "verdaccio.selectorLabels" . | nindent 4 }}
3849
type: {{ .Values.service.type }}

charts/verdaccio/values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,26 @@ annotations: {}
255255
## Pod Topology Spread Constraints
256256
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
257257
topologySpreadConstraints: []
258+
259+
# Extra ports to expose from the pod
260+
extraPorts: []
261+
# Example to add a metrics port to the pod and service
262+
# - port: 9090 # Port to expose on the pod
263+
# name: metrics # Name of the port in the service
264+
# targetPort: metrics # Name of the port in the pod and in the targetPort for the service
265+
# protocol: TCP # Optional, defaults to TCP
266+
# nodePort: 30090 # Optional
267+
268+
# Additional manifests to deploy within the chart
269+
## Can be useful to deploy additional secrets, serviceMonitors, etc
270+
extraManifests: []
271+
# - apiVersion: monitoring.coreos.com/v1
272+
# kind: ServiceMonitor
273+
# metadata:
274+
# name: verdaccio
275+
# spec:
276+
# selector:
277+
# matchLabels:
278+
# app: verdaccio
279+
# endpoints:
280+
# - port: metrics

0 commit comments

Comments
 (0)