Skip to content

Commit 0d01731

Browse files
authored
added sidecarContainers (#48)
* added sidecarContainers Signed-off-by: Sebastian Stauch <[email protected]> * documentation for sidecars Signed-off-by: Sebastian Stauch <[email protected]> * bump chart version to 3.9.1 Signed-off-by: Sebastian Stauch <[email protected]> * Possibility to use named port from sidecar in service Signed-off-by: Sebastian Stauch <[email protected]> * use named port when service type is NodePort Signed-off-by: Sebastian Stauch <[email protected]> * removed trailing spaces and malformed comments Signed-off-by: Sebastian Stauch <[email protected]> Signed-off-by: Sebastian Stauch <[email protected]>
1 parent 2e62ddc commit 0d01731

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

src/chartmuseum/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: Host your own Helm Chart Repository
33
name: chartmuseum
4-
version: 3.9.0
4+
version: 3.9.1
55
appVersion: 0.15.0
66
home: https://github.com/helm/chartmuseum
77
icon: https://raw.githubusercontent.com/chartmuseum/charts/main/logo.jpg

src/chartmuseum/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ their default values. See values.yaml for all available options.
202202
| `deployment.labels` | Additional labels for deployment | `{}` |
203203
| `deployment.extraVolumes` | Additional volumes for deployment | `[]` |
204204
| `deployment.extraVolumeMounts` | Additional volumes to mount in container for deployment | `[]` |
205+
| `deployment.sidecarContainers` | Additional containers to run in the pod | `{}` |
205206
| `podAnnotations` | Annotations for pods | `{}` |
206207
| `podLabels` | Labels for pods | `{}` |
207208
| `ingress.enabled` | Enable ingress controller resource | `false` |

src/chartmuseum/templates/deployment.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ spec:
151151
- name: public-key
152152
mountPath: /var/keys
153153
readOnly: true
154+
{{- end }}
155+
{{- if .Values.deployment.sidecarContainers }}
156+
{{- range $name, $spec := .Values.deployment.sidecarContainers }}
157+
- name: {{ $name }}
158+
{{- toYaml $spec | nindent 8 }}
159+
{{- end }}
154160
{{- end }}
155161
{{- with .Values.resources }}
156162
resources:

src/chartmuseum/templates/service.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ spec:
3434
- port: {{ .Values.service.externalPort }}
3535
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
3636
nodePort: {{.Values.service.nodePort}}
37+
{{- end }}
38+
{{- if .Values.service.targetPort }}
39+
targetPort: {{ .Values.service.targetPort }}
40+
name: {{ .Values.service.targetPort }}
3741
{{- else }}
3842
targetPort: http
43+
name: http
3944
{{- end }}
4045
protocol: TCP
41-
name: http
46+
4247
selector:
4348
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}

src/chartmuseum/values.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,27 @@ deployment:
129129
# name: value
130130
# additional volumes
131131
extraVolumes: []
132+
# - name: nginx-config
133+
# secret:
134+
# secretName: nginx-config
132135
# additional volumes to mount
133136
extraVolumeMounts: []
137+
## sidecarContainers for the Chartmuseum
138+
# Can be used to add a proxy to the pod that does
139+
# scanning for secrets, signing, authentication, validation
140+
# of the chart's content, send notifications...
141+
sidecarContainers: {}
142+
## Example sidecarContainer which uses an extraVolume from above and
143+
## a named port that can be referenced in the service as targetPort.
144+
# proxy:
145+
# image: nginx:latest
146+
# ports:
147+
# - name: proxy
148+
# containerPort: 8081
149+
# volumeMounts:
150+
# - name: nginx-config
151+
# readOnly: true
152+
# mountPath: /etc/nginx
134153

135154
## Pod annotations
136155
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
@@ -156,6 +175,10 @@ service:
156175
loadBalancerSourceRanges: []
157176
# clusterIP: None
158177
externalPort: 8080
178+
## targetPort of the container to use. If a sidecar should handle the
179+
## requests first, use the named port from the sidecar. See sidecar example
180+
## from deployment above. Leave empty to use chartmuseum directly.
181+
targetPort:
159182
nodePort:
160183
annotations: {}
161184
labels: {}

0 commit comments

Comments
 (0)