Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #34 from mrostecki/remove-cilium
Browse files Browse the repository at this point in the history
Remove Cilium
  • Loading branch information
thkukuk authored Jun 30, 2021
2 parents 0f1c376 + cb5ca3b commit b2ce1e7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 43 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ In this case, kubicd will configure the haproxy and add or remove master nodes
depeding on the kubernetes cluster configuration automatically, if `haproxycfg`
is installed.

For cilium or flannel instead of weave you have to use `kubicctl init
--pod-network cilium` or `kubicctl init --pod-network flannel`.
For flannel instead of weave you have to use `kubicctl init --pod-network flannel`.

To deploy kubic without a CNI you have to use `kubicctl init
--pod-network none`
Expand Down Expand Up @@ -179,7 +178,7 @@ harddisk, install the new node and, if this new node is of type "master" or
* init - Initialize Kubernetes Master Node
* `--multi-master=<DNS name>` Setup HA masters, the argument must be the DNS name of the load balancer
* `--haproxy=<salt name>` Adjust haproxy configuration for multi-master setup via salt
* `--pod-network=<flannel|cilium>` Pod network
* `--pod-network=<flannel>` Pod network
* `--adv-addr=<IPaddr>` IP address the API Server will advertise on
* `--apiserver_cert_extra_sans=<IPaddr>` additional IPs to add to the APIserver certificate
* `--stage=<official|devel>` Specify to use the official images or from the devel project
Expand Down
12 changes: 0 additions & 12 deletions etc/kubicd/helm/cilium.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/kubeadm/destroyMaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func DestroyMaster(in *pb.Empty, stream pb.Kubeadm_DestroyMasterServer) error {
return err
}
}
tools.ExecuteCmd("/bin/sh", "-c", "ip link delete cni0; ip link delete flannel.1; ip link delete cilium_vxlan")
tools.ExecuteCmd("/bin/sh", "-c", "ip link delete cni0; ip link delete flannel.1")

return nil
}
27 changes: 2 additions & 25 deletions pkg/kubeadm/initMaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ import (
)

const (
cilium_chart = "/usr/share/k8s-helm/cilium/"
cilium_values = "/etc/kubicd/helm/cilium.yaml"
cilium_namespace = "kube-system"
flannel_yaml = "/usr/share/k8s-yaml/flannel/kube-flannel.yaml"
weave_yaml = "/usr/share/k8s-yaml/weave/weave.yaml"
kured_yaml = "/usr/share/k8s-yaml/kured/kured.yaml"
Expand Down Expand Up @@ -131,16 +128,8 @@ func InitMaster(in *pb.InitRequest, stream pb.Kubeadm_InitMasterServer) error {
}
return nil
}
} else if strings.EqualFold(arg_pod_network, "cilium") {
found, _ = exists(cilium_chart, "")
if found != true {
if err := stream.Send(&pb.StatusReply{Success: false, Message: "cilium-k8s-yaml is not installed!"}); err != nil {
return err
}
return nil
}
} else if !strings.EqualFold(arg_pod_network, "none") {
if err := stream.Send(&pb.StatusReply{Success: false, Message: "Unsupported pod network, please use 'cilium', 'flannel', 'weave' or 'none'"}); err != nil {
if err := stream.Send(&pb.StatusReply{Success: false, Message: "Unsupported pod network, please use 'flannel', 'weave' or 'none'"}); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -383,19 +372,7 @@ func InitMaster(in *pb.InitRequest, stream pb.Kubeadm_InitMasterServer) error {
}
return nil
}
} else if strings.EqualFold(arg_pod_network, "cilium") {
// Setting up cilium
if err := stream.Send(&pb.StatusReply{Success: true, Message: "Deploy cilium"}); err != nil {
return err
}
if err := deployment.DeployHelm(cilium_chart, "cilium", cilium_values, cilium_namespace); err != nil {
ResetMaster()
if err := stream.Send(&pb.StatusReply{Success: success, Message: err.Error()}); err != nil {
return err
}
return nil
}
} else if strings.EqualFold(arg_pod_network, "cilium") {
} else if strings.EqualFold(arg_pod_network, "none") {
if err := stream.Send(&pb.StatusReply{Success: true, Message: "No CNI will be deployed"}); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeadm/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func ResetNode(nodeName string, send OutputStream) (bool, string) {
"\"iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X\"")
tools.ExecuteCmd("salt", nodeName, "cmd.run", "\"rm -rf /var/lib/etcd/*\"")
tools.ExecuteCmd("salt", nodeName, "cmd.run", "\"rm -rf /var/lib/cni/*\"")
tools.ExecuteCmd("salt", nodeName, "cmd.run", "\"ip link delete cni0; ip link delete flannel.1; ip link delete cilium_vxlan\"")
tools.ExecuteCmd("salt", nodeName, "cmd.run", "\"ip link delete cni0; ip link delete flannel.1\"")
tools.ExecuteCmd("salt", nodeName, "service.disable", "kubelet")
tools.ExecuteCmd("salt", nodeName, "service.stop", "kubelet")
tools.ExecuteCmd("salt", nodeName, "service.disable", "crio")
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubicctl/initMaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func InitMasterCmd() *cobra.Command {
}

subCmd.PersistentFlags().StringVar(&multiMaster, "multi-master", multiMaster, "Setup multimaster cluster, argument needs to be the DNS name of the load balancer")
subCmd.PersistentFlags().StringVar(&podNetwork, "pod-network", podNetwork, "pod network, valid values are 'cilium', 'flannel', 'weave' or 'none'")
subCmd.PersistentFlags().StringVar(&podNetwork, "pod-network", podNetwork, "pod network, valid values are 'flannel', 'weave' or 'none'")
subCmd.PersistentFlags().StringVar(&adv_addr, "adv-addr", adv_addr, "IP address the API Server will advertise it's listening on")
subCmd.PersistentFlags().StringVar(&apiserver_cert_extra_sans, "apiserver-cert-extra-sans", apiserver_cert_extra_sans, "additional IPs to add to the APIserver certificate")
subCmd.PersistentFlags().StringVar(&kubernetesVersion, "kubernetes-version", kubernetesVersion, "Kubernetes version of the control plane to deploy")
Expand Down

0 comments on commit b2ce1e7

Please sign in to comment.