Skip to content

Commit

Permalink
Merge pull request #6 from kei6u/krew-support
Browse files Browse the repository at this point in the history
Krew support
  • Loading branch information
keisku authored Jan 14, 2022
2 parents be634be + a6eb56f commit 7e1df52
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new version in krew-index
uses: rajatjindal/[email protected]
46 changes: 46 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: secretdata
spec:
version: {{ .TagName }}
homepage: https://github.com/kei6u/kubectl-secretdata
shortDescription: A kubectl plugin for finding decoded secret data with productive search flags
description: |
This is a kubectl plugin for finding decoded secret data.
Since kubectl outputs base64-encoded secrets basically,
it makes it difficult to check the secret value.
And searching secrets also is difficult. This tool helps
verify the real secret value and find the secrets
you want with productive search flags.
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/kei6u/kubectl-secretdata/releases/download/{{ .TagName }}/kubectl-secretdata_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
bin: kubectl-secretdata
- selector:
matchLabels:
os: darwin
arch: arm64
{{addURIAndSha "https://github.com/kei6u/kubectl-secretdata/releases/download/{{ .TagName }}/kubectl-secretdata_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
bin: kubectl-secretdata
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/kei6u/kubectl-secretdata/releases/download/{{ .TagName }}/kubectl-secretdata_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
bin: kubectl-secretdata
- selector:
matchLabels:
os: linux
arch: arm64
{{addURIAndSha "https://github.com/kei6u/kubectl-secretdata/releases/download/{{ .TagName }}/kubectl-secretdata_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
bin: kubectl-secretdata
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/kei6u/kubectl-secretdata/releases/download/{{ .TagName }}/kubectl-secretdata_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
bin: kubectl-secretdata.exe
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,46 +66,58 @@ Flags:
--username string Username for basic authentication to the API server
```

## Install
## Installation

### Krew

Use [krew](https://krew.sigs.k8s.io/) plugin manager to install.
See [the guide](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) to install [krew](https://krew.sigs.k8s.io/).

```bash
kubectl krew install secretdata
kubectl secretdata --help
```

### Download the binary

Download the binary from [GitHub Releases](https://github.com/kei6u/kubectl-secretdata/releases) and drop it in your `$PATH`.

### Linux
#### Linux

```shell
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.2/kubectl-secretdata_v1.0.2_linux_amd64.tar.gz
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.3/kubectl-secretdata_v1.0.3_linux_amd64.tar.gz
tar -xvf kubectl-secretdata.tar.gz
sudo mv kubectl-secretdata /usr/local/bin
```

### Darwin(amd64)
#### Darwin(amd64)

```shell
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.2/kubectl-secretdata_v1.0.2_darwin_amd64.tar.gz
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.3/kubectl-secretdata_v1.0.3_darwin_amd64.tar.gz
tar -xvf kubectl-secretdata.tar.gz
sudo mv kubectl-secretdata /usr/local/bin
```

### Darwin(arm64)
#### Darwin(arm64)

```shell
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.2/kubectl-secretdata_v1.0.2_darwin_arm64.tar.gz
curl -L -o kubectl-secretdata.tar.gz https://github.com/kei6u/kubectl-secretdata/releases/download/v1.0.3/kubectl-secretdata_v1.0.3_darwin_arm64.tar.gz
tar -xvf kubectl-secretdata.tar.gz
sudo mv kubectl-secretdata /usr/local/bin
```

### Source
#### Source

```shell
go install github.com/kei6u/kubectl-secretdata@latest
sudo mv $GOPATH/bin/kubectl-secretdata /usr/local/bin
```

### Validation
#### Validation

Validate if `kubectl secretdata` can be executed.
[The Kubernetes documentation](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/#using-a-plugin) explains how to use a plugin.

```bash
```shell
kubectl secretdata --help
```

0 comments on commit 7e1df52

Please sign in to comment.