Skip to content

Commit 68f4bef

Browse files
committed
krew: Rename kubectl-az to kubectl-aks
1 parent f73caa5 commit 68f4bef

19 files changed

+128
-126
lines changed

.github/workflows/kubectl-az.yml .github/workflows/kubectl-aks.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Microsoft Azure CLI kubectl plugin CI
1+
name: Microsoft AKS CLI kubectl plugin CI
22
env:
33
GO_VERSION: 1.17 # TODO: Update
4-
AZURE_PREFIX: kubectl-az-ci
4+
AZURE_PREFIX: kubectl-aks-ci
55
concurrency:
66
# Only one workflow can run at a time unless
77
# we create a new AKS cluster per github_ref (branch)
8-
group: kubectl-az-ci
8+
group: kubectl-aks-ci
99

1010
on:
1111
pull_request:
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
build:
20-
name: Build kubectl-az
20+
name: Build kubectl-aks
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
@@ -45,25 +45,25 @@ jobs:
4545
uses: actions/checkout@v3
4646
- name: Build and generate tarball
4747
run: |
48-
target=kubectl-az-${{ matrix.os }}-${{ matrix.arch }}
48+
target=kubectl-aks-${{ matrix.os }}-${{ matrix.arch }}
4949
5050
make $target
5151
52-
binary_name=kubectl-az
52+
binary_name=kubectl-aks
5353
if [ ${{ matrix.os }} = "windows" ]; then
54-
binary_name=kubectl-az.exe
54+
binary_name=kubectl-aks.exe
5555
fi
5656
5757
# Prepare binary as artifact, it will be used by other jobs
5858
mv $target $binary_name
5959
tar --sort=name --owner=root:0 --group=root:0 \
6060
-czf ${target}.tar.gz \
6161
$binary_name LICENSE
62-
- name: Add kubectl-az-${{ matrix.os }}-${{ matrix.arch }}.tar.gz as artifact
62+
- name: Add kubectl-aks-${{ matrix.os }}-${{ matrix.arch }}.tar.gz as artifact
6363
uses: actions/upload-artifact@v3
6464
with:
65-
name: kubectl-az-${{ matrix.os }}-${{ matrix.arch }}-tar-gz
66-
path: kubectl-az-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
65+
name: kubectl-aks-${{ matrix.os }}-${{ matrix.arch }}-tar-gz
66+
path: kubectl-aks-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
6767

6868
unit-tests:
6969
name: Run unit tests
@@ -170,15 +170,15 @@ jobs:
170170
exit 1
171171
;;
172172
esac
173-
- name: Get kubectl-az from artifact
173+
- name: Get kubectl-aks from artifact
174174
uses: actions/download-artifact@v3
175175
with:
176-
name: kubectl-az-${{ env.os }}-${{ matrix.arch }}-tar-gz
177-
- name: Prepare kubectl-az binary
176+
name: kubectl-aks-${{ env.os }}-${{ matrix.arch }}-tar-gz
177+
- name: Prepare kubectl-aks binary
178178
shell: bash
179179
run: |
180-
tar zxvf kubectl-az-${{ env.os }}-${{ matrix.arch }}.tar.gz
181-
chmod +x kubectl-az
180+
tar zxvf kubectl-aks-${{ env.os }}-${{ matrix.arch }}.tar.gz
181+
chmod +x kubectl-aks
182182
ls -la
183183
- name: Login to Azure
184184
uses: azure/login@v1
@@ -196,7 +196,7 @@ jobs:
196196
- name: Run integration tests
197197
shell: bash
198198
run: |
199-
make integration-test -o kubectl-az
199+
make integration-test -o kubectl-aks
200200
201201
release:
202202
name: Release
@@ -210,10 +210,10 @@ jobs:
210210
- uses: actions/checkout@v3
211211
- name: Get all artifacts.
212212
uses: actions/download-artifact@v3
213-
- name: Rename all artifacts to kubectl-az-${{ github.ref_name }}.tar.gz
213+
- name: Rename all artifacts to kubectl-aks-${{ github.ref_name }}.tar.gz
214214
shell: bash
215215
run: |
216-
for i in kubectl-az-*-*-tar-gz/kubectl-az-*-*.tar.gz; do
216+
for i in kubectl-aks-*-*-tar-gz/kubectl-aks-*-*.tar.gz; do
217217
mv $i $(dirname $i)/$(basename $i .tar.gz)-${{ github.ref_name }}.tar.gz
218218
done
219219
- name: Create Release
@@ -222,12 +222,12 @@ jobs:
222222
with:
223223
token: ${{ secrets.GITHUB_TOKEN }}
224224
name: Release ${{ github.ref }}
225-
- name: Upload kubectl-az binaries to the release
225+
- name: Upload kubectl-aks binaries to the release
226226
uses: csexton/release-asset-action@v2
227227
with:
228-
pattern: "kubectl-az-*-*-tar-gz/kubectl-az-*-*.tar.gz"
228+
pattern: "kubectl-aks-*-*-tar-gz/kubectl-aks-*-*.tar.gz"
229229
github-token: ${{ secrets.GITHUB_TOKEN }}
230230
release-url: ${{ steps.create_release.outputs.upload_url }}
231231
- name: Update new version in krew-index
232-
if: github.repository == 'azure/kubectl-az'
232+
if: github.repository == 'azure/kubectl-aks'
233233
uses: rajatjindal/[email protected]

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*.dll
55
*.so
66
*.dylib
7-
/kubectl-az
8-
/kubectl-az-*-*
7+
/kubectl-aks
8+
/kubectl-aks-*-*
99

