Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steebchen/kubectl
A Github action for kubectl, the Kubernetes CLI
https://github.com/steebchen/kubectl
actions cd ci devops github kubectl kubernetes
Last synced: 1 day ago
JSON representation
A Github action for kubectl, the Kubernetes CLI
- Host: GitHub
- URL: https://github.com/steebchen/kubectl
- Owner: steebchen
- License: mit
- Created: 2019-05-29T13:44:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T09:31:09.000Z (about 2 years ago)
- Last Synced: 2024-10-30T02:36:32.597Z (3 months ago)
- Topics: actions, cd, ci, devops, github, kubectl, kubernetes
- Language: Shell
- Homepage:
- Size: 11.7 KB
- Stars: 215
- Watchers: 6
- Forks: 75
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Deploy to Kubernetes with kubectl
- fucking-awesome-actions - Deploy to Kubernetes with kubectl
- awesome-workflows - Deploy to Kubernetes with kubectl
README
# GitHub Action for Kubernetes CLI
This action provides `kubectl` for GitHub Actions.
## Upgrading from v1 to v2
If you upgrade from v1 to v2, note that you need to specify new variables via `with`, namely `version`, `config`, and `command`. See below for an example.
## 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: steebchen/[email protected]
with: # defaults to latest kubectl binary version
config: ${{ secrets.KUBE_CONFIG_DATA }}
command: set image --record deployment/my-app container=${{ github.repository }}:${{ github.sha }}
- name: verify deployment
uses: steebchen/[email protected]
with:
config: ${{ secrets.KUBE_CONFIG_DATA }}
version: v1.21.0 # specify kubectl binary version explicitly
binaries-url: "https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl" # specify the download url explicitly
command: rollout status deployment/my-app
```## Arguments
`command` – **required**: The command you want to run, without `kubectl`, e.g. `get pods`
`config` – **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
````version`: The kubectl version with a 'v' prefix, e.g. `v1.21.0`. It defaults to the latest kubectl binary version available.
`binaries-url`: The url to download the binaries from. It defaults to the official release page if empty.
**Note**: Do not use kubectl config view as this will hide the certificate-authority-data.