Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
chore: use local kubeconfig if no outbound (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored Jun 4, 2020
1 parent dcc73fb commit f167e41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion parts/k8s/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ createKubeManifestDir() {
writeKubeConfig() {
local DIR=/home/$ADMINUSER/.kube
local FILE=$DIR/config
{{- if HasBlockOutboundInternet}}
local SERVER=https://localhost
{{else}}
local SERVER=$KUBECONFIG_SERVER
{{- end}}
mkdir -p $DIR
touch $FILE
chown $ADMINUSER:$ADMINUSER $DIR $FILE
Expand All @@ -481,7 +486,7 @@ apiVersion: v1
clusters:
- cluster:
certificate-authority-data: \"$CA_CERTIFICATE\"
server: $KUBECONFIG_SERVER
server: $SERVER
name: \"$MASTER_FQDN\"
contexts:
- context:
Expand Down
3 changes: 3 additions & 0 deletions pkg/engine/template_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
"HasTelemetryEnabled": func() bool {
return cs.Properties.FeatureFlags != nil && cs.Properties.FeatureFlags.EnableTelemetry
},
"HasBlockOutboundInternet": func() bool {
return cs.Properties.FeatureFlags != nil && cs.Properties.FeatureFlags.BlockOutboundInternet
},
"GetCSEErrorCode": func(errorType string) int {
return GetCSEErrorCode(errorType)
},
Expand Down
7 changes: 6 additions & 1 deletion 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 f167e41

Please sign in to comment.