Skip to content

Commit

Permalink
Merge pull request #290 from xetys/update-1.16
Browse files Browse the repository at this point in the history
Update 1.16
  • Loading branch information
xetys authored Nov 9, 2019
2 parents d64c1da + 1f3fb5b commit da01164
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
23 changes: 21 additions & 2 deletions cmd/cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package cmd
import (
"errors"
"fmt"
phases "github.com/xetys/hetzner-kube/pkg/phases"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/xetys/hetzner-kube/pkg/phases"
"log"
"net"
"os"
Expand Down Expand Up @@ -270,5 +271,23 @@ func init() {
clusterCreateCmd.Flags().IntP("worker-count", "w", 1, "Number of worker nodes for the cluster")
clusterCreateCmd.Flags().StringP("cloud-init", "", "", "Cloud-init file for server preconfiguration")
clusterCreateCmd.Flags().StringP("node-cidr", "", "10.0.1.0/24", "the CIDR for the nodes wireguard IPs")
clusterCreateCmd.Flags().StringSlice("datacenters", []string{"fsn1-dc8", "nbg1-dc3", "hel1-dc2", "fsn1-dc14"}, "Can be used to filter datacenters by their name")

// get default datacenters
dcs := []string{}
if AppConf.CurrentContext != nil {
opts := hcloud.DatacenterListOpts{}
opts.PerPage = 50
datacenters, _, err := AppConf.Client.Datacenter.List(AppConf.Context, opts)
if err != nil {
fmt.Print(err)
}

for _, v := range datacenters {
dcs = append(dcs, v.Name)
}
} else {
dcs = []string{"nbg1-dc3", "hel1-dc2", "fsn1-dc14"}
}

clusterCreateCmd.Flags().StringSlice("datacenters", dcs, "Can be used to filter datacenters by their name")
}
3 changes: 1 addition & 2 deletions pkg/clustermanager/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ func (manager *Manager) InstallMasters(keepCerts KeepCerts) error {
commands := []NodeCommand{
{"kubeadm init", "kubectl version > /dev/null &> /dev/null || kubeadm init --ignore-preflight-errors=all --config /root/master-config.yaml"},
{"configure kubectl", "rm -rf $HOME/.kube && mkdir -p $HOME/.kube && cp -i /etc/kubernetes/admin.conf $HOME/.kube/config && chown $(id -u):$(id -g) $HOME/.kube/config"},
{"install canal (RBAC)", "kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/rbac.yaml"},
{"install canal", "kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/canal.yaml"},
{"install canal", "kubectl apply -f https://docs.projectcalico.org/v3.10/manifests/canal.yaml"},
}

// inject custom commands
Expand Down
2 changes: 1 addition & 1 deletion pkg/clustermanager/provision_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const maxErrors = 3

// K8sVersion is the version that will be used to install kubernetes
var K8sVersion = flag.String("k8s-version", "1.14.0-00", "The version of the k8s debian packages that will be used during provisioning")
var K8sVersion = flag.String("k8s-version", "1.16.2-00", "The version of the k8s debian packages that will be used during provisioning")

// NodeProvisioner provisions all basic packages to install docker, kubernetes and wireguard
type NodeProvisioner struct {
Expand Down

0 comments on commit da01164

Please sign in to comment.