Skip to content

Commit

Permalink
Releasing v1.0.0 kubectl netscaler-k8s plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitra-citrix authored and Arijit Ray committed May 22, 2023
1 parent 22c2148 commit eef0ea8
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 23 deletions.
21 changes: 16 additions & 5 deletions netscaler-k8s-plugin/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
project_name: "netscaler-k8s-plugin"
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- binary: netscaler-k8s
- binary: kubectl-netscaler_k8s
main: netscaler_k8s/kubectl-netscaler_k8s.go
env:
- CGO_ENABLED=0
Expand All @@ -21,10 +19,23 @@ builds:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
name_template: "{{ .ProjectName }}_{{ .Tag }}_-next"

archives:
- name_template: >-
{{ .ProjectName }}_{{ .Tag }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^test:'
31 changes: 14 additions & 17 deletions netscaler-k8s-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,30 @@ You can perform troubleshooting operations using the subcommands available with
The plugin is supported from Citrix ingress controller version 1.32.7 onwards.

## Installation and usage

You can install the `kubectl` plug-in by downloading it from the [NetScaler Modern Apps tool kit repository](https://github.com/netscaler/modern-apps-toolkit/releases) using curl as follows.

For Linux:

curl -LO https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_1.0.0-netscaler-k8s-plugin_linux_amd64.tar.gz
gunzip netscaler-k8s-plugin_1.0.0-netscaler-k8s-plugin_linux_amd64.tar.gz
tar -xvf netscaler-k8s-plugin_1.0.0-netscaler-k8s-plugin_linux_amd64.tar
chmod +x netscaler-k8s
sudo mv netscaler-k8s /usr/local/bin/kubectl-netscaler_k8s
curl -LO https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_v1.0.0-netscaler-k8s-plugin_Linux_x86_64.tar.gz
gunzip netscaler-k8s-plugin_v1.0.0-netscaler-k8s-plugin_Linux_x86_64.tar.gz
tar -xvf netscaler-k8s-plugin_v1.0.0-netscaler-k8s-plugin_Linux_x86_64.tar
chmod +x kubectl-netscaler_k8s
sudo mv kubectl-netscaler_k8s /usr/local/bin/kubectl-netscaler_k8s

For Mac:

curl -s -L https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_1.0.0-netscaler-k8s-plugin_darwin_amd64.tar.gz | tar xvz -
chmod +x netscaler-k8s
sudo mv netscaler-k8s /usr/local/bin/kubectl-netscaler_k8s

**Note:** For Mac, you need to enable [Open a developer app](https://support.apple.com/en-in/HT202491)
curl -s -L https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_v1.0.0-netscaler-k8s-plugin_Darwin_x86_64.tar.gz | tar xvz -
chmod +x kubectl-netscaler_k8s
sudo mv kubectl-netscaler_k8s /usr/local/bin/kubectl-netscaler_k8s

> **Note:** For Mac, you need to enable [allow a developer app](https://support.apple.com/en-in/HT202491)
For Windows:

curl.exe -LO https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_1.0.0-netscaler-k8s-plugin_windows_amd64.tar.gz | tar xvz
curl.exe -LO https://github.com/netscaler/modern-apps-toolkit/releases/download/v1.0.0-netscaler-k8s-plugin/netscaler-k8s-plugin_v1.0.0-netscaler-k8s-plugin_Windows_x86_64.zip | tar xvz
Rename the file netscaler-k8s.exe to kubectl-netscaler_k8s.exe

**Note:** For Windows, you must set you `$PATH` variable to where netscaler_k8s.exe file is extracted.
> **Note:** For Windows, you must set you `$PATH` variable to where kubectl-netscaler_k8s.exe file is extracted.

The following subcommands are available with this plug in:
Expand Down Expand Up @@ -125,9 +122,9 @@ The following is a sample output for the kubectl netscaler-k8s conf subcommand:
This support subcommand gets NetScaler (show techsupport) and Ingress Controller
support bundle.

**Warning:**
For tier 2 NetScaler, technical support bundle files are copied to the location the user
specifies. For security reasons, if the ingress controller is managing a tier 1 NetScaler then the tech support bundle is extracted only and not copied. The user must get the technical support bundle files from the NetScaler manually.
> **Warning:**
For NetScaler CPX form factor, technical support bundle files are copied to the location the user
specifies. For security reasons, if the ingress controller is managing a NetScaler VPX/MPX then the tech support bundle is extracted only and not copied. The user must get the technical support bundle files from the NetScaler manually.

Flags for support subcommand:

Expand Down
38 changes: 38 additions & 0 deletions netscaler-k8s-plugin/krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: netscaler-k8s
spec:
shortDescription: A Kubernetes plugin for inspecting Ingress Controller and associated NetScaler deployments
description: |
The official kubectl plugin for netscaler-k8s.
version: {{ .TagName }}
homepage: https://github.com/netscaler/modern-apps-toolkit/tree/main/netscaler-k8s-plugin#readme
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/netscaler/modern-apps-toolkit/releases/download/{{ .TagName }}/netscaler-k8s-plugin_{{ .TagName }}_Darwin_x86_64.tar.gz" .TagName | indent 6 }}
bin: ./kubectl-netscaler_k8s
files:
- from: "*"
to: "."
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/netscaler/modern-apps-toolkit/releases/download/{{ .TagName }}/netscaler-k8s-plugin_{{ .TagName }}_Linux_x86_64.tar.gz" .TagName | indent 6 }}
bin: ./kubectl-netscaler_k8s
files:
- from: "*"
to: "."
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/netscaler/modern-apps-toolkit/releases/download/{{ .TagName }}/netscaler-k8s-plugin_{{ .TagName }}_Windows_x86_64.zip" .TagName | indent 6 }}
bin: ./kubectl-netscaler_k8s.exe
files:
- from: "*"
to: "."
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {
Use: "netscaler-k8s",
Short: "A Kubernetes plugin for inspecting Ingress Controller and associated NetScaler deployments",
}

rootCmd.CompletionOptions.DisableDefaultCmd = true
// Respect some basic kubectl flags like --namespace
flags := genericclioptions.NewConfigFlags(true)
flags.AddFlags(rootCmd.PersistentFlags())
Expand Down

0 comments on commit eef0ea8

Please sign in to comment.