Getting Started

Getting Started

To play around I suggest using multipass to create a few Ubuntu VMs. You can use ./hack/clusterplz to create a cluster of 2 nodes easily using multipass. Skate only supports private key authentication for now, so make sure your nodes are set up to allow your key.

Shell
./hack/clusterplz create

BTW: you can use ./hack/clusterplz restore to restore a clean snapshot of the nodes if things get messed up.

Install the skate CLI:

# Get list of latest release binaries
curl -s https://api.github.com/repos/skateco/skate/releases/latest | grep "browser_download_url.*tar.gz" | cut -d : -f 2,3 | tr -d \\\" | tr -d "[:blank:]"|grep -v skatelet

Download the skate binary for your platform and architecture.

Put it in your path.

Now, let’s register a cluster:

Note: Change ~/.ssh/id_rsa to the path to the private key that can access your nodes

skate create cluster my-cluster --default-user $USER --default-key ~/.ssh/id_rsa

Add the nodes:

> ./hack/clusterplz ips
192.168.76.11
192.168.76.12

# The --subnet-cidr has to be unique per node
> skate create node --name node-1 --host 192.168.76.11 --subnet-cidr 20.1.0.0/16
...
... much install

> skate create node --name node-2 --host 192.168.76.12 --subnet-cidr 20.2.0.0/16

...
... much install

Ok, now we should have a 2 node cluster that we can deploy to.

> skate get nodes
NAME                            PODS        STATUS    
node-1                          2           Healthy   
node-2                          2           Healthy  

Create a deployment

cat <<EOF | skate apply -f -
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  namespace: my-app
spec:
  replicas: 2
  template:
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
EOF

Check the deployment

skate get deployment

Now you can create a service:

cat <<EOF | skate apply -f -
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: my-app
spec:
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
skate get service

And finally an ingress:

cat <<EOF | skate apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: public
  namespace: my-app
spec:
  selector:
    app.kubernetes.io/name: nginx
  rules:
  - host: nginx.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: nginx.my-app
            port:
              number: 80