Skip to content

Commit 9267703

Browse files
rmahiquewindsonsea
andauthored
Added instructions for SUSE-based distributions (#42913)
* Update install-kubectl-linux.md Added instructions for SUSE based distributions * Update change-package-repository.md Added a section for openSUSE and SLES distributions * Update content/en/docs/tasks/tools/install-kubectl-linux.md Co-authored-by: Michael <[email protected]> * Update content/en/docs/tasks/tools/install-kubectl-linux.md Co-authored-by: Michael <[email protected]> * Update content/en/docs/tasks/tools/install-kubectl-linux.md Co-authored-by: Michael <[email protected]> --------- Co-authored-by: Michael <[email protected]>
1 parent 849d689 commit 9267703

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

content/en/docs/tasks/administer-cluster/kubeadm/change-package-repository.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,32 @@ exclude=kubelet kubeadm kubectl
6666
**You're using the Kubernetes package repositories and this guide applies to you.**
6767
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories.
6868

69+
{{% /tab %}}
70+
71+
{{% tab name="openSUSE or SLES" %}}
72+
73+
Print the contents of the file that defines the Kubernetes `zypper` repository:
74+
75+
```shell
76+
# On your system, this configuration file could have a different name
77+
cat /etc/zypp/repos.d/kubernetes.repo
78+
```
79+
80+
If you see a `baseurl` similar to the `baseurl` in the output below:
81+
82+
```
83+
[kubernetes]
84+
name=Kubernetes
85+
baseurl=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/
86+
enabled=1
87+
gpgcheck=1
88+
gpgkey=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/repodata/repomd.xml.key
89+
exclude=kubelet kubeadm kubectl
90+
```
91+
92+
**You're using the Kubernetes package repositories and this guide applies to you.**
93+
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories.
94+
6995
{{% /tab %}}
7096
{{< /tabs >}}
7197

content/en/docs/tasks/tools/install-kubectl-linux.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,36 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
192192
sudo yum install -y kubectl
193193
```
194194
195+
{{% /tab %}}
196+
197+
{{% tab name="SUSE-based distributions" %}}
198+
199+
1. Add the Kubernetes `zypper` repository. If you want to use Kubernetes version
200+
different than {{< param "version" >}}, replace {{< param "version" >}} with
201+
the desired minor version in the command below.
202+
203+
```bash
204+
# This overwrites any existing configuration in /etc/zypp/repos.d/kubernetes.repo
205+
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
206+
[kubernetes]
207+
name=Kubernetes
208+
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
209+
enabled=1
210+
gpgcheck=1
211+
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
212+
EOF
213+
214+
{{< note >}}
215+
To upgrade kubectl to another minor release, you'll need to bump the version in `/etc/zypp/repos.d/kubernetes.repo`
216+
before running `zypper update`. This procedure is described in more detail in
217+
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
218+
{{< /note >}}
219+
220+
1. Install kubectl using `zypper`:
221+
222+
```bash
223+
sudo zypper install -y kubectl
224+
195225
{{% /tab %}}
196226
{{< /tabs >}}
197227

0 commit comments

Comments
 (0)