Skip to content

Commit

Permalink
Add github action for release krew
Browse files Browse the repository at this point in the history
  • Loading branch information
ssup2 committed Apr 7, 2021
1 parent 7dd677c commit 6a73bf2
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 8 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release-krew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: release-krew
on:
release:
types: ["published"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Open PR for new release of Krew Plugin
uses: rajatjindal/krew-plugin-release@v0.0.30
with:
plugin-name: 'pexec'
upstream-krew-index-owner: 'kubernetes-sigs'
env:
KREW_PLUGIN_RELEASE_TOKEN: ${{ secrets.KREW_PLUGIN_RELEASE_TOKEN }}
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ archives:
- id: kpexec
builds:
- kpexec
name_template: "kpexec_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
name_template: "kpexec_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
replacements:
darwin: Darwin
linux: Linux
windows: Windows
- id: kubectl-pexec
builds:
- kubectl-pexec
name_template: "kubectl_pexec_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
name_template: "kubectl_pexec_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
replacements:
darwin: Darwin
linux: Linux
Expand Down
56 changes: 56 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: pexec
spec:
homepage: https://github.com/ssup2/kpexec
shortDescription: Execute process with privileges in a pod
description: |
pexec is a kubernetes cli that runs commands in a container with high
privileges. It runs a highly privileged container on the same node as
the target container and joins into the namespaces of the target container
(IPC, UTS, PID, net, mount). This is useful for debugging where you often
need to execute commands with high privileges. Also, pexec has a tools
mode, which adds useful debugging tools into the debugged container. The
tools mode is useful when there necessary debugging tools are missing in the
target container.
In contrast, kubectl-exec runs the command with the same privileges as the
container. For example, if a container does not have network privileges,
the command executed by kubectl-exec also has no network privileges.
This makes debugging the pod difficult. If you use pexec instead
of kubectl-exec, you can easily get high privileges for debugging.
caveats: |
pexec requires the privileges to run privileged pods with hostPID.
version: "{{ .TagName }}"
platforms:
- bin: kubectl-pexec
{{addURIAndSha "https://github.com/github.com/ssup2/kpexec/releases/download/{{ .TagName }}/kubectl_pexec_{{ .TagName }}_Linux_amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: amd64
- bin: kubectl-pexec
{{addURIAndSha "https://github.com/github.com/ssup2/kpexec/releases/download/{{ .TagName }}/kubectl_pexec_{{ .TagName }}_Linux_arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: arm64
- bin: kubectl-pexec
{{addURIAndSha "https://github.com/github.com/ssup2/kpexec/releases/download/{{ .TagName }}/kubectl_pexec_{{ .TagName }}_Darwin_amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: amd64
- bin: kubectl-pexec
{{addURIAndSha "https://github.com/github.com/ssup2/kpexec/releases/download/{{ .TagName }}/kubectl_pexec_{{ .TagName }}_Darwin_arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: arm64
- bin: kubectl-pexec.exe
{{addURIAndSha "https://github.com/github.com/ssup2/kpexec/releases/download/{{ .TagName }}/kubectl_pexec_{{ .TagName }}_Windows_amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: windows
arch: amd64
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ Since kpexec uses kubectl internally, **kubectl** installation and **kubeconfig*
Install via download the kpexec binary

```bash
$ export KPEXEC_VERSION=0.2.9
$ export KPEXEC_VERSION=v0.3.0

# Linux / amd64
$ wget -c "https://github.com/ssup2/kpexec/releases/download/v${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Linux_amd64.tar.gz" -O - | tar -C /usr/local/bin/ -xz
$ wget -c "https://github.com/ssup2/kpexec/releases/download/${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Linux_amd64.tar.gz" -O - | tar -C /usr/local/bin/ -xz

# Linux / arm64
$ wget -c "https://github.com/ssup2/kpexec/releases/download/v${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Linux_arm64.tar.gz" -O - | tar -C /usr/local/bin/ -xz
$ wget -c "https://github.com/ssup2/kpexec/releases/download/${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Linux_arm64.tar.gz" -O - | tar -C /usr/local/bin/ -xz

# macOS / amd64
$ wget -c "https://github.com/ssup2/kpexec/releases/download/v${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Darwin_amd64.tar.gz" -O - | tar -C /usr/local/bin/ -xz
$ wget -c "https://github.com/ssup2/kpexec/releases/download/${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Darwin_amd64.tar.gz" -O - | tar -C /usr/local/bin/ -xz

# macOS / arm64
$ wget -c "https://github.com/ssup2/kpexec/releases/download/v${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Darwin_arm64.tar.gz" -O - | tar -C /usr/local/bin/ -xz
$ wget -c "https://github.com/ssup2/kpexec/releases/download/${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Darwin_arm64.tar.gz" -O - | tar -C /usr/local/bin/ -xz

# Windows / amd64
# Download and install from https://github.com/ssup2/kpexec/releases/download/v${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Windows_amd64.tar.gz
# Download and install from https://github.com/ssup2/kpexec/releases/download/${KPEXEC_VERSION}/kpexec_${KPEXEC_VERSION}_Windows_amd64.tar.gz
```

### Homebrew
Expand Down

0 comments on commit 6a73bf2

Please sign in to comment.