Skip to content

Instantly share code, notes, and snippets.

View brotandgames's full-sized avatar
✍️
X as Code

Brot & Games brotandgames

✍️
X as Code
View GitHub Profile
@brotandgames
brotandgames / main.tf
Last active May 6, 2019 14:10
terraform-rke
resource "rke_cluster" "cluster" {
nodes {
address = "node1.brotandgames.com"
user = "root"
role = ["controlplane", "worker", "etcd"]
ssh_key = "${file("~/.ssh/id_rsa")}"
}
addons_include = [
"https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml",
"https://gist.githubusercontent.com/superseb/499f2caa2637c404af41cfb7e5f4a938/raw/930841ac00653fdff8beca61dab9a20bb8983782/k8s-dashboard-user.yml",
# Input ENV variables
export RANCHER_HOSTNAME=rancher.your-host.com
export RANCHER_LETSENCRYPT_EMAIL=your-mail@your-host.com
# Helm setup rbac
kubectl --kubeconfig ${KUBECONFIG} create clusterrolebinding add-on-cluster-admin \
--clusterrole=cluster-admin --serviceaccount=kube-system:default
# Helm init: install tiller etc.
helm init
# Setup working directory
export WORKDIR=~/rke-test
mkdir ${WORKDIR}
cd ${WORKDIR}
# Configure Kubernetes Cluster - follow the instructions
# This will create an config.yaml file which you can adjust later on
rke config
# Deploy Kubernetes Cluster
@brotandgames
brotandgames / node1.sh
Last active May 8, 2019 16:29
node1.sh
export DOCKER_VERSION=18.06.2
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt list docker-ce -a
sudo apt-get install -y docker-ce=${DOCKER_VERSION}~ce-0~ubuntu-$(lsb_release -cs)