1010
# Test binary, built with `go test -c`
1111
*.test

.krew.yaml

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
apiVersion: krew.googlecontainertools.github.com/v1alpha2
22
kind: Plugin
33
metadata:
4-
name: az
4+
name: aks
55
spec:
66
version: {{ .TagName }}
7-
homepage: https://github.com/Azure/kubectl-az
7+
homepage: https://github.com/Azure/kubectl-aks
88
shortDescription: Interact with an AKS cluster
99
description: |
1010
This plugin provides a set of commands that can be used to debug an AKS
1111
cluster even when the cluster's control plane is not working correctly. For
1212
instance, when the API server is having problems.
1313
14-
This plugin is not meant to replace az, but to complement it by providing
14+
This plugin is not meant to replace az [1], but to complement it by providing
1515
additional commands and, mainly, allowing users to have a kubectl-like
1616
experience when working with an AKS cluster.
17+
18+
[1] https://learn.microsoft.com/en-us/cli/azure/
1719
platforms:
1820
- selector:
1921
matchLabels:
2022
os: linux
2123
arch: amd64
22-
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-linux-amd64-{{ .TagName }}.tar.gz" .TagName }}
23-
bin: kubectl-az
24+
{{addURIAndSha "https://github.com/Azure/kubectl-aks/releases/download/{{ .TagName }}/kubectl-aks-linux-amd64-{{ .TagName }}.tar.gz" .TagName }}
25+
bin: kubectl-aks
2426
- selector:
2527
matchLabels:
2628
os: darwin
2729
arch: amd64
28-
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-darwin-amd64-{{ .TagName }}.tar.gz" .TagName }}
29-
bin: kubectl-az
30+
{{addURIAndSha "https://github.com/Azure/kubectl-aks/releases/download/{{ .TagName }}/kubectl-aks-darwin-amd64-{{ .TagName }}.tar.gz" .TagName }}
31+
bin: kubectl-aks
3032
- selector:
3133
matchLabels:
3234
os: windows
3335
arch: amd64
34-
{{addURIAndSha "https://github.com/Azure/kubectl-az/releases/download/{{ .TagName }}/kubectl-az-windows-amd64-{{ .TagName }}.tar.gz" .TagName }}
35-
bin: kubectl-az
36+
{{addURIAndSha "https://github.com/Azure/kubectl-aks/releases/download/{{ .TagName }}/kubectl-aks-windows-amd64-{{ .TagName }}.tar.gz" .TagName }}
37+
bin: kubectl-aks.exe

Makefile

+26-26
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,48 @@ else
1212
VERSION := $(TAG)-dirty
1313
endif
1414

15-
LDFLAGS := "-X github.com/Azure/kubectl-az/cmd.version=$(VERSION) -extldflags '-static'"
15+
LDFLAGS := "-X github.com/Azure/kubectl-aks/cmd.version=$(VERSION) -extldflags '-static'"
1616

17-
.DEFAULT_GOAL := kubectl-az
17+
.DEFAULT_GOAL := kubectl-aks
1818

1919
# Build
20-
KUBECTL_AZ_TARGETS = \
21-
kubectl-az-linux-amd64 \
22-
kubectl-az-linux-arm64 \
23-
kubectl-az-darwin-amd64 \
24-
kubectl-az-darwin-arm64 \
25-
kubectl-az-windows-amd64
20+
KUBECTL_AKS_TARGETS = \
21+
kubectl-aks-linux-amd64 \
22+
kubectl-aks-linux-arm64 \
23+
kubectl-aks-darwin-amd64 \
24+
kubectl-aks-darwin-arm64 \
25+
kubectl-aks-windows-amd64
2626

