Skip to content

Commit b18ffc2

Browse files
authored
Updated README with example (#1)
* Updated README with example * Removing lint step for now * Downloading go dependencies helps * Removing lint again * Fixed go version issue. Was detecting 1.2 instead of 1.20
1 parent f1edf96 commit b18ffc2

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.github/workflows/pull_request.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- main
77

8-
env:
9-
GO_VERSION: 1.20
10-
118
jobs:
129
run-tests:
1310
runs-on: ubuntu-latest
@@ -18,15 +15,17 @@ jobs:
1815
- name: Setup Go
1916
uses: actions/setup-go@v3
2017
with:
21-
go-version: ${{ env.GO_VERSION }}
18+
go-version: "1.20"
2219

2320
- name: Go Lint
24-
uses: golangci/golangci-lint-action@v3.4.0
21+
uses: golangci/golangci-lint-action@v3
2522
with:
2623
args: --timeout=5m --enable exportloopref
2724
skip-pkg-cache: true
2825
skip-build-cache: true
29-
skip-go-installation: true
30-
31-
- name: Build
32-
run: go build -o k8s-parallel-exec
26+
27+
- name: Go Mod Download
28+
run: go mod download
29+
30+
- name: Go Build
31+
run: go build -o k8s-parallel-exec

.github/workflows/release.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,28 @@ on:
55
types:
66
- published
77

8-
env:
9-
GO_VERSION: 1.20
10-
118
jobs:
129
build:
1310
runs-on: ubuntu-latest
1411
steps:
1512
- uses: actions/checkout@v3
1613

17-
- name: Set up Go
14+
- name: Setup Go
1815
uses: actions/setup-go@v3
1916
with:
20-
go-version: ${{ env.GO_VERSION }}
17+
go-version: "1.20"
2118

2219
- name: Go Lint
23-
uses: golangci/golangci-lint-action@v3.4.0
20+
uses: golangci/golangci-lint-action@v3
2421
with:
2522
args: --timeout=5m --enable exportloopref
2623
skip-pkg-cache: true
2724
skip-build-cache: true
28-
skip-go-installation: true
2925

30-
- name: Build
26+
- name: Go Mod Download
27+
run: go mod download
28+
29+
- name: Go Build
3130
run: go build -o k8s-parallel-exec
3231

3332
- name: Publish k8s-parallel-exec to assets

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,22 @@ k8s-parallel-exec -kubeconfig /path/to/kubeconfig -c container-name -l label-sel
4848
- `-l`: Label selector to filter the pods.
4949
- `command-to-execute`: The command to run inside the specified container in each pod.
5050

51-
5251
Example
5352
```sh
5453
k8s-parallel-exec -kubeconfig ~/.kube/config -c cassandra -l app=cassandra nodetool status
5554
```
5655
This command would execute `nodetool status` on all the Cassandra containers in pods with the label "app=cassandra" in parallel, and then aggregate and display the results.
5756

57+
If authentication is enabled and you don't want to expose credentials, you may have to do things like the following:
58+
59+
```
60+
KPE_LABELS="cassandra-cluster-component=cassandra
61+
,cassandra-cluster-instance=test-cluster"
62+
k8s-parallel-exec -kubeconfig ~/.kube/kind-kcfg -l $KPE_LABELS -c cassandra -- bash -c 'nodetool --ssl -u $(cat /etc/cassandra-auth-config/admin-role) -pw $(cat /etc/cassandra-auth-config/admin-password) status'
63+
```
64+
65+
Currently working on a way to make this better...
66+
5867
## Possible Features
5968

6069
Here are some additional features that could make k8s-parallel-exec more useful:

0 commit comments

Comments
 (0)