Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 1.36 KB

File metadata and controls

57 lines (46 loc) · 1.36 KB

Description

This repository contains ansible playbooks for automating all steps of Kubernetes The Hard Way tutorial.

Install and configure The Google Cloud SDK https://cloud.google.com/sdk/downloads.

Pre-Requirements

Generate ssh keys:

ssh-keygen -f ./files/ssh/k8s_the_hard_way -P "" -C k8s

Configure ansible GCE modules

Copy example gce configuration:

cp .env.gce.example .env.gce

Edit according to your environment and then export all variables:

export $(cat .env.gce)

Provision GCE infrastructure

ansible-playbook playbook.yml --tags infra

Configure ansible GCE dynamic inventory

Copy example gce.ini file:

cp ./inventory/gce.ini.example ./inventory/gce.ini

Edit according to your environment and then check that dynamic inventory is configured properly:

ansible -m ping all

For full documentation see http://docs.ansible.com/ansible/latest/guide_gce.html

Run ansible playbook for bringing up the Kubernetes cluster:

ansible-playbook playbook.yml

Verify that cluster is working

kubectl get cs
kubectl get no

Cleanup

ansible-playbook 14-cleanup.yml
kubectl config delete-context kubernetes-the-hard-way
kubectl config delete-cluster kubernetes-the-hard-way