Skip to content

Commit

Permalink
Fix calico-tigera installation problems
Browse files Browse the repository at this point in the history
Update network preinstall and provider target URLs
Use kubectl replace to avoid metadata length limitations
  • Loading branch information
jorhett committed Jun 8, 2023
1 parent 1da1b1e commit c2633ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The above parameters are:
* `VERSION`: The version of Kubernetes to deploy. Must follow X.Y.Z format. ([Check kubeadm regex rule](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version.go#L43) for more information)
* `CONTAINER_RUNTIME`: The container runtime Kubernetes uses. Set this value to `docker` (officially supported) or `cri_containerd`. Advanced Kubernetes users can use `cri_containerd`, however this requires an increased understanding of Kubernetes, specifically when running applications in a HA cluster. To run a HA cluster and access your applications, an external load balancer is required in front of your cluster. Setting this up is beyond the scope of this module. For more information, see the Kubernetes [documentation](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/).
* `CNI_PROVIDER`: The CNI network to install. Set this value to `weave`, `flannel`, `calico` or `cilium`.
* `CNI_PROVIDER_VERSION` The CNI version to use. `calico` and `cilium` uses this variable to reference the correct deployment file. Current version `cilium` is `1.4.3`, calico is `3.18`
* `CNI_PROVIDER_VERSION` The CNI version to use. `calico`, `calico-tigera`, and `cilium` providers use this variable to reference the correct deployment file. Current version `cilium` is `1.4.3`, calico is `3.18`, calico-tigera is `3.26.0`
* `ETCD_INITIAL_CLUSTER`: The server hostnames and IPs in the form of `hostname:ip`. When in production, include three, five, or seven nodes for etcd.
* `ETCD_IP`: The IP each etcd member listens on. We recommend passing the fact for the interface to be used by the cluster.
* `KUBE_API_ADVERTISE_ADDRESS`: The IP each etcd/apiserver instance uses on each controller. We recommend passing the fact for the interface to be used by the cluster.
Expand Down
2 changes: 1 addition & 1 deletion manifests/kube_addons.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
if $cni_provider == 'calico-tigera' {
if $cni_network_preinstall {
exec { 'Install cni network (preinstall)':
command => ['kubectl', 'apply', '-f', $cni_network_preinstall],
command => ['kubectl', 'replace', '-f', $cni_network_preinstall],
onlyif => $exec_onlyif,
unless => 'kubectl -n tigera-operator get deployments | egrep "^tigera-operator"',
environment => $env,
Expand Down
2 changes: 1 addition & 1 deletion tooling/kube_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.parse_args
o.string '-v', '--version', 'The Kubernetes version to install', default: ENV.fetch('VERSION', nil)
o.string '-r', '--container_runtime', 'The container runtime to use. This can only be "docker" or "cri_containerd"', default: ENV.fetch('CONTAINER_RUNTIME', nil)
o.string '-c', '--cni_provider', 'The networking provider to use, flannel, weave, calico, calico-tigera or cilium are supported', default: ENV.fetch('CNI_PROVIDER', nil)
o.string '-p', '--cni_provider_version', 'The networking provider version to use, calico and cilium will use this to reference the correct deployment download link',
o.string '-p', '--cni_provider_version', 'The networking provider version to use, calico, calico-tigera, and cilium will use this to reference the correct deployment download link',
default: ENV.fetch('CNI_PROVIDER_VERSION', nil)
o.string '-t', '--etcd_ip', 'The IP address etcd will listen on', default: ENV.fetch('ETCD_IP', nil)
o.string '-i', '--etcd_initial_cluster', 'The list of servers in the etcd cluster', default: ENV.fetch('ETCD_INITIAL_CLUSTER', nil)
Expand Down
4 changes: 2 additions & 2 deletions tooling/kube_tool/other_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def self.create(opts)
cni_network_provider = "https://docs.projectcalico.org/archive/v#{opts[:cni_provider_version]}/manifests/calico.yaml"
cni_pod_cidr = '192.168.0.0/16'
when 'calico-tigera'
cni_network_preinstall = 'https://docs.projectcalico.org/manifests/tigera-operator.yaml'
cni_network_provider = 'https://docs.projectcalico.org/manifests/custom-resources.yaml'
cni_network_preinstall = "https://raw.githubusercontent.com/projectcalico/calico/v#{opts[:cni_provider_version]}/manifests/tigera-operator.yaml"
cni_network_provider = "https://raw.githubusercontent.com/projectcalico/calico/v#{opts[:cni_provider_version]}/manifests/custom-resources.yaml"
cni_pod_cidr = '192.168.0.0/16'
when 'cilium'
cni_pod_cidr = '10.244.0.0/16'
Expand Down

0 comments on commit c2633ef

Please sign in to comment.