Skip to content

bartlettc22/docker-kubectl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

Kubernetes Utilities

This project contains Kubernetes related utilities for use in build/deploy pipelines that have docker.

The following utilities are included:

  • kubectl is a CLI tool to manage a Kubernetes cluster
  • kops - CLI tool to create, destroy, upgrade Kubernetes clusters in cloud service providers
  • helm - Kubernetes packaging/deployment tool

Why use it

It's mostly meant to be used during continuous integration or as part of an automated build/deployment:

  • So that your machine (e.g. build server) doesn't need kubectl or other cli tools to be installed; only Docker.
  • To avoid kubectl config use-context and similar to affect your build and other projects' builds.

Usage

$ docker run --rm bartlettc22/kubectl kubectl --help

Usage example 1

For example to access a local Kubernetes cluster you may run:

$ docker run --rm --net=host --user $UID \
    -v ~/.kube:/config/.kube \
    cbartlett22/kubectl kubectl cluster-info

Usage: kubectl

docker run --rm -it \
  -v ${HOME}/.aws:/config/.aws \
  -e "AWS_PROFILE=$AWS_PROFILE" \
  -e "KOPS_NAME=blue.testcluster.io" \
  -e "KOPS_STATE_STORE=s3://kubectl-state" \
  bartlettc/docker-kubectl \
  sh -c "kops export kubecfg --name \$KOPS_NAME; kubecfg version"

About

Containerized Kubernetes kubectl

Resources

Stars

Watchers

Forks

Packages

No packages published