Skip to content

Commit

Permalink
Add workshop demonstrating vcluster CLI.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Sep 23, 2023
1 parent 8828977 commit 9366764
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion resources/trainingportal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
updates:
workshop: true
sessions:
maximum: 1
maximum: 5
workshop:
defaults:
reserved: 0
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions workshops/lab-command-vcluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Workshop

Workshop description
44 changes: 44 additions & 0 deletions workshops/lab-command-vcluster/resources/workshop.yaml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions workshops/lab-command-vcluster/workshop/config.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9366764

Please sign in to comment.