kube-tools icon indicating copy to clipboard operation
kube-tools copied to clipboard

how to inject kube config?

Open debianmaster opened this issue 5 years ago • 1 comments

when using this action how to inject kubeconfig?

debianmaster avatar May 12 '20 15:05 debianmaster

I solved this by echoing the content of my ${{ secret.KUBECONFIG }} into the standard path of the Kubernetes config file, $HOME/.kube/config like this:

name: Deploy

on:
  deployment:

env:
  KUBECONFIG: .kube/config
  KUBECONFIG_FILE: ${{ secrets.KUBECONFIG }}

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - run: |
        mkdir -p .kube
        echo "${{ env.KUBECONFIG_FILE }}" > $KUBECONFIG

    - uses: stefanprodan/kube-tools@v1
      with:
        helmv3: 3.2.1
        command: |
          kubectl create namespace --ignore ${{ github.event.deployment.payload.namespace }} || true

riker09 avatar Jun 22 '20 13:06 riker09