A Dojo docker image with kubectl and Helm. Main use case: to deploy services on top of k8s infrastructure. Based on alpine docker image.
- Install Dojo
- Provide a Dojofile:
DOJO_DOCKER_IMAGE="kudulab/k8s-dojo:tagname"
# This directory should exist locally (outside of the container), because
# you may be using some tool that generates kubeconfig and it would be gone
# after you remove the container.
# You can mount any local directory, it doesn't need to be $HOME/.kube
DOJO_DOCKER_OPTIONS="-v $HOME/.kube:/home/dojo/.kube"
- Run
dojo
to make Dojo run a Docker container. - Inside the container you can run e.g.:
kubectl version
kubectl cluster-info
kubectl get pod
helm version
By default, current directory in docker container is /dojo/work
.
Those files are used inside the docker image:
~/.ssh
- if exists locally, will be copied~/.ssh/config
- will be generated on docker container start~/.gitconfig
- if exists locally, will be copied~/.kube
- must be mounted; otherwise results in error~/.kube/config
- if not exists, will be generated on docker container start ifK8S_ENDPOINT
is set
You can set optional variables in Dojofile and they will be used to generate a kube config:
DOJO_DOCKER_OPTIONS=-e K8S_ENDPOINT="http://my-k8s.example.com:8080" \
-e KUBE_USER="mykubeuser"
# environment variable KUBE_USER defaults to ${DOJO_USER}
You can also invoke it yourself: /usr/bin/generate-kubeconfig.sh
.
- Bash
- Docker daemon
- Bats
- Dojo
- In a feature branch:
- make changes and add some docs to changelog (do not insert date or version)
- build docker image:
./tasks build_local
- test it:
./tasks itest
- Decide that your changes are ready and if so:
- merge into master branch
- set version in changelog by running:
./tasks set_version
- or
./tasks set_version 1.2.3
to bump to a particular version
- push to master
- CI server (GoCD) tests and releases.
Copyright 2020 Ewa Czechowska, Tomasz Sętkowski
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.