Skip to content

Commit 729414f

Browse files
committed
Add kubectl-convert install info
Signed-off-by: bhumijgupta <[email protected]>
1 parent 0b3ee6b commit 729414f

File tree

3 files changed

+134
-3
lines changed

3 files changed

+134
-3
lines changed

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ For example, to download version {{< param "fullversion" >}} on Linux, type:
4141
```
4242
{{< /note >}}
4343

44-
1. Validate the binary (optional)
44+
Download kubectl-convert (optional)
45+
46+
```bash
47+
curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert
48+
```
49+
50+
1. Validate the kubectl binary (optional)
4551

4652
Download the kubectl checksum file:
4753

@@ -72,12 +78,49 @@ For example, to download version {{< param "fullversion" >}} on Linux, type:
7278
Download the same version of the binary and checksum.
7379
{{< /note >}}
7480

81+
1. Validate the kubectl-convert binary (optional)
82+
83+
Download the kubectl-convert checksum file:
84+
85+
```bash
86+
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
87+
```
88+
89+
Validate the kubectl-convert binary against the checksum file:
90+
91+
```bash
92+
echo "$(<kubectl-convert.sha256) kubectl-convert" | sha256sum --check
93+
```
94+
95+
If valid, the output is:
96+
97+
```console
98+
kubectl-convert: OK
99+
```
100+
101+
If the check fails, `sha256` exits with nonzero status and prints output similar to:
102+
103+
```bash
104+
kubectl-convert: FAILED
105+
sha256sum: WARNING: 1 computed checksum did NOT match
106+
```
107+
108+
{{< note >}}
109+
Download the same version of the binary and checksum.
110+
{{< /note >}}
111+
75112
1. Install kubectl
76113

77114
```bash
78115
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
79116
```
80117

118+
Install kubectl-convert (optional)
119+
120+
```bash
121+
sudo install -o root -g root -m 0755 kubectl-convert /usr/local/bin/kubectl-convert
122+
```
123+
81124
{{< note >}}
82125
If you do not have root access on the target system, you can still install kubectl to the `~/.local/bin` directory:
83126

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

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ The following methods exist for installing kubectl on macOS:
3636
{{< /tab >}}
3737
{{< /tabs >}}
3838

39+
Download kubectl-convert (optional)
40+
{{< tabs name="download_binary_macos" >}}
41+
{{< tab name="Intel" codelang="bash" >}}
42+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl-convert"
43+
{{< /tab >}}
44+
{{< tab name="Apple Silicon" codelang="bash" >}}
45+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl-convert"
46+
{{< /tab >}}
47+
{{< /tabs >}}
48+
3949
{{< note >}}
4050
To download a specific version, replace the `$(curl -L -s https://dl.k8s.io/release/stable.txt)` portion of the command with the specific version.
4151

@@ -53,7 +63,7 @@ The following methods exist for installing kubectl on macOS:
5363

5464
{{< /note >}}
5565

56-
1. Validate the binary (optional)
66+
1. Validate the kubectl binary (optional)
5767

5868
Download the kubectl checksum file:
5969

@@ -89,19 +99,68 @@ The following methods exist for installing kubectl on macOS:
8999
Download the same version of the binary and checksum.
90100
{{< /note >}}
91101

102+
1. Validate the kubectl-convert binary (optional)
103+
104+
Download the kubectl checksum file:
105+
106+
{{< tabs name="download_checksum_macos" >}}
107+
{{< tab name="Intel" codelang="bash" >}}
108+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl-convert.sha256"
109+
{{< /tab >}}
110+
{{< tab name="Apple Silicon" codelang="bash" >}}
111+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl-convert.sha256"
112+
{{< /tab >}}
113+
{{< /tabs >}}
114+
115+
Validate the kubectl binary against the checksum file:
116+
117+
```bash
118+
echo "$(<kubectl-convert.sha256) kubectl-convert" | shasum -a 256 --check
119+
```
120+
121+
If valid, the output is:
122+
123+
```console
124+
kubectl-convert: OK
125+
```
126+
127+
If the check fails, `shasum` exits with nonzero status and prints output similar to:
128+
129+
```bash
130+
kubectl-convert: FAILED
131+
shasum: WARNING: 1 computed checksum did NOT match
132+
```
133+
134+
{{< note >}}
135+
Download the same version of the binary and checksum.
136+
{{< /note >}}
137+
92138
1. Make the kubectl binary executable.
93139

94140
```bash
95141
chmod +x ./kubectl
96142
```
97143

144+
Make kubectl-convert binary executable (optional).
145+
146+
```bash
147+
chmod +x ./kubectl-convert
148+
```
149+
98150
1. Move the kubectl binary to a file location on your system `PATH`.
99151

100152
```bash
101153
sudo mv ./kubectl /usr/local/bin/kubectl
102154
sudo chown root: /usr/local/bin/kubectl
103155
```
104156

157+
Move the kubectl-convert binary to your system `PATH` (optional)
158+
159+
```bash
160+
sudo mv ./kubectl /usr/local/bin/kubectl-convert
161+
sudo chown root: /usr/local/bin/kubectl-convert
162+
```
163+
105164
{{< note >}}
106165
Make sure `/usr/local/bin` is in your PATH environment variable.
107166
{{< /note >}}

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ The following methods exist for installing kubectl on Windows:
3333
curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe
3434
```
3535

36+
Download kubectl-convert binary (optional)
37+
38+
```powershell
39+
curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe
40+
```
41+
3642
{{< note >}}
3743
To find out the latest stable version (for example, for scripting), take a look at [https://dl.k8s.io/release/stable.txt](https://dl.k8s.io/release/stable.txt).
3844
{{< /note >}}
3945

40-
1. Validate the binary (optional)
46+
1. Validate the kubectl binary (optional)
4147

4248
Download the kubectl checksum file:
4349

@@ -60,6 +66,29 @@ The following methods exist for installing kubectl on Windows:
6066
$($(CertUtil -hashfile .\kubectl.exe SHA256)[1] -replace " ", "") -eq $(type .\kubectl.exe.sha256)
6167
```
6268
69+
1. Validate the kubectl-convert binary (optional)
70+
71+
Download the kubectl-convert checksum file:
72+
73+
```powershell
74+
curl -LO https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256
75+
```
76+
77+
Validate the kubectl-convert binary against the checksum file:
78+
79+
- Using Command Prompt to manually compare `CertUtil`'s output to the checksum file downloaded:
80+
81+
```cmd
82+
CertUtil -hashfile kubectl-convert.exe SHA256
83+
type kubectl-convert.exe.sha256
84+
```
85+
86+
- Using PowerShell to automate the verification using the `-eq` operator to get a `True` or `False` result:
87+
88+
```powershell
89+
$($(CertUtil -hashfile .\kubectl-convert.exe SHA256)[1] -replace " ", "") -eq $(type .\kubectl-convert.exe.sha256)
90+
```
91+
6392
1. Add the binary in to your `PATH`.
6493
6594
1. Test to ensure the version of `kubectl` is the same as downloaded:

0 commit comments

Comments
 (0)