This is a templated version of k8s
, kops
-based cluster.
The main purposes of this repository:
- Provide a repository to manage multiple Kubernetes clusters with
kops
. - Keep Kubernetes clusters Configuration as Code.
- Have an easy way to change Kubernetes cluster's parameters.
- Have a templated version of Kubernetes cluster deployed on Amazon Web Services.
- Provide a Kubernetes cluster with basic security policies applied.
- Automate workflow with
kops
.
First of all, kops
must be installed. [kops-installation]
Then, you can use the templated version of the cluster.
Have fun.
- Export
KOPS_STATE_STORE
environment variable:
export KOPS_STATE_STORE="s3://exampleenv-kops-s3
You always have to set this environment variable.
- It is possible to use
Makefile
target, for example:
make dist/clusters/cluster-exampleenv.yml
Notice that this target assumes equality of <cluster-name>
between dist/clusters/<cluster-name>.yml
and values/<cluster-name>.yml
- Create a template from values:
kops toolbox template --fail-on-missing \
--format-yaml \
--template src/eu-west-1/templates \
--snippets src/eu-west-1/snippets \
--values values/cluster-exampleenv.yml \
> dist/clusters/cluster-exampleenv.yml
- Generate a cluster from template:
kops create -f clusters/cluster-exampleenv.yml
Make sure all tests passes from the following target:
make test
Its requirement is pre-commit
.