27-
.PHONY: list-kubectl-az-targets
28-
list-kubectl-az-targets:
29-
@echo $(KUBECTL_AZ_TARGETS)
27+
.PHONY: list-kubectl-aks-targets
28+
list-kubectl-aks-targets:
29+
@echo $(KUBECTL_AKS_TARGETS)
3030

31-
.PHONY: kubectl-az-all
32-
kubectl-az-all: $(KUBECTL_AZ_TARGETS)
31+
.PHONY: kubectl-aks-all
32+
kubectl-aks-all: $(KUBECTL_AKS_TARGETS)
3333

34-
.PHONY: kubectl-az
35-
kubectl-az: kubectl-az-$(GOHOSTOS)-$(GOHOSTARCH)
36-
mv kubectl-az-$(GOHOSTOS)-$(GOHOSTARCH) kubectl-az
34+
.PHONY: kubectl-aks
35+
kubectl-aks: kubectl-aks-$(GOHOSTOS)-$(GOHOSTARCH)
36+
mv kubectl-aks-$(GOHOSTOS)-$(GOHOSTARCH) kubectl-aks
3737

3838
# make does not allow implicit rules (with '%') to be phony so let's use
3939
# the 'phony_explicit' dependency to make implicit rules inherit the phony
4040
# attribute
4141
.PHONY: phony_explicit
4242
phony_explicit:
4343

44-
.PHONY: kubectl-az-%
45-
kubectl-az-%: phony_explicit
44+
.PHONY: kubectl-aks-%
45+
kubectl-aks-%: phony_explicit
4646
export GO111MODULE=on CGO_ENABLED=0 && \
4747
export GOOS=$(shell echo $* |cut -f1 -d-) GOARCH=$(shell echo $* |cut -f2 -d-) && \
4848
go build -ldflags $(LDFLAGS) \
49-
-o kubectl-az-$${GOOS}-$${GOARCH} \
50-
github.com/Azure/kubectl-az
49+
-o kubectl-aks-$${GOOS}-$${GOARCH} \
50+
github.com/Azure/kubectl-aks
5151

5252
# Install
5353
.PHONY: install
54-
install: kubectl-az
54+
install: kubectl-aks
5555
mkdir -p ~/.local/bin/
56-
cp kubectl-az ~/.local/bin/
56+
cp kubectl-aks ~/.local/bin/
5757

5858
# Run unit tests
5959
.PHONY: unit-test
@@ -62,15 +62,15 @@ unit-test:
6262

6363
# Run integration tests
6464
.PHONY: integration-test
65-
integration-test: kubectl-az
66-
KUBECTL_AZ="$(shell pwd)/kubectl-az" \
65+
integration-test: kubectl-aks
66+
KUBECTL_AKS="$(shell pwd)/kubectl-aks" \
6767
go test -v ./test/integration/... -integration
6868

6969
# Clean
7070
.PHONY: clean
7171
clean:
72-
rm -f kubectl-az
72+
rm -f kubectl-aks
7373

7474
.PHONY: cleanall
7575
cleanall: clean
76-
rm -f $(KUBECTL_AZ_TARGETS)
76+
rm -f $(KUBECTL_AKS_TARGETS)

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Microsoft Azure CLI kubectl plugin
1+
# Microsoft Azure Kubernetes Service (AKS) CLI kubectl plugin
22

3-
`kubectl-az` is a `kubectl` plugin that provides a set of commands that can be
3+
`kubectl-aks` is a `kubectl` plugin that provides a set of commands that can be
44
used to debug an AKS cluster even when the cluster's control plane is not
55
working correctly. For instance, when the API server is having problems.
66

@@ -16,7 +16,7 @@ available command and which one is the most suitable for your case:
1616
- [check-apiserver-connectivity](docs/check-apiserver-connectivity.md)
1717
- [config](docs/config.md)
1818

19-
Consider `kubectl-az` expects the cluster to use virtual machine scale sets,
19+
Consider `kubectl-aks` expects the cluster to use virtual machine scale sets,
2020
which is the case of an AKS cluster. And, the use of the `--node` flag requires
2121
the Kubernetes control plane to up and running, because the VMSS instance
2222
information of the node will be retrieved from the Kubernetes API server.
@@ -30,41 +30,41 @@ to the commands using the `--id` flag or separately with the `--subscription`,
3030

3131
## Install
3232

