Skip to content

Commit

Permalink
chore(bors): merge pull request #505
Browse files Browse the repository at this point in the history
505: chore: mod path of image pull secret r=chriswldenyer a=chriswldenyer

<!

Co-authored-by: chriswldenyer <[email protected]>
  • Loading branch information
mayastor-bors and chriswldenyer committed Jun 4, 2024
2 parents 2ac8433 + 184448c commit ff5911e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Mayastor Helm chart for Kubernetes
```
- Create secret if downloading the container images from a private repo.
```sh
kubectl create secret docker-registry <same-as-base.imagePullSecrets.secrets> --docker-server="https://index.docker.io/v1/" --docker-username="<user-name>" --docker-password="<password>" --docker-email="<user-email>" -n <mayastor-namespace>
kubectl create secret docker-registry <same-as-image.pullSecrets[0]> --docker-server="https://index.docker.io/v1/" --docker-username="<user-name>" --docker-password="<password>" --docker-email="<user-email>" -n <mayastor-namespace>
```

### Installing the chart via the git repo
Expand Down Expand Up @@ -102,7 +102,6 @@ This removes all the Kubernetes components associated with the chart and deletes
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;tolerations | Set tolerations, overrides global | `[]` |
| base.&ZeroWidthSpace;cache_poll_period | Cache timeout for core agent & diskpool deployment | `"30s"` |
| base.&ZeroWidthSpace;default_req_timeout | Request timeout for rest & core agents | `"5s"` |
| base.&ZeroWidthSpace;imagePullSecrets.&ZeroWidthSpace;enabled | Enable imagePullSecrets for pulling our container images | `false` |
| base.&ZeroWidthSpace;logging.&ZeroWidthSpace;color | Enable ansi color code for Pod StdOut/StdErr | `true` |
| base.&ZeroWidthSpace;logging.&ZeroWidthSpace;format | Valid values for format are pretty, json and compact | `"pretty"` |
| base.&ZeroWidthSpace;logging.&ZeroWidthSpace;silenceLevel | Silence specific module components | `nil` |
Expand Down Expand Up @@ -149,6 +148,7 @@ This removes all the Kubernetes components associated with the chart and deletes
| etcd.&ZeroWidthSpace;removeMemberOnContainerTermination | Use a PreStop hook to remove the etcd members from the etcd cluster on container termination Ignored if lifecycleHooks is set or replicaCount=1 | `false` |
| etcd.&ZeroWidthSpace;replicaCount | Number of replicas of etcd | `3` |
| image.&ZeroWidthSpace;pullPolicy | ImagePullPolicy for our images | `"Always"` |
| image.&ZeroWidthSpace;pullSecrets | docker-secrets required to pull images if the container registry from image.registry is protected | `[]` |
| image.&ZeroWidthSpace;registry | Image registry to pull our product images | `"docker.io"` |
| image.&ZeroWidthSpace;repo | Image registry's namespace | `"openebs"` |
| image.&ZeroWidthSpace;tag | Release tag for our images | `"develop"` |
Expand Down
4 changes: 2 additions & 2 deletions chart/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
```
- Create secret if downloading the container images from a private repo.
```sh
kubectl create secret docker-registry <same-as-base.imagePullSecrets.secrets> --docker-server="https://index.docker.io/v1/" --docker-username="<user-name>" --docker-password="<password>" --docker-email="<user-email>" -n <mayastor-namespace>
kubectl create secret docker-registry <same-as-image.pullSecrets[0]> --docker-server="https://index.docker.io/v1/" --docker-username="<user-name>" --docker-password="<password>" --docker-email="<user-email>" -n <mayastor-namespace>
```

### Installing the chart via the git repo
Expand All @@ -42,7 +42,7 @@ $ helm install mymayastor mayastor/{{ template "chart.name" . }}
### Uninstall Helm Chart

```console
$ helm uninstall [RELEASE_NAME]
$ helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.
Expand Down
16 changes: 14 additions & 2 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,20 @@ Usage:
{{ include "base_pull_secrets" . }}
*/}}
{{- define "base_pull_secrets" -}}
{{- if .Values.base.imagePullSecrets.enabled }}
{{- include "render" (dict "value" .Values.base.imagePullSecrets.secrets "context" $) | nindent 8 }}
{{- if (not (empty .Values.image.pullSecrets)) }}
{{- range .Values.image.pullSecrets | uniq -}}
{{ nindent 8 "- name:" }} {{ . }}
{{- end }}
{{- else -}}
{{- if .Values.base.imagePullSecrets }}
{{- if .Values.base.imagePullSecrets.enabled }}
{{- if (empty .Values.base.imagePullSecrets.secrets) }}
{{ nindent 8 "- name: login" }}
{{- else -}}
{{- include "render" (dict "value" .Values.base.imagePullSecrets.secrets "context" $) | nindent 8 }}
{{- end}}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

Expand Down
10 changes: 3 additions & 7 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ image:
# -- ImagePullPolicy for our images
pullPolicy: Always

# -- docker-secrets required to pull images if the container registry from image.registry is protected
pullSecrets: []

# -- Node labels for pod assignment
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
# Note that if multi-arch images support 'kubernetes.io/arch: amd64'
Expand Down Expand Up @@ -87,13 +90,6 @@ base:
- name: etcd-probe
image: busybox:latest
command: ['sh', '-c', 'trap "exit 1" TERM; until nc -vzw 5 {{ .Release.Name }}-etcd {{.Values.etcd.service.port}}; do date; echo "Waiting for etcd..."; sleep 1; done;']
# docker-secrets required to pull images if the container registry from image.Registry is protected
imagePullSecrets:
# -- Enable imagePullSecrets for pulling our container images
enabled: false
# Name of the imagePullSecret in the installed namespace
secrets:
- name: login

metrics:
# -- Enable the metrics exporter
Expand Down

0 comments on commit ff5911e

Please sign in to comment.