Skip to content

Instantly share code, notes, and snippets.

@mamachanko
Last active July 5, 2021 08:17
Show Gist options
  • Save mamachanko/5220d4bd1eef794e6b20d6908ab0bc92 to your computer and use it in GitHub Desktop.
Save mamachanko/5220d4bd1eef794e6b20d6908ab0bc92 to your computer and use it in GitHub Desktop.
setting up eduk8s
GET /oauth_handshake?next=%2F 302 1.527 ms - 646
{
options: {
redirect_uri: 'http://lab-k8s-fundamentals-w01-s001.demo-127-0-0-1.nip.io/oauth_callback',
scope: 'user:info',
code: 'akHssOixfNNnjm2GY1YcbIjVSIeYRg'
},
level: 'debug',
message: 'token_options',
timestamp: '2021-07-05T08:06:04.228Z'
}
{
level: 'error',
message: 'Unexpected error occurred',
timestamp: '2021-07-05T08:06:04.236Z'
}
GET /oauth_callback?code=akHssOixfNNnjm2GY1YcbIjVSIeYRg&state=d0d56631-06a3-48d5-ac96-b78f70ef5d75 500 8.280 ms - 23
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
KIND_NODE_IMAGE="kindest/node:v1.19.11@sha256:cbecc517bfad65e368cd7975d1e8a4f558d91160c051d0b1d10ff81488f5fb06"
cat <<EOF | kind create cluster --config -
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: $KIND_NODE_IMAGE
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
echo "🚪 Installing Contour ..."
kubectl apply --filename "https://projectcontour.io/quickstart/contour.yaml"
echo "🩹 Patching Contour ..."
# "Apply Kind-specific patches to forward the hostPorts to the Ingress
# Controller, set Taint Tolerations and schedule it to the custom labelled
# Node."
# (see https://kind.sigs.k8s.io/docs/user/ingress/#contour)
kubectl patch daemonsets --namespace projectcontour envoy --patch '{
"spec": {
"template": {
"spec": {
"nodeSelector": {
"ingress-ready": "true"
},
"tolerations": [
{
"key": "node-role.kubernetes.io/master",
"operator": "Equal",
"effect": "NoSchedule"
}
]
}
}
}
}'
: "${EDUK8S_VERSION:="21.05.10.1"}"
kubectl apply --kustomize "github.com/eduk8s/eduk8s?ref=$EDUK8S_VERSION"
kubectl set env deployment/eduk8s-operator --namespace eduk8s INGRESS_DOMAIN=demo-127-0-0-1.nip.io
kubectl wait --for condition=Available=True --namespace eduk8s deployments.apps eduk8s-operator --timeout 120s
kubectl apply \
--filename workshop.yaml \
--filename training-portal.yaml
stern -A lab
apiVersion: training.eduk8s.io/v1alpha1
kind: TrainingPortal
metadata:
name: lab-k8s-fundamentals
spec:
workshops:
- name: lab-k8s-fundamentals
capacity: 1
reserved: 1
expires: 1h
orphaned: 5m
apiVersion: training.eduk8s.io/v1alpha2
kind: Workshop
metadata:
name: lab-k8s-fundamentals
spec:
title: Kubernetes Fundamentals
description: Workshop on getting started with Kubernetes
url: https://github.com/eduk8s-labs/lab-k8s-fundamentals
vendor: eduk8s.io
authors:
- Graham Dumpleton
difficulty: intermediate
duration: 1h
tags:
- kubernetes
content:
image: quay.io/eduk8s-labs/lab-k8s-fundamentals:master
session:
namespaces:
budget: medium
applications:
terminal:
enabled: true
layout: split
console:
enabled: true
editor:
enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment