mirror of https://github.com/kubernetes/kops.git
upup: use protokube
This wires up protokube, replacing a lot of the nodeup functionality. The option of not using protokube is retained, via the _not_protokube tag.
This commit is contained in:
parent
5e4013077a
commit
8a53149eef
|
|
@ -108,6 +108,8 @@ func (c *CreateClusterCmd) LoadConfig(configFile string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CreateClusterCmd) Run() error {
|
func (c *CreateClusterCmd) Run() error {
|
||||||
|
useProtokube := true
|
||||||
|
|
||||||
if c.StateDir == "" {
|
if c.StateDir == "" {
|
||||||
return fmt.Errorf("state dir is required")
|
return fmt.Errorf("state dir is required")
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +148,12 @@ func (c *CreateClusterCmd) Run() error {
|
||||||
c.Config.NodeUp.Location = location
|
c.Config.NodeUp.Location = location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if useProtokube {
|
||||||
|
location := "https://kubeupv2.s3.amazonaws.com/protokube/protokube.tar.gz"
|
||||||
|
glog.Infof("Using default protokube location: %q", location)
|
||||||
|
c.Config.Assets = append(c.Config.Assets, location)
|
||||||
|
}
|
||||||
|
|
||||||
var cloud fi.Cloud
|
var cloud fi.Cloud
|
||||||
|
|
||||||
var project string
|
var project string
|
||||||
|
|
@ -155,6 +163,14 @@ func (c *CreateClusterCmd) Run() error {
|
||||||
|
|
||||||
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_jessie", "_debian_family", "_systemd")
|
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_jessie", "_debian_family", "_systemd")
|
||||||
|
|
||||||
|
if useProtokube {
|
||||||
|
tags["_protokube"] = struct{}{}
|
||||||
|
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_protokube")
|
||||||
|
} else {
|
||||||
|
tags["_not_protokube"] = struct{}{}
|
||||||
|
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_not_protokube")
|
||||||
|
}
|
||||||
|
|
||||||
l.AddTypes(map[string]interface{}{
|
l.AddTypes(map[string]interface{}{
|
||||||
"keypair": &fitasks.Keypair{},
|
"keypair": &fitasks.Keypair{},
|
||||||
})
|
})
|
||||||
|
|
@ -204,26 +220,31 @@ func (c *CreateClusterCmd) Run() error {
|
||||||
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_aws")
|
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_aws")
|
||||||
|
|
||||||
l.AddTypes(map[string]interface{}{
|
l.AddTypes(map[string]interface{}{
|
||||||
"dhcpOptions": &awstasks.DHCPOptions{},
|
// EC2
|
||||||
"elasticIP": &awstasks.ElasticIP{},
|
"elasticIP": &awstasks.ElasticIP{},
|
||||||
"iamInstanceProfile": &awstasks.IAMInstanceProfile{},
|
|
||||||
"iamInstanceProfileRole": &awstasks.IAMInstanceProfileRole{},
|
|
||||||
"iamRole": &awstasks.IAMRole{},
|
|
||||||
"iamRolePolicy": &awstasks.IAMRolePolicy{},
|
|
||||||
"instance": &awstasks.Instance{},
|
"instance": &awstasks.Instance{},
|
||||||
"instanceElasticIPAttachment": &awstasks.InstanceElasticIPAttachment{},
|
"instanceElasticIPAttachment": &awstasks.InstanceElasticIPAttachment{},
|
||||||
"instanceVolumeAttachment": &awstasks.InstanceVolumeAttachment{},
|
"instanceVolumeAttachment": &awstasks.InstanceVolumeAttachment{},
|
||||||
"internetGateway": &awstasks.InternetGateway{},
|
|
||||||
"internetGatewayAttachment": &awstasks.InternetGatewayAttachment{},
|
|
||||||
"ebsVolume": &awstasks.EBSVolume{},
|
"ebsVolume": &awstasks.EBSVolume{},
|
||||||
"route": &awstasks.Route{},
|
|
||||||
"routeTable": &awstasks.RouteTable{},
|
|
||||||
"routeTableAssociation": &awstasks.RouteTableAssociation{},
|
|
||||||
"securityGroup": &awstasks.SecurityGroup{},
|
|
||||||
"securityGroupIngress": &awstasks.SecurityGroupIngress{},
|
|
||||||
"sshKey": &awstasks.SSHKey{},
|
"sshKey": &awstasks.SSHKey{},
|
||||||
"subnet": &awstasks.Subnet{},
|
|
||||||
"vpc": &awstasks.VPC{},
|
// IAM
|
||||||
|
"iamInstanceProfile": &awstasks.IAMInstanceProfile{},
|
||||||
|
"iamInstanceProfileRole": &awstasks.IAMInstanceProfileRole{},
|
||||||
|
"iamRole": &awstasks.IAMRole{},
|
||||||
|
"iamRolePolicy": &awstasks.IAMRolePolicy{},
|
||||||
|
|
||||||
|
// VPC / Networking
|
||||||
|
"dhcpOptions": &awstasks.DHCPOptions{},
|
||||||
|
"internetGateway": &awstasks.InternetGateway{},
|
||||||
|
"internetGatewayAttachment": &awstasks.InternetGatewayAttachment{},
|
||||||
|
"route": &awstasks.Route{},
|
||||||
|
"routeTable": &awstasks.RouteTable{},
|
||||||
|
"routeTableAssociation": &awstasks.RouteTableAssociation{},
|
||||||
|
"securityGroup": &awstasks.SecurityGroup{},
|
||||||
|
"securityGroupIngress": &awstasks.SecurityGroupIngress{},
|
||||||
|
"subnet": &awstasks.Subnet{},
|
||||||
|
"vpc": &awstasks.VPC{},
|
||||||
"vpcDHDCPOptionsAssociation": &awstasks.VPCDHCPOptionsAssociation{},
|
"vpcDHDCPOptionsAssociation": &awstasks.VPCDHCPOptionsAssociation{},
|
||||||
|
|
||||||
// ELB
|
// ELB
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@ func main() {
|
||||||
target := "direct"
|
target := "direct"
|
||||||
flag.StringVar(&target, "target", target, "Target - direct, cloudinit")
|
flag.StringVar(&target, "target", target, "Target - direct, cloudinit")
|
||||||
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
if dryrun {
|
if dryrun {
|
||||||
target = "dryrun"
|
target = "dryrun"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
/srv/kubernetes - secrets
|
||||||
|
|
||||||
|
/srv/sshproxy - not used in "normal" environments? Contains SSH keypairs for tunnelling. Secrets, really.
|
||||||
|
|
||||||
|
/var/etcd - the etcd data volume. This should be a direct EBS volume
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Needed to add empty directory to git
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Needed to add empty directory to git
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Needed to add empty directory to git
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{{ if HasTag "_kubernetes_master" }}
|
{{ if HasTag "_kubernetes_master" }}
|
||||||
DAEMON_ARGS="--master=true"
|
DAEMON_ARGS="--master=true --containerized --v=8"
|
||||||
{{ else }}
|
{{ else }}
|
||||||
DAEMON_ARGS="--master=false"
|
DAEMON_ARGS="--master=false --containerized --v=8"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubernetes Protokube Service
|
Description=Kubernetes Protokube Service
|
||||||
Documentation=https://github.com/kubernetes/kube-deploy/protokube
|
Documentation=https://github.com/kubernetes/kube-deploy/protokube
|
||||||
|
After=docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/etc/sysconfig/protokube
|
EnvironmentFile=/etc/sysconfig/protokube
|
||||||
ExecStart=/usr/local/bin/protokube "$DAEMON_ARGS"
|
ExecStartPre=/usr/bin/docker pull kope/protokube
|
||||||
|
ExecStart=/usr/bin/docker run -v /:/rootfs/ --privileged kope/protokube /usr/bin/protokube "$DAEMON_ARGS"
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=2s
|
RestartSec=2s
|
||||||
StartLimitInterval=0
|
StartLimitInterval=0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue