diff --git a/README.md b/README.md index a99be67..18bb8a2 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,17 @@ Workshops included are: how to prepopulate a virtual cluster with resources, including installation of `kapp-controller`. +* [lab-command-vcluster](workshops/lab-command-vcluster) - A workshop + demonstrating creation of a virtual cluster using the `vcluster` CLI. + * [lab-admin-vcluster](workshops/lab-admin-vcluster) - A workshop demonstrating - creation of a virtual cluster with full admin access to the cluster. + automatic creation of a virtual cluster with full admin access to the cluster + using `helm` resources. * [lab-shared-vcluster](workshops/lab-shared-vcluster) - A workshop - demonstrating creation of a shared virtual cluster for the whole environment, - with workshops users getting access to only a single namespace in the virtual - cluster. + demonstrating creation of a shared virtual cluster for the whole workshop + environment, with workshops users getting access to only a single namespace in + the virtual cluster. * [lab-remote-cluster](workshops/lab-remote-cluster) - A workshop demonstrating using a remote Kubernetes cluster, with workshops users getting access to only diff --git a/resources/trainingportal.yaml b/resources/trainingportal.yaml index 0ecc76b..74966d4 100644 --- a/resources/trainingportal.yaml +++ b/resources/trainingportal.yaml @@ -9,7 +9,7 @@ spec: updates: workshop: true sessions: - maximum: 1 + maximum: 5 workshop: defaults: reserved: 0 @@ -19,6 +19,16 @@ spec: overtime: 10m deadline: 60m orphaned: 5m + - name: lab-setup-vcluster + expires: 40m + overtime: 10m + deadline: 60m + orphaned: 5m + - name: lab-command-vcluster + expires: 40m + overtime: 10m + deadline: 60m + orphaned: 5m - name: lab-admin-vcluster expires: 40m overtime: 10m diff --git a/workshops/lab-command-vcluster/README.md b/workshops/lab-command-vcluster/README.md new file mode 100644 index 0000000..c70c16a --- /dev/null +++ b/workshops/lab-command-vcluster/README.md @@ -0,0 +1,3 @@ +# Workshop + +Workshop description diff --git a/workshops/lab-command-vcluster/resources/workshop.yaml b/workshops/lab-command-vcluster/resources/workshop.yaml new file mode 100644 index 0000000..c20f5a3 --- /dev/null +++ b/workshops/lab-command-vcluster/resources/workshop.yaml @@ -0,0 +1,44 @@ +apiVersion: training.educates.dev/v1beta1 +kind: Workshop +metadata: + name: "lab-command-vcluster" +spec: + title: "Test of using the vcluster command" + description: "Test of creating a virtual cluster using the vcluster CLI." + publish: + image: $(image_repository)/labs-vcluster-testing/lab-command-vcluster-files:$(workshop_version) + files: + - directory: + path: . + includePaths: + - /workshop/** + - /resources/** + - /README.md + excludePaths: + - /workshop/.hugo_build.lock + - /workshop/resources/** + workshop: + files: + - image: + url: $(image_repository)/labs-vcluster-testing/lab-command-vcluster-files:$(workshop_version) + session: + namespaces: + budget: large + security: + policy: baseline + applications: + terminal: + enabled: true + layout: split + console: + enabled: true + vendor: octant + editor: + enabled: true + vcluster: + enabled: false + files: + enabled: true + dashboards: + - name: Cluster + url: terminal:vcluster diff --git a/workshops/lab-command-vcluster/workshop/config.yaml b/workshops/lab-command-vcluster/workshop/config.yaml new file mode 100644 index 0000000..1946240 --- /dev/null +++ b/workshops/lab-command-vcluster/workshop/config.yaml @@ -0,0 +1,31 @@ +# pathways: +# default: workshop +# +# paths: +# workshop: +# title: "Workshop" +# +# steps: +# - 00-workshop-overview +# - 01-workshop-instructions +# - 99-workshop-summary +# +# params: +# - name: NAME +# value: undefined +# aliases: +# - ALIAS + +# modules: +# - name: 00-workshop-overview +# title: Workshop Overview +# - name: 01-workshop-instructions +# title: Workshop Instructions +# - name: 99-workshop-summary +# title: Workshop Summary + +# params: +# - name: NAME +# value: undefined +# aliases: +# - ALIAS diff --git a/workshops/lab-command-vcluster/workshop/content/00-workshop-overview.md b/workshops/lab-command-vcluster/workshop/content/00-workshop-overview.md new file mode 100644 index 0000000..2503b3e --- /dev/null +++ b/workshops/lab-command-vcluster/workshop/content/00-workshop-overview.md @@ -0,0 +1,72 @@ +--- +title: Workshop Overview +--- + +```terminal:execute +session: vcluster +command: vcluster create test --connect +``` + +```terminal:execute +command: vcluster list +``` + +```terminal:execute +command: kubectl config get-contexts +``` + +```terminal:execute +command: kubectl config set-context --current --namespace default +``` + +```terminal:execute +command: kubectl config get-contexts +``` + +```terminal:execute +command: kubectl get nodes +``` + +```terminal:execute +command: kubectl get namespaces +``` + +```terminal:execute +command: kubectl get serviceaccounts +``` + +```terminal:execute +command: kubectl get nodes --context educates +``` + +```terminal:execute +command: kubectl get namespaces --context educates +``` + +```terminal:execute +command: kubectl get serviceaccounts --context educates --namespace default +``` + +```dashboard:open-dashboard +name: Console +``` + +```terminal:execute +command: vcluster delete test +``` + +```terminal:execute +command: vcluster list +``` + +```terminal:execute +command: kubectl config get-contexts +``` + +```dashboard:open-dashboard +name: Cluster +``` + +```terminal:interrupt +session: vcluster +``` diff --git a/workshops/lab-command-vcluster/workshop/content/01-workshop-instructions.md b/workshops/lab-command-vcluster/workshop/content/01-workshop-instructions.md new file mode 100644 index 0000000..313f51f --- /dev/null +++ b/workshops/lab-command-vcluster/workshop/content/01-workshop-instructions.md @@ -0,0 +1,5 @@ +--- +title: Workshop Instructions +--- + +This is the first page of the workshop instructions, create as many separate pages as you need to. If necessary pages can be located in sub directories to provided grouping. diff --git a/workshops/lab-command-vcluster/workshop/content/99-workshop-summary.md b/workshops/lab-command-vcluster/workshop/content/99-workshop-summary.md new file mode 100644 index 0000000..dfd00c3 --- /dev/null +++ b/workshops/lab-command-vcluster/workshop/content/99-workshop-summary.md @@ -0,0 +1,5 @@ +--- +title: Workshop Summary +--- + +This is the last page of the workshop. Include in this page a summary of the workshop and any links to resources relevant to the workshop. This ensures anyone doing the workshop has material they can research later to learn more. diff --git a/workshops/lab-command-vcluster/workshop/setup.d/download-vcluster-cli.sh b/workshops/lab-command-vcluster/workshop/setup.d/download-vcluster-cli.sh new file mode 100755 index 0000000..f47394d --- /dev/null +++ b/workshops/lab-command-vcluster/workshop/setup.d/download-vcluster-cli.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir ~/bin + +curl -L -o ~/bin/vcluster https://github.com/loft-sh/vcluster/releases/download/v0.15.7/vcluster-linux-${PLATFORM_ARCH} + +chmod +x ~/bin/vcluster