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.
		
		
		
		
		
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			951 B
		
	
	
	
		
			YAML
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			951 B
		
	
	
	
		
			YAML
		
	
apiVersion: batch/v1beta1
 | 
						|
kind: CronJob
 | 
						|
metadata:
 | 
						|
  name: credentials-sync-eventhub
 | 
						|
  namespace: flux-system
 | 
						|
spec:
 | 
						|
  jobTemplate:
 | 
						|
    spec:
 | 
						|
      template:
 | 
						|
        spec:
 | 
						|
          containers:
 | 
						|
            - name: sync
 | 
						|
              image: mcr.microsoft.com/azure-cli
 | 
						|
              env:
 | 
						|
                - name: RECONCILE_SH
 | 
						|
                  value: |-
 | 
						|
                    reconcile() {
 | 
						|
                      echo "Starting JWT token sync -- $(date)"
 | 
						|
                      echo "Logging into Azure"
 | 
						|
                      az login --identity
 | 
						|
                      echo "Getting JWT token"
 | 
						|
                      token=$(az account get-access-token --resource https://eventhubs.azure.net |jq -r .accessToken)
 | 
						|
                      echo "Creating secret: ${KUBE_SECRET}"
 | 
						|
                      apply-secret "${KUBE_SECRET}" ${token} "${ADDRESS}"
 | 
						|
                      echo "Finished JWT token sync -- $(date)"
 | 
						|
                      echo
 | 
						|
                    }                    
 |