Skip to content

Commit

Permalink
fix(helm): Add encode function for secret in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoan Mallon Moure committed Dec 23, 2020
1 parent ef264ad commit 757b712
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ Below are examples of how to use the chart:
- Create [cronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) that executes each ten minutes check-christmas-lottery-numbers and necessary resources with sending notifications enabled:
```shell
helm upgrade --install check-christmas-lottery-numbers ./helm/check-christmas-lottery-numbers \
--set config.push_over_notification_token=$(echo -n "<PUSH_OVER_NOTIFICATION_TOKEN>" | base64 | tr -d "\n") \
--set config.push_over_notification_user=$(echo -n "<PUSH_OVER_NOTIFICATION_USER>" | base64 | tr -d "\n") \
--set config.push_over_notification_token=$$PUSH_OVER_NOTIFICATION_TOKEN \
--set config.push_over_notification_user=$PUSH_OVER_NOTIFICATION_USER \
--set-file numbers_to_check=<number_to_check_file_dir> \
-n <check-christmas-lottery-numbers-namespace-name>
```

- Create [cronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) that executes each ten minutes check-christmas-lottery-numbers and necessary resources with sending notifications enabled, also creates a [Secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) with dockerhub credentials to avoid problem with limit in pull requests:
```shell
helm upgrade --install check-christmas-lottery-numbers ./helm/check-christmas-lottery-numbers \
--set config.push_over_notification_token=$(echo -n "<PUSH_OVER_NOTIFICATION_TOKEN>" | base64 | tr -d "\n") \
--set config.push_over_notification_user=$(echo -n "<PUSH_OVER_NOTIFICATION_USER>" | base64 | tr -d "\n") \
--set config.push_over_notification_token=$PUSH_OVER_NOTIFICATION_TOKEN \
--set config.push_over_notification_user=$PUSH_OVER_NOTIFICATION_USER \
--set imageCredentials.url=https://index.docker.io/v1/ \
--set imageCredentials.username=<dockerhub_username> \
--set imageCredentials.password=<dockerhub_password> \
Expand Down
4 changes: 2 additions & 2 deletions helm/check-christmas-lottery-numbers/templates/secret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
labels:
{{- include "check-christmas-lottery-numbers.labels" . | nindent 4 }}
data:
PUSH_OVER_NOTIFICATION_TOKEN: {{ .Values.config.push_over_notification_token }}
PUSH_OVER_NOTIFICATION_USER: {{ .Values.config.push_over_notification_user }}
PUSH_OVER_NOTIFICATION_TOKEN: {{ .Values.config.push_over_notification_token | b64enc }}
PUSH_OVER_NOTIFICATION_USER: {{ .Values.config.push_over_notification_user | b64enc }}

0 comments on commit 757b712

Please sign in to comment.