Skip to content

Commit

Permalink
Add image.credentials and nginx.image.credentials to baza Helm …
Browse files Browse the repository at this point in the history
…chart values (#21)

Co-authored-by: Kai Ren <tyranron@gmail.com>
  • Loading branch information
xDarksome and tyranron authored Aug 24, 2022
1 parent b2f1660 commit cb0eafd
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ All user visible changes to this project will be documented in this file. This p
[#2]: /../../pull/2
[#3]: /../../pull/3
[#17]: /../../pull/17
[#21]: /../../pull/21



Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions helm/baza/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All user visible changes to this project will be documented in this file. This p



## [0.2.0] · 2022-08-24
[0.2.0]: https://github.com/instrumentisto/baza/tree/helm%2Fbaza%2F0.2.0/helm/baza

### Added

- `image.credentials` and `nginx.image.credentials` values. ([#21])

[#21]: https://github.com/instrumentisto/baza/pull/21




## [0.1.1] · 2022-08-23
[0.1.1]: https://github.com/instrumentisto/baza/tree/helm%2Fbaza%2F0.1.1/helm/baza

Expand Down
2 changes: 1 addition & 1 deletion helm/baza/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: baza
description: Simply scalable files storage without much fuss.
version: 0.1.1
version: 0.2.0
appVersion: "0.2"
type: application
sources:
Expand Down
26 changes: 26 additions & 0 deletions helm/baza/templates/secret.registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- $creds := dict }}
{{- if .Values.image.credentials }}
{{- $_ := set $creds "baza" .Values.image.credentials }}
{{- end }}
{{- if and .Values.nginx.enabled .Values.nginx.image.credentials }}
{{- $_ := set $creds "nginx" .Values.nginx.image.credentials }}
{{- end }}
{{- range $name, $cred := $creds }}
---
kind: Secret
apiVersion: v1
metadata:
name: {{ printf "%s.%s.registry" (include "baza.fullname" $) $name | quote }}
namespace: {{ $.Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "backend.chart" $ | quote }}
app.kubernetes.io/name: {{ include "baza.name" $ | quote }}
app.kubernetes.io/instance: {{ $.Release.Name | quote }}
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }}
{{- with $.Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ printf `{"auths":{%s:{"auth":"%s"}}}` ($cred.registry | quote) (printf "%s:%s" $cred.username $cred.password | b64enc) | b64enc | quote }}
{{- end }}
9 changes: 9 additions & 0 deletions helm/baza/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ spec:
{{- end }}
{{- with .Values.statefulset.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.image.credentials (and .Values.nginx.enabled .Values.nginx.image.credentials) }}
imagePullSecrets:
{{- if .Values.image.credentials }}
- name: {{ printf "%s.baza.registry" (include "baza.fullname" .) | quote }}
{{- end }}
{{- if and .Values.nginx.enabled .Values.nginx.image.credentials }}
- name: {{ printf "%s.nginx.registry" (include "baza.fullname" .) | quote }}
{{- end }}
{{- end }}
containers:
- name: baza
Expand Down
8 changes: 8 additions & 0 deletions helm/baza/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ image:
repository: ghcr.io/instrumentisto/baza
tag: 0.2
pullPolicy: IfNotPresent
credentials: {}
#registry: ghcr.io
#username: changeme
#password: changeme

# Additional labels to apply to all Kubernetes resources created by this chart.
labels: {}
Expand Down Expand Up @@ -119,6 +123,10 @@ nginx:
repository: docker.io/nginx
tag: stable-alpine
pullPolicy: IfNotPresent
credentials: {}
#registry: docker.io
#username: changeme
#password: changeme

port: 8080

Expand Down

0 comments on commit cb0eafd

Please sign in to comment.