Name: machine-controller
Owner: Rancher
Description: Docker Machine Controller
Created: 2017-12-12 23:15:15.0
Updated: 2018-01-26 16:18:57.0
Pushed: 2018-01-26 05:03:34.0
Homepage: null
Size: 3985
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Machine-Controller uses docker-machine and k8s CRD to provision machine on the cloud
make
https://docs.docker.com/machine/install-machine/
kubectl create -f example/machine-crd.yml
./bin/machine-controller --config ~/.kube/config
kubectl create -f example/digitalocean-example.yml
kubectl create -f example/amazonec2-example.yml
Each machine driver has its own driver options. We get these driver options and upload them to a schema CRD. Then later we can generate go type files base on these schemas.
kubectl create -f example/schema-crd.yml
kubectl create -f example/machine-driver-crd.yml
kubectl create -f example/amazonec2-machine-driver.yml
kubectl create -f example/digitalocean-machine-driver.yml
bectl get machinedrivers 1 BR master
KIND
onec2 MachineDriver.v3.management.cattle.io
talocean MachineDriver.v3.management.cattle.io
Once the machine driver is created, a schema will be created automatically.
bectl get dynamicschema BR master
KIND
onec2config DynamicSchema.v3.management.cattle.io
taloceanconfig DynamicSchema.v3.management.cattle.io
go generate
age generator
Amazonec2Config struct {
AccessKey string `json:"accessKey,omitempty"`
Ami string `json:"ami,omitempty"`
BlockDurationMinutes string `json:"blockDurationMinutes,omitempty"`
DeviceName string `json:"deviceName,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
IamInstanceProfile string `json:"iamInstanceProfile,omitempty"`
InsecureTransport bool `json:"insecureTransport,omitempty"`
InstanceType string `json:"instanceType,omitempty"`
KeypairName string `json:"keypairName,omitempty"`
Monitoring bool `json:"monitoring,omitempty"`
OpenPort []string `json:"openPort,omitempty"`
PrivateAddressOnly bool `json:"privateAddressOnly,omitempty"`
Region string `json:"region,omitempty"`
RequestSpotInstance bool `json:"requestSpotInstance,omitempty"`
Retries string `json:"retries,omitempty"`
RootSize string `json:"rootSize,omitempty"`
SecretKey string `json:"secretKey,omitempty"`
SecurityGroup []string `json:"securityGroup,omitempty"`
SessionToken string `json:"sessionToken,omitempty"`
SpotPrice string `json:"spotPrice,omitempty"`
SshKeypath string `json:"sshKeypath,omitempty"`
SshUser string `json:"sshUser,omitempty"`
SubnetId string `json:"subnetId,omitempty"`
Tags string `json:"tags,omitempty"`
UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty"`
UsePrivateAddress bool `json:"usePrivateAddress,omitempty"`
Userdata string `json:"userdata,omitempty"`
VolumeType string `json:"volumeType,omitempty"`
VpcId string `json:"vpcId,omitempty"`
Zone string `json:"zone,omitempty"`
./bin/machine-controller
Copyright (c) 2014-2017 Rancher Labs, Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.