33-
There is multiple ways to install the `kubectl-az`.
33+
There is multiple ways to install the `kubectl-aks`.
3434

3535
### Install a specific release
3636

3737
It is possible to download the asset for a given release and platform from the
38-
[releases page](https://github.com/azure/kubectl-az/releases/), uncompress and
39-
move the `kubectl-az` executable to any folder in your `$PATH`.
38+
[releases page](https://github.com/azure/kubectl-aks/releases/), uncompress and
39+
move the `kubectl-aks` executable to any folder in your `$PATH`.
4040

4141
```bash
4242
VERSION=v0.1.0
43-
curl -sL https://github.com/azure/kubectl-az/releases/latest/download/kubectl-az-linux-amd64-${VERSION}.tar.gz | sudo tar -C /usr/local/bin -xzf - kubectl-az
44-
kubectl az version
43+
curl -sL https://github.com/azure/kubectl-aks/releases/latest/download/kubectl-aks-linux-amd64-${VERSION}.tar.gz | sudo tar -C /usr/local/bin -xzf - kubectl-aks
44+
kubectl aks version
4545
```
4646

4747
### Compile from source
4848

49-
To build `kubectl-az` from source, you'll need to have a Golang version 1.17
49+
To build `kubectl-aks` from source, you'll need to have a Golang version 1.17
5050
or higher installed:
5151

5252
```bash
53-
git clone https://github.com/Azure/kubectl-az.git
54-
cd kubectl-az
53+
git clone https://github.com/Azure/kubectl-aks.git
54+
cd kubectl-aks
5555
# Build and copy the resulting binary in $HOME/.local/bin/
5656
make install
57-
kubectl az version
57+
kubectl aks version
5858
```
5959

6060
## Usage
6161

6262
```bash
63-
$ kubectl az --help
64-
Microsoft Azure CLI kubectl plugin
63+
$ kubectl aks --help
64+
Microsoft AKS CLI kubectl plugin
6565

6666
Usage:
67-
kubectl-az [command]
67+
kubectl-aks [command]
6868

6969
Available Commands:
7070
check-apiserver-connectivity Check connectivity between the nodes and the Kubernetes API Server
@@ -75,18 +75,18 @@ Available Commands:
7575
version Show version
7676

7777
Flags:
78-
-h, --help help for kubectl-az
78+
-h, --help help for kubectl-aks
7979

80-
Use "kubectl-az [command] --help" for more information about a command.
80+
Use "kubectl-aks [command] --help" for more information about a command.
8181
```
8282

83-
It is necessary to sign in to Azure to run any `kubectl-az` command. To do so,
83+
It is necessary to sign in to Azure to run any `kubectl-aks` command. To do so,
8484
you can use any authentication method provided by the [Azure
8585
CLI](https://github.com/Azure/azure-cli/) using the `az login` command; see
8686
further details
8787
[here](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli).
8888
However, if you do not have the Azure CLI or have not signed in yet,
89-
`kubectl-az` will open the default browser and load the Azure sign-in page where
89+
`kubectl-aks` will open the default browser and load the Azure sign-in page where
9090
you need to authenticate.
9191

9292
## Contributing

cmd/check-apiserver-connectivity.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strconv"
1111
"strings"
1212

13-
"github.com/Azure/kubectl-az/cmd/utils"
13+
"github.com/Azure/kubectl-aks/cmd/utils"
1414
"github.com/spf13/cobra"
1515
)
1616

cmd/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
"github.com/spf13/cobra"
1010

11-
"github.com/Azure/kubectl-az/cmd/utils"
12-
"github.com/Azure/kubectl-az/cmd/utils/config"
11+
"github.com/Azure/kubectl-aks/cmd/utils"
12+
"github.com/Azure/kubectl-aks/cmd/utils/config"
1313
)
1414

1515
var configCmd = &cobra.Command{

cmd/root.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ package cmd
66
import (
77
"os"
88

9-
"github.com/Azure/kubectl-az/cmd/utils"
9+
"github.com/Azure/kubectl-aks/cmd/utils"
1010
"github.com/spf13/cobra"
1111
)
1212

1313
// Common flags for all subcommands
1414
var commonFlags utils.CommonFlags
1515

1616
var rootCmd = &cobra.Command{
17-
Use: "kubectl-az",
18-
Short: "Microsoft Azure CLI kubectl plugin",
17+
Use: "kubectl-aks",
18+
Short: "Microsoft AKS CLI kubectl plugin",
1919
}
2020

2121
func Execute() {

0 commit comments

Comments
 (0)