Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghostzero/kubectl
https://github.com/ghostzero/kubectl
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ghostzero/kubectl
- Owner: ghostzero
- License: mit
- Created: 2021-04-09T05:42:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T17:05:27.000Z (over 3 years ago)
- Last Synced: 2024-03-15T15:26:00.265Z (11 months ago)
- Language: Dockerfile
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Action for Kubernetes CLI
This action provides `kubectl` for Github Actions.
## Usage
`.github/workflows/push.yml`
```yaml
on: push
name: deploy
jobs:
deploy:
name: deploy to cluster
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: deploy to cluster
uses: ghostzero/kubectl@v1
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: set image --record deployment/my-app container=${{ github.repository }}:${{ github.sha }}
- name: verify deployment
uses: ghostzero/kubectl@v1
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
KUBECTL_VERSION: "1.15"
with:
args: '"rollout status deployment/my-app"'
```## Secrets
`KUBE_CONFIG_DATA` – **required**: A base64-encoded kubeconfig file with credentials for Kubernetes to access the cluster. You can get it by running the following command:
```bash
cat $HOME/.kube/config | base64
```## Environment
`KUBECTL_VERSION` - (optional): Used to specify the kubectl version. If not specified, this defaults to kubectl 1.13
**Note**: Do not use kubectl config view as this will hide the certificate-authority-data.