Skip to content

Commit

Permalink
added sidecarContainers (#48)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
sebidude authored Sep 27, 2022
1 parent 2e62ddc commit 0d01731
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chartmuseum/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: Host your own Helm Chart Repository
name: chartmuseum
version: 3.9.0
version: 3.9.1
appVersion: 0.15.0
home: https://github.com/helm/chartmuseum
icon: https://raw.githubusercontent.com/chartmuseum/charts/main/logo.jpg
Expand Down
1 change: 1 addition & 0 deletions src/chartmuseum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ their default values. See values.yaml for all available options.
| `deployment.labels` | Additional labels for deployment | `{}` |
| `deployment.extraVolumes` | Additional volumes for deployment | `[]` |
| `deployment.extraVolumeMounts` | Additional volumes to mount in container for deployment | `[]` |
| `deployment.sidecarContainers` | Additional containers to run in the pod | `{}` |
| `podAnnotations` | Annotations for pods | `{}` |
| `podLabels` | Labels for pods | `{}` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
Expand Down
6 changes: 6 additions & 0 deletions src/chartmuseum/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ spec:
- name: public-key
mountPath: /var/keys
readOnly: true
{{- end }}
{{- if .Values.deployment.sidecarContainers }}
{{- range $name, $spec := .Values.deployment.sidecarContainers }}
- name: {{ $name }}
{{- toYaml $spec | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.resources }}
resources:
Expand Down
7 changes: 6 additions & 1 deletion src/chartmuseum/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ spec:
- port: {{ .Values.service.externalPort }}
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{- end }}
{{- if .Values.service.targetPort }}
targetPort: {{ .Values.service.targetPort }}
name: {{ .Values.service.targetPort }}
{{- else }}
targetPort: http
name: http
{{- end }}
protocol: TCP
name: http

selector:
{{- include "chartmuseum.selectorLabels" . | nindent 4 }}
23 changes: 23 additions & 0 deletions src/chartmuseum/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,27 @@ deployment:
# name: value
# additional volumes
extraVolumes: []
# - name: nginx-config
# secret:
# secretName: nginx-config
# additional volumes to mount
extraVolumeMounts: []
## sidecarContainers for the Chartmuseum
# Can be used to add a proxy to the pod that does
# scanning for secrets, signing, authentication, validation
# of the chart's content, send notifications...
sidecarContainers: {}
## Example sidecarContainer which uses an extraVolume from above and
## a named port that can be referenced in the service as targetPort.
# proxy:
# image: nginx:latest
# ports:
# - name: proxy
# containerPort: 8081
# volumeMounts:
# - name: nginx-config
# readOnly: true
# mountPath: /etc/nginx

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

0 comments on commit 0d01731

Please sign in to comment.