Skip to content

Spin Up Platform

Max Siegieda edited this page Jan 16, 2019 · 18 revisions

So you'd like to run the platform would you? This guide will tell you which commands to run, where and why.

Which components do we have in play?

  • Kubernetes, managed using kops
  • 'Platform' itself, composed of the API container and the cron worker container
  • Github Oauth
  • A Database, Postgres preferred

Step 1: Kubernetes

We're going to install kops on our local machine and use it with config stored in the s3://k8s-reconfigureio-infra bucket to spin up a kubernetes cluster.

kops depends on kubectl so follow the (kubectl installation instructions)[https://kubernetes.io/docs/tasks/tools/install-kubectl/]

Since I (Max) am using a linux distro that supports Snap the install process becomes: sudo snap install kubectl --classic

Next up we need to install kops using the (kops installation instructions)[https://github.com/kubernetes/kops#installing]

curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
chmod +x kops-linux-amd64
sudo mv kops-linux-amd64 /usr/local/bin/kops

Next we need to tell kops to look at our S3 bucket for config. Make sure you can access this bucket. export KOPS_STATE_STORE=s3://k8s-reconfigureio-infra

kubectl is used for managing a running k8s cluster so we need to get kops to build kubectl's config file: kops export kubecfg k8s.reconfigure.io

Right, now we have all the tooling set up, let's actually manage the cluster! What you'll find in the S3 bucket is a bunch of config for a production k8s cluster apart from one key setting, the number of instances to run as part of the cluster is set to 0. What we're going to do next is edit this config so we have at least one master node and at least one worker node.

kops edit instancegroup master-us-east-1b This command will open up the config file for the master nodes and it should look like this:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: 2017-08-17T15:15:18Z
  labels:
    kops.k8s.io/cluster: k8s.reconfigure.io
  name: master-us-east-1b
spec:
  image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2017-05-02
  machineType: m3.medium
  maxSize: 0
  minSize: 0
  role: Master
  subnets:
  - us-east-1b

Change maxSize and minSize to 1 then save and exit.

Next we do the same for the worker nodes.

kops edit instancegroup nodes

This command should open up the config file for the worker nodes and it should look like this:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: 2017-08-17T15:15:19Z
  labels:
    kops.k8s.io/cluster: k8s.reconfigure.io
  name: nodes
spec:
  image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2017-05-02
  machineType: t2.medium
  maxSize: 0
  minSize: 0
  role: Node
  subnets:
  - us-east-1b

Change maxSize and minSize to 2 then save and exit.

Clone this wiki locally