Sign inSign up

loumaris/kubectl

By loumaris

Updated over 6 years ago

small docker container to handle kubectl with ENV based configuration

Image
0

477

loumaris/kubectl repository overview

loumaris/kubectl

A small helper image to run kubectl inside a CI like gitlab-ci.

usage

  • encode your kubeconfig to a base64 string, e.g.
    cat ~/.kube/config | base64
    
  • add the content to an env-variable called KUBECONFIG_BASE64
  • run a kubectl command, e.g.
    docker run -e KUBECONFIG_BASE64='....' loumaris/kubectl get nodes
    

That's it ;-)

gitlab-ci usage

  • see the usage
  • add the base64 string to your gitlab-ci configuration
  • add the image to your .gitlab-ci.yaml (e.g. update nginx):
    stages:
    - deploy
    
    deploy:
      stage: deploy
      script:
        - docker run -e "KUBECONFIG_BASE64=$KUBECONFIG_BASE64" loumaris/kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record
      only:
        - master
        - tags
    

Tag summary

Content type

Image

Digest

Size

15.6 MB

Last updated

over 6 years ago

docker pull loumaris/kubectl