mirror of https://github.com/fluxcd/flux2.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
883 B
YAML
31 lines
883 B
YAML
4 years ago
|
---
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: credentials-sync
|
||
|
namespace: flux-system
|
||
|
spec:
|
||
|
template:
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: sync
|
||
|
image: mcr.microsoft.com/azure-cli
|
||
|
env:
|
||
|
- name: RECONCILE_SH
|
||
|
value: |-
|
||
|
reconcile() {
|
||
|
echo "Starting ACR token sync -- $(date)"
|
||
|
echo "Logging into Azure"
|
||
|
az login --identity
|
||
|
echo "Logging into ACR: ${ACR_NAME}"
|
||
|
output="$(az acr login --expose-token -o=tsv -n "${ACR_NAME}")"
|
||
|
read token server <<< "${output}"
|
||
|
user="00000000-0000-0000-0000-000000000000"
|
||
|
|
||
|
echo "Creating secret: ${KUBE_SECRET}"
|
||
|
apply-secret "${KUBE_SECRET}" "${token}" "${user}" "${server}"
|
||
|
|
||
|
echo "Finished ECR token sync -- $(date)"
|
||
|
echo
|
||
|
}
|