Skip to content

Commit

Permalink
Rename CNI to cni
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasGees committed Dec 26, 2019
1 parent 5fea475 commit 9df6417
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/cluster_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func getCommonPhaseDependencies(steps int, cmd *cobra.Command, args []string) (c
cluster.HaEnabled,
cluster.IsolatedEtcd,
cluster.CloudInitFile,
cluster.CNI,
cluster.Cni,
)

return provider, clusterManager, coordinator
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_phase_install_masters.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var installMastersPhaseCommand = &cobra.Command{
cluster.HaEnabled,
cluster.IsolatedEtcd,
cluster.CloudInitFile,
cluster.CNI,
cluster.Cni,
)
phase := phases.NewInstallMastersPhase(clusterManager, phaseOptions)

Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_phase_install_workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var installWorkersCommand = &cobra.Command{
cluster.HaEnabled,
cluster.IsolatedEtcd,
cluster.CloudInitFile,
cluster.CNI,
cluster.Cni,
)
phase := phases2.NewInstallWorkersPhase(clusterManager)

Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_phase_setup_ha.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var setupHAPhaseCommand = &cobra.Command{
cluster.HaEnabled,
cluster.IsolatedEtcd,
cluster.CloudInitFile,
cluster.CNI,
cluster.Cni,
)

phase := phases.NewSetupHighAvailabilityPhase(clusterManager)
Expand Down
10 changes: 5 additions & 5 deletions pkg/clustermanager/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Manager struct {
nodes []Node
clusterName string
cloudInitFile string
CNI string
cni string
eventService EventService
nodeCommunicator NodeCommunicator
clusterProvider ClusterProvider
Expand Down Expand Up @@ -46,7 +46,7 @@ func NewClusterManager(provider ClusterProvider, nodeCommunicator NodeCommunicat
eventService: eventService,
nodeCommunicator: nodeCommunicator,
clusterProvider: provider,
CNI: cni,
cni: cni,
nodes: provider.GetAllNodes(),
}

Expand Down Expand Up @@ -76,7 +76,7 @@ func (manager *Manager) Cluster() Cluster {
IsolatedEtcd: manager.isolatedEtcd,
CloudInitFile: manager.cloudInitFile,
NodeCIDR: manager.clusterProvider.GetNodeCidr(),
CNI: manager.CNI,
Cni: manager.cni,
}
}

Expand Down Expand Up @@ -175,9 +175,9 @@ func (manager *Manager) InstallMasters(keepCerts KeepCerts) error {
{"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"},
}

if manager.CNI == "canal" {
if manager.cni == "canal" {
commands = append(commands, NodeCommand{"install canal", "kubectl apply -f https://docs.projectcalico.org/v3.10/manifests/canal.yaml"})
} else if manager.CNI == "calico" {
} else if manager.cni == "calico" {
// We had to change the Pod CIDR to match the one defined in the kubeadm config file
// We had to tweak MTU for our install with Wireguard and the overhead it needs. Calculation is 1500 (eth0) - 80 (wirguard) - 20 (Calico IPinIP)
commands = append(commands, NodeCommand{"install calico", "cd /tmp && curl https://docs.projectcalico.org/v3.11/manifests/calico.yaml -O && sed -i -e \"s?192.168.0.0/16?10.244.0.0/16?g\" calico.yaml && sed -i -e \"s?1440?1400?g\" calico.yaml && kubectl apply -f calico.yaml"})
Expand Down
2 changes: 1 addition & 1 deletion pkg/clustermanager/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Cluster struct {
IsolatedEtcd bool `json:"isolated_etcd"`
CloudInitFile string `json:"cloud_init_file"`
NodeCIDR string `json:"node_cidr"`
CNI string `json:"cni"`
Cni string `json:"cni"`
}

// NodeCommand is the structure used to define acommand to execute on a node
Expand Down

0 comments on commit 9df6417

Please sign in to comment.