Utility that simplifies Kubernetes@AWS cluster management
Currently the code is a huge mess, it may not work under not-exactly-as-on-my-platform conditions.
- Download & install a lot of dependencies (sorry for that):
- aws-cli
- kubectl
- eksctl
- aws-iam-authenticator
- Node.js & Yarn (
npm i -g yarn
) - alpha-k8s (for now, just download the repo and run
yarn
, btw you'll need Node.js and Yarn - that's a lot of deps, sorry!)
- Create cluster config file
kube.json
{ "name": "h1-eks", "region": "eu-west-1", "nodesMin": 2, "nodesMax": 5, "domain": "h1.com" }
- Set correct AWS credentials with
aws configure
- Run
yarn setup
. Wait 5-15 minutes. Eksctl will do it's magic. - Optionally, run
yarn start install [module1] [module2]
if you want to install things such as "dashboard", "autoscaler", "dns" automatically. - Run
yarn create-namespace [namespace-name]
. This will create a namespace in your cluster, set up AWS roles, policies and users, K8s roles, groups and role bindings, proper K8s configuration files and AWS access keys for namespace admins and CI (deployments). - Access the cluster namespace with newly created resources: Go to newly created folder
./namespaces/[namespace-name]
to find the credentials. You can doexport AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... KUBEFILE=./namespaces/[namespace-name]/admin.config.yaml
and manage your namespace usingkubectl
commands from now on.
For now the whole solution looks crappy, but well, it saved me some time, I hope it'll save your too.