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

Update 1.16 #290

Merged
merged 3 commits into from
Nov 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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