Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype of named machines for vsphere #110

Merged
merged 2 commits into from
Apr 27, 2018

Conversation

karan
Copy link
Contributor

@karan karan commented Apr 26, 2018

Current implementation for vSphere is to let the customer specify the raw Terraform config (in Hashicorp Config Language) in the Machine spec yaml, in the providerConfig section. While this works, it does not make the spec maintainable (the user needs to encoded back and forth between the HCL and the string).

Effectively, we create some “standard”, templated VMs that represent the configuration of machines in HCL. The customer then only needs to reference one of those and provide variables to complete the VM config. The definition of the machines is configured using a ConfigMap.

General design

A file named vsphere_named_machines.yaml contains a map of machine name and the HCL config for that machine. This file is mounted in the master as a ConfigMap (similar to #104). The controller reads from this map and tries to find a machine by name referenced in machines.yaml.

I have tested this change in a vSphere lab.

@kubernetes/kube-deploy-reviewers

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 26, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: karan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2018
@karan karan changed the title [WIP] Prototype of named machines for vsphere Prototype of named machines for vsphere Apr 27, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 27, 2018
@karan
Copy link
Contributor Author

karan commented Apr 27, 2018

/assign @krousey

@@ -23,7 +23,7 @@ COPY . .
RUN CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api/cloud/terraform/cmd/terraform-machine-controller

# Final container
FROM alpine3.7
FROM golang:alpine3.7
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is golang needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As in the PR description: Side note: I'm using golang:alpine because when trying to use just alpine image, I get this error: pull access denied for alpine3.7, repository does not exist or may require 'docker login'.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. I think it's alpine:3.7. Sorry I didn't read the PR first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That worked. I fixed it. Thanks!

)

// Config Watch holds the path to the named machines yaml file.
// This is used during bootstrap when the apiserver does not yet exist.
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it also used in the machine controller to? If so, this is misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. It's a lie.

@@ -32,7 +32,7 @@ import (
"sigs.k8s.io/cluster-api/cloud/terraform/config"
)

var apiServerImage = "gcr.io/k8s-cluster-api/cluster-apiserver:0.0.1"
var apiServerImage = "gcr.io/k8s-cluster-api/cluster-apiserver:0.0.2"
var controllerManagerImage = "gcr.io/k8s-cluster-api/controller-manager:0.0.1"
var machineControllerImage = "gcr.io/karangoel-gke-1/terraform-machine-controller:0.0.1-dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you just overwriting this for now? Should we find it a more permanent place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. For now, until I have a better plan (WIP) I prefer to not host non-dev images.

@krousey
Copy link
Contributor

krousey commented Apr 27, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2018
@krousey
Copy link
Contributor

krousey commented Apr 27, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit 0154694 into kubernetes-sigs:master Apr 27, 2018
chuckha pushed a commit to chuckha/cluster-api that referenced this pull request Oct 2, 2019
…adm-yaml

chore: get kubeadm yaml rather than json
jayunit100 pushed a commit to jayunit100/cluster-api that referenced this pull request Jan 31, 2020
…esolution

Overload the VMTemplate parameter for search purposes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants