From eef0ea8678d9ea8b0cb2dce251f05be75c795225 Mon Sep 17 00:00:00 2001 From: Arijit Ray Date: Mon, 22 May 2023 19:35:17 +0530 Subject: [PATCH] Releasing v1.0.0 kubectl netscaler-k8s plugin --- netscaler-k8s-plugin/.goreleaser.yaml | 21 +++++++--- netscaler-k8s-plugin/README.md | 31 +++++++-------- netscaler-k8s-plugin/krew.yaml | 38 +++++++++++++++++++ .../netscaler_k8s/kubectl-netscaler_k8s.go | 2 +- 4 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 netscaler-k8s-plugin/krew.yaml diff --git a/netscaler-k8s-plugin/.goreleaser.yaml b/netscaler-k8s-plugin/.goreleaser.yaml index c199b79..c663f0b 100644 --- a/netscaler-k8s-plugin/.goreleaser.yaml +++ b/netscaler-k8s-plugin/.goreleaser.yaml @@ -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 @@ -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:' \ No newline at end of file diff --git a/netscaler-k8s-plugin/README.md b/netscaler-k8s-plugin/README.md index 2ec2f36..fb18188 100644 --- a/netscaler-k8s-plugin/README.md +++ b/netscaler-k8s-plugin/README.md @@ -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: @@ -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: diff --git a/netscaler-k8s-plugin/krew.yaml b/netscaler-k8s-plugin/krew.yaml new file mode 100644 index 0000000..19c9c5a --- /dev/null +++ b/netscaler-k8s-plugin/krew.yaml @@ -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: "." \ No newline at end of file diff --git a/netscaler-k8s-plugin/netscaler_k8s/kubectl-netscaler_k8s.go b/netscaler-k8s-plugin/netscaler_k8s/kubectl-netscaler_k8s.go index 88cc8bd..6256063 100644 --- a/netscaler-k8s-plugin/netscaler_k8s/kubectl-netscaler_k8s.go +++ b/netscaler-k8s-plugin/netscaler_k8s/kubectl-netscaler_k8s.go @@ -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())