Skip to content

Commit

Permalink
ibmcloud: replace k8s source list
Browse files Browse the repository at this point in the history
use k8s owned apt repo
add kube_version variable

Signed-off-by: Yan Song Liu <lysliu@cn.ibm.com>
  • Loading branch information
lysliu authored and Qi Feng Huo committed Mar 8, 2024
1 parent 06fc733 commit d0566d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions ibmcloud/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ twice under different SSHs key names. This key needs to be password-less and on
plane node and the rest will be worker nodes. If not set it defaults to `2`.
> - `containerd_version` (optional) is the version of containerd installed on the Kubernetes nodes. If not set it
defaults to `1.7.0-beta.3`.
> - `kube_version` (optional) is the version of kubeadmin and cluster. If not set it defaults to `1.28`.
<!-- TODO #570 once we've fixed pre-install of containerd note that this might be overriden?-->
> **Hint:** In order to create a cluster based on a different type of VSI image you can use the `instance_profile_name`
Expand Down
4 changes: 2 additions & 2 deletions ibmcloud/cluster/ansible/tasks/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
---
- name: "Add gpg key "
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
url: https://pkgs.k8s.io/core:/stable:/v{{ kube_version }}/deb/Release.key
state: present

- name: "Add kubernetes source list "
apt_repository:
repo: "deb http://packages.cloud.google.com/apt/ kubernetes-xenial main"
repo: "deb https://pkgs.k8s.io/core:/stable:/v{{ kube_version }}/deb/ /"
state: present
filename: "kubernetes"

Expand Down
2 changes: 1 addition & 1 deletion ibmcloud/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ resource "null_resource" "ansible" {
}
provisioner "local-exec" {
working_dir = "./ansible"
command = "ansible-playbook -i inventory -u root containerd.yaml -e containerd_release_version=${var.containerd_version}"
command = "ansible-playbook -i inventory -u root containerd.yaml -e containerd_release_version=${var.containerd_version} -e kube_version=${var.kube_version}"
}
}

Expand Down
4 changes: 4 additions & 0 deletions ibmcloud/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ variable "zone" {
variable "containerd_version" {
default = "1.7.0-beta.3"
}

variable "kube_version" {
default = "1.28"
}

0 comments on commit d0566d2

Please sign in to comment.