Skip to content

Commit

Permalink
chore: create azure.json via CSE (Azure#3876)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored and penggu committed Oct 28, 2020
1 parent 2555332 commit 723e5e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions parts/k8s/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ configureK8s() {
generateAggregatedAPICerts
fi
else
{{- /* If we are a node vm then we only proceed w/ local azure.json configuration if cloud-init has pre-paved that file */}}
wait_for_file 1 1 $azure_json || return
{{- /* If we are a node that does not need azure.json (cloud-init tells us), then return immediately */}}
wait_for_file 1 1 /opt/azure/needs_azure.json || return
fi

touch $azure_json
chmod 0600 $azure_json
chown root:root $azure_json
{{/* Perform the required JSON escaping */}}
local sp_secret=${SERVICE_PRINCIPAL_CLIENT_SECRET//\\/\\\\}
sp_secret=${SERVICE_PRINCIPAL_CLIENT_SECRET//\"/\\\"}
Expand Down
4 changes: 2 additions & 2 deletions parts/k8s/cloud-init/nodecustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

write_files:
{{- if .RequiresCloudproviderConfig}}
- path: /etc/kubernetes/azure.json
permissions: "0600"
- path: /opt/azure/needs_azure.json
permissions: "0644"
owner: root
content: |
#EOF
Expand Down
11 changes: 7 additions & 4 deletions pkg/engine/templates_generated.go

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

0 comments on commit 723e5e6

Please sign in to comment.