-
Notifications
You must be signed in to change notification settings - Fork 560
auto-jumpbox provisioning for private clusters #2401
Conversation
pkg/acsengine/engine.go
Outdated
@@ -294,7 +294,7 @@ func GenerateKubeConfig(properties *api.Properties, location string) (string, er | |||
kubeconfig := string(b) | |||
// variable replacement | |||
kubeconfig = strings.Replace(kubeconfig, "{{WrapAsVerbatim \"variables('caCertificate')\"}}", base64.StdEncoding.EncodeToString([]byte(properties.CertificateProfile.CaCertificate)), -1) | |||
if properties.OrchestratorProfile.KubernetesConfig.EnablePrivateCluster { | |||
if *properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.Enabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want the *
reference here, if we want to have a simple boolean check (and if we know that properties.OrchestratorProfile.KubernetesConfig.PrivateCluster
is non-nil
), we can evaluate helpers.IsTrueBoolPointer(properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.Enabled)
as the if
condition.
return cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity | ||
}, | ||
"UseInstanceMetadata": func() bool { | ||
return helpers.IsTrueBoolPointer(cs.Properties.OrchestratorProfile.KubernetesConfig.UseInstanceMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackfrancis is there any reason why this wasn't being done before that I'm not aware of? I also set a default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change. 👍
@@ -93,6 +93,8 @@ const ( | |||
DefaultReschedulerAddonEnabled = false | |||
// DefaultRBACEnabled determines the acs-engine provided default for enabling kubernetes RBAC | |||
DefaultRBACEnabled = true | |||
// DefaultUseInstanceMetadata determines the acs-engine provided default for enabling Azure cloudprovider instance metadata service | |||
DefaultUseInstanceMetadata = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default value for UseInstanceMetadata is true
pkg/acsengine/defaults.go
Outdated
@@ -443,6 +463,10 @@ func setOrchestratorDefaults(cs *api.ContainerService) { | |||
a.OrchestratorProfile.KubernetesConfig.EnableSecureKubelet = pointerToBool(api.DefaultSecureKubeletEnabled) | |||
} | |||
|
|||
if a.OrchestratorProfile.KubernetesConfig.UseInstanceMetadata == nil { | |||
a.OrchestratorProfile.KubernetesConfig.EnableSecureKubelet = pointerToBool(api.DefaultUseInstanceMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting default for UseInstanceMetadata here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
return cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity | ||
}, | ||
"UseInstanceMetadata": func() bool { | ||
return helpers.IsTrueBoolPointer(cs.Properties.OrchestratorProfile.KubernetesConfig.UseInstanceMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change. 👍
* add provision jumpbox flag * add jp to resources * fix osDisk resource * Add jumpbox parameters * fix broken link in docs * fix nil reference error for agent pool only * rename inconsistent params * handle nil jumpbox profile * Add support for storage account and managed disks * docs * update example files * missing } * fix typo in docs * use isTrueBoolPointer * keep instance metadata default * fix typo * check for nil private cluster
This reverts commit b0f5e38.
What this PR does / why we need it: adds option to provision a jumpbox when enabling the private cluster. Some redesign of the private cluster config object.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #221Special notes for your reviewer:
Release note: