Using kubectl ouput

This commit is contained in:
Cirrus-8691 2024-06-01 12:15:07 +02:00 committed by GitHub
parent c1933f5a8d
commit 84e24b2a84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,22 @@ To use kubectl put this step into your workflow:
args: get pods
```
### Using kubectl ouput:
```yaml
- name: 🛂 Check namespace exists
uses: actions-hub/kubectl@master
with:
redirect-to: NAMESPACE_EXIST
args: get namespace ${{ env.EXPECTED_NAMESPACE }} --ignore-not-found
- name: 🛡️ Preserve secret FRONT_TLS
if: env.NAMESPACE_EXIST == ${{ env.EXPECTED_NAMESPACE }}
uses: actions-hub/kubectl@master
with:
redirect-to: WEBAPP_TLS
args: get secret webapp-tls -n ${{ env.EXPECTED_NAMESPACE }} -o yaml
```
## Environment variables
All these variables need to authorize to kubernetes cluster.
I recommend using secrets for this.
@ -125,4 +141,4 @@ To use a specific version of kubectl use:
```
## Licence
[MIT License](https://github.com/actions-hub/kubectl/blob/master/LICENSE)
[MIT License](https://github.com/actions-hub/kubectl/blob/master/LICENSE)