mirror of https://github.com/kubernetes/kops.git
commit
901d6e8159
|
|
@ -108,6 +108,8 @@ func (c *CreateClusterCmd) LoadConfig(configFile string) error {
|
|||
}
|
||||
|
||||
func (c *CreateClusterCmd) Run() error {
|
||||
useProtokube := true
|
||||
|
||||
if c.StateDir == "" {
|
||||
return fmt.Errorf("state dir is required")
|
||||
}
|
||||
|
|
@ -146,6 +148,12 @@ func (c *CreateClusterCmd) Run() error {
|
|||
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 project string
|
||||
|
|
@ -155,6 +163,14 @@ func (c *CreateClusterCmd) Run() error {
|
|||
|
||||
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{}{
|
||||
"keypair": &fitasks.Keypair{},
|
||||
})
|
||||
|
|
@ -204,26 +220,31 @@ func (c *CreateClusterCmd) Run() error {
|
|||
c.Config.NodeUpTags = append(c.Config.NodeUpTags, "_aws")
|
||||
|
||||
l.AddTypes(map[string]interface{}{
|
||||
"dhcpOptions": &awstasks.DHCPOptions{},
|
||||
// EC2
|
||||
"elasticIP": &awstasks.ElasticIP{},
|
||||
"iamInstanceProfile": &awstasks.IAMInstanceProfile{},
|
||||
"iamInstanceProfileRole": &awstasks.IAMInstanceProfileRole{},
|
||||
"iamRole": &awstasks.IAMRole{},
|
||||
"iamRolePolicy": &awstasks.IAMRolePolicy{},
|
||||
"instance": &awstasks.Instance{},
|
||||
"instanceElasticIPAttachment": &awstasks.InstanceElasticIPAttachment{},
|
||||
"instanceVolumeAttachment": &awstasks.InstanceVolumeAttachment{},
|
||||
"internetGateway": &awstasks.InternetGateway{},
|
||||
"internetGatewayAttachment": &awstasks.InternetGatewayAttachment{},
|
||||
"ebsVolume": &awstasks.EBSVolume{},
|
||||
"route": &awstasks.Route{},
|
||||
"routeTable": &awstasks.RouteTable{},
|
||||
"routeTableAssociation": &awstasks.RouteTableAssociation{},
|
||||
"securityGroup": &awstasks.SecurityGroup{},
|
||||
"securityGroupIngress": &awstasks.SecurityGroupIngress{},
|
||||
"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{},
|
||||
|
||||
// ELB
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ func main() {
|
|||
target := "direct"
|
||||
flag.StringVar(&target, "target", target, "Target - direct, cloudinit")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if 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" }}
|
||||
DAEMON_ARGS="--master=true"
|
||||
DAEMON_ARGS="--master=true --containerized --v=8"
|
||||
{{ else }}
|
||||
DAEMON_ARGS="--master=false"
|
||||
DAEMON_ARGS="--master=false --containerized --v=8"
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
[Unit]
|
||||
Description=Kubernetes Protokube Service
|
||||
Documentation=https://github.com/kubernetes/kube-deploy/protokube
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
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
|
||||
RestartSec=2s
|
||||
StartLimitInterval=0
|
||||
|
|
|
|||
Loading…
Reference in New Issue