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

Added Windows Custom Image. Only works in dcos, but can be added to k8s #2004

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

yakman2020
Copy link
Contributor

What this PR does / why we need it:
Allows the use of custom windows system disk images in the VLabs API deployments. This in turn allows us to use confidential daily build, or specially provisioned images. This is implemented completely for DC/OS. Someone in the k8s team will probably want to apply the changes the k8s parts.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

While this is implemented completely for DC/OS, it modifies the WindowsProfile so should be usable in any of the different code legs, such as k8s or docker swarm with fairly simple mods.

Release note:

@ghost ghost assigned yakman2020 Jan 5, 2018
@ghost ghost added the in progress label Jan 5, 2018
@yakman2020 yakman2020 force-pushed the brcampbe-customwinimage branch from 59c9a87 to 9536865 Compare January 5, 2018 18:15
@@ -52,6 +52,13 @@
},
"type": "string"
},
"{{.Name}}WindowsImageSourceUrl": {
"defaultValue": "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference the assigned value. Looks at examples from Subnet or VMSize

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

},
"agentWindowsSourceUrl": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from WindowsImageSourceUrl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, it isn't except its in variables() rather than parameters().

AdminUsername string `json:"adminUsername"`
AdminPassword string `json:"adminPassword"`
ImageVersion string `json:"imageVersion"`
WindowsImageSourceURL string `json:"windowsImageSourceURL"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend apply to whole cluster (all agent pools). or per agent pool, but not both. Which matches your scenario better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whole cluster. I beleive that is doing that. Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "whole cluster" is your scenario, I think you can completely remove the per node pool change you made in parts/agentparams.t.

Copy link
Contributor

@anhowe anhowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've recommended some changes. Since this is only DCOS, please add validation to fail if this options was specified for Kubernetes.

@jackfrancis
Copy link
Member

@yakman2020 this looks good to go except for the cruft in pkg/acsengine/json.go.

@jackfrancis
Copy link
Member

Also, to address @anhowe's comment, please add something like this to pkg/api/vlabs/validate.go under the func (a *Properties) Validate(isUpdate bool) error { function:

if a.OrchestratorProfile.OrchestratorType != DCOS {
	if a.WindowsProfile.HasCustomImage() {
		return fmt.Errorf("Windows custom image is only supported for DC/OS orchestrator type")
	}
}

@yakman2020 yakman2020 force-pushed the brcampbe-customwinimage branch 2 times, most recently from 2f784ed to ac82598 Compare January 9, 2018 20:09
@yakman2020
Copy link
Contributor Author

validation added.

@yakman2020 yakman2020 force-pushed the brcampbe-customwinimage branch from ac82598 to 946a91d Compare January 9, 2018 20:16
@yakman2020 yakman2020 force-pushed the brcampbe-customwinimage branch from 946a91d to aa2f90f Compare January 9, 2018 20:20
@yakman2020
Copy link
Contributor Author

@anhowe Added validation, removed per host custom image name.

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jackfrancis jackfrancis merged commit 1f8ee20 into master Jan 9, 2018
@ghost ghost removed the in progress label Jan 9, 2018
@jackfrancis jackfrancis deleted the brcampbe-customwinimage branch January 9, 2018 23:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants