Skip to content

Commit b70d30f

Browse files
Initial files.
0 parents  commit b70d30f

24 files changed

+899
-0
lines changed
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Publish Workshops
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+-alpha.[0-9]+"
8+
- "[0-9]+.[0-9]+-beta.[0-9]+"
9+
- "[0-9]+.[0-9]+-rc.[0-9]+"
10+
branches:
11+
- main
12+
- develop
13+
workflow_dispatch:
14+
15+
jobs:
16+
publish-workshops:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Install Carvel tools
24+
shell: bash
25+
run: curl -L https://carvel.dev/install.sh | bash
26+
27+
- name: Install Educates CLI
28+
shell: bash
29+
run: |
30+
imgpkg pull -i ghcr.io/vmware-tanzu-labs/educates-client-programs:2.7.2 -o /tmp/client-programs
31+
mv /tmp/client-programs/educates-linux-amd64 /usr/local/bin/educates
32+
33+
- name: Setup repository variables and release details
34+
shell: bash
35+
run: |
36+
REPOSITORY_NAME=${{github.event.repository.name}}
37+
echo "REPOSITORY_NAME=${REPOSITORY_NAME,,}" >>${GITHUB_ENV}
38+
echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
39+
echo "REPOSITORY_TAG=${GITHUB_REF##*/}" >>${GITHUB_ENV}
40+
41+
- name: Publish workshops and create workshop definitions
42+
shell: bash
43+
run: |
44+
for WORKSHOP_DIRECTORY in workshops/*; do
45+
mkdir -p ${{runner.temp}}/${WORKSHOP_DIRECTORY}/resources
46+
educates publish-workshop ${WORKSHOP_DIRECTORY} \
47+
--export-workshop ${{runner.temp}}/${WORKSHOP_DIRECTORY}/resources/workshop.yaml \
48+
--image-repository=ghcr.io/${REPOSITORY_OWNER} \
49+
--workshop-version=${REPOSITORY_TAG} \
50+
--registry-username=${{github.actor}} \
51+
--registry-password=${{secrets.GITHUB_TOKEN}}
52+
done
53+
54+
- name: Generate archives containing the workshop definitions
55+
shell: bash
56+
run: |
57+
ytt -f ${{runner.temp}}/workshops > ${{runner.temp}}/workshops.yaml
58+
(cd ${{runner.temp}}; tar cvfz workshops.tar.gz workshops)
59+
(cd ${{runner.temp}}; zip workshops.zip -r workshops)
60+
61+
- name: Create the GitHub release for the workshops
62+
id: create_release
63+
uses: softprops/action-gh-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
66+
with:
67+
tag_name: ${{env.REPOSITORY_TAG}}
68+
name: ${{env.REPOSITORY_NAME}}:${{env.REPOSITORY_TAG}}
69+
draft: false
70+
prerelease: false
71+
files: |
72+
${{runner.temp}}/workshops.tar.gz
73+
${{runner.temp}}/workshops.zip
74+
${{runner.temp}}/workshops.yaml
75+
resources/trainingportal.yaml

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Authoring Guides
2+
================
3+
4+
This repository contains a set of workshops for learning about how to create
5+
workshops for Educates. The workshops are:
6+
7+
* [Getting Started](workshops/lab-authoring-environment) - Workshop on getting started with workshop authoring.

resources/trainingportal.yaml

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Authoring Environment
2+
3+
This Educates workshop will teach you about how to install Educates to create
4+
your own authoring environment, use it to host workshops, and how to create your
5+
first workshop.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
apiVersion: training.educates.dev/v1beta1
2+
kind: Workshop
3+
metadata:
4+
name: "lab-authoring-environment"
5+
spec:
6+
title: "Authoring Environment"
7+
description: "A workshop on getting started with workshop authoring."
8+
publish:
9+
image: "$(image_repository)/labs-authoring-guides/lab-authoring-environment-files:$(workshop_version)"
10+
workshop:
11+
files:
12+
- image:
13+
url: "$(image_repository)/labs-authoring-guides/lab-authoring-environment-files:$(workshop_version)"
14+
includePaths:
15+
- /workshop/**
16+
- /exercises/**
17+
- /README.md
18+
packages:
19+
- name: educates
20+
files:
21+
- image:
22+
url: $(oci_image_cache)/educates-client-programs:3.0.0-alpha.12
23+
path: bin
24+
includePaths:
25+
- educates-linux-$(platform_arch)
26+
session:
27+
namespaces:
28+
budget: x-large
29+
security:
30+
policy: baseline
31+
token:
32+
enabled: false
33+
applications:
34+
terminal:
35+
enabled: true
36+
layout: split
37+
editor:
38+
enabled: true
39+
console:
40+
enabled: false
41+
docker:
42+
enabled: true
43+
socket:
44+
enabled: false
45+
compose:
46+
services:
47+
registry:
48+
image: registry:2.8.3
49+
ports:
50+
- "0.0.0.0:5001:5000"
51+
registry:
52+
enabled: false
53+
vcluster:
54+
enabled: false
55+
volumes:
56+
- name: admin-credentials-config
57+
secret:
58+
secretName: $(session_name)-kubeconfig
59+
volumeMounts:
60+
- name: admin-credentials-config
61+
mountPath: /opt/kubeconfig
62+
dashboards:
63+
- name: Docs
64+
url: https://docs.educates.dev/
65+
objects:
66+
- apiVersion: v1
67+
kind: Secret
68+
metadata:
69+
name: $(session_name)-admin-vcluster-values
70+
namespace: $(workshop_namespace)
71+
stringData:
72+
values.yaml: |
73+
vcluster:
74+
image: rancher/k3s:v1.25.3-k3s1
75+
syncer:
76+
extraArgs:
77+
- --tls-san=admin-vcluster.$(session_namespace).svc.$(cluster_domain)
78+
- --out-kube-config-server=https://admin-vcluster.$(session_namespace).svc.$(cluster_domain)
79+
mapServices:
80+
fromHost:
81+
- from: $(workshop_namespace)/registry-$(session_name)
82+
to: default/registry
83+
- from: $(workshop_namespace)/localhost-$(session_name)
84+
to: default/loopback
85+
sync:
86+
ingresses:
87+
enabled: true
88+
- apiVersion: kappctrl.k14s.io/v1alpha1
89+
kind: App
90+
metadata:
91+
name: $(session_name)-admin-vcluster-package
92+
namespace: $(workshop_namespace)
93+
spec:
94+
serviceAccountName: kapp-installer
95+
syncPeriod: 720h
96+
noopDelete: true
97+
fetch:
98+
- helmChart:
99+
name: vcluster
100+
repository:
101+
url: https://charts.loft.sh
102+
template:
103+
- helmTemplate:
104+
name: admin-vcluster
105+
namespace: $(session_namespace)
106+
valuesFrom:
107+
- secretRef:
108+
name: $(session_name)-admin-vcluster-values
109+
- ytt:
110+
inline:
111+
paths:
112+
overlays.yaml: |
113+
#@ load("@ytt:data", "data")
114+
#@ load("@ytt:overlay", "overlay")
115+
#@overlay/match by=overlay.all, expects="1+"
116+
---
117+
metadata:
118+
#@overlay/match missing_ok=True
119+
ownerReferences:
120+
- apiVersion: training.educates.dev/v1beta1
121+
kind: WorkshopSession
122+
blockOwnerDeletion: true
123+
controller: true
124+
name: $(session_name)
125+
uid: $(workshop_session_uid)
126+
deploy:
127+
- kapp:
128+
rawOptions:
129+
- --app-changes-max-to-keep=5
130+
- apiVersion: secrets.educates.dev/v1beta1
131+
kind: SecretCopier
132+
metadata:
133+
name: $(session_name)-kubeconfig
134+
spec:
135+
rules:
136+
- sourceSecret:
137+
name: vc-admin-vcluster
138+
namespace: $(session_namespace)
139+
targetNamespaces:
140+
nameSelector:
141+
matchNames:
142+
- $(workshop_namespace)
143+
targetSecret:
144+
name: $(session_name)-kubeconfig
145+
- apiVersion: v1
146+
kind: Service
147+
metadata:
148+
name: registry-$(session_name)
149+
namespace: $(workshop_namespace)
150+
spec:
151+
type: ClusterIP
152+
selector:
153+
deployment: $(session_name)
154+
ports:
155+
- name: registry
156+
port: 80
157+
protocol: TCP
158+
targetPort: 5001
159+
- apiVersion: v1
160+
kind: Service
161+
metadata:
162+
name: localhost-$(session_name)
163+
namespace: $(workshop_namespace)
164+
spec:
165+
type: ClusterIP
166+
selector:
167+
deployment: $(session_name)
168+
ports:
169+
- name: renderer
170+
port: 10081
171+
protocol: TCP
172+
targetPort: 10081
173+
environment:
174+
images:
175+
registries:
176+
- content:
177+
- destination: /educates-client-programs
178+
prefix: /vmware-tanzu-labs/educates-client-programs
179+
stripPrefix: true
180+
onDemand: true
181+
urls:
182+
- https://ghcr.io
183+
objects:
184+
- apiVersion: v1
185+
kind: ServiceAccount
186+
metadata:
187+
name: kapp-installer
188+
- apiVersion: rbac.authorization.k8s.io/v1
189+
kind: ClusterRoleBinding
190+
metadata:
191+
name: kapp-installer-$(workshop_namespace)
192+
roleRef:
193+
apiGroup: rbac.authorization.k8s.io
194+
kind: ClusterRole
195+
name: cluster-admin
196+
subjects:
197+
- kind: ServiceAccount
198+
name: kapp-installer
199+
namespace: $(workshop_namespace)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Workshop Overview
3+
---
4+
5+
Educates is a system for hosting interactive workshop environments in
6+
Kubernetes, or a local docker environment. It can be used for self paced or
7+
supervised workshops. It can also be useful where you need to package up demos
8+
of applications hosted in Kubernetes.
9+
10+
In this workshop you will learn the basics of how to install Educates, host
11+
workshops with Educates, and create your own workshops.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Kubernetes Cluster
3+
---
4+
5+
The full Educates training platform requires a Kubernetes cluster in which to
6+
run. It is possible to deploy single workshop instances in a local docker
7+
container runtime, however in this workshop we will only be covering deploying
8+
to Kubernetes.
9+
10+
Any Kubernetes cluster should be able to be used to deploy Educates. This
11+
includes being able to use a local Kind cluster running on your own computer, a
12+
hosted Kubernetes cluster such as EKS (AWS), GKE (GCP) or AKS (Azure), or a
13+
Kubernetes cluster you have installed yourself to an IaaS or your own compute
14+
hardware.
15+
16+
In this workshop we will be deploying to a Kubernetes virtual cluster created
17+
for you for this workshop session. This virtual cluster is running inside of the
18+
larger Kubernetes cluster that the Educates instance hosting this workshop, is
19+
running.
20+
21+
In other words, we are using Educates itself to teach you about Educates.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Packaging Mechanism
3+
---
4+
5+
Numerous packaging and installation mechanisms exist for applications to be
6+
deployed to a Kubernetes cluster. Probably the most well known is Helm
7+
templates. For Educates, we use an alternative packaging and installation
8+
mechanism utilizing the [Carvel](https://carvel.dev/) tool set.
9+
10+
The Carvel tool set consists of a number of different tools which perform tasks
11+
such as vendoring (`vendir`), YAML templating (`ytt`), container image
12+
resolution and pinning (`kbld`), and Kubernetes application deployment (`kapp`).
13+
14+
Used together these tools provide a very powerful and flexible system for
15+
distributing and installing packages for Kubernetes.
16+
17+
To install Educates you can use the Carvel command line tools from your
18+
computer, or using Carvel's in cluster `kapp-controller` operator.
19+
20+
To make it much easier to install Educates to your local computer, but also in a
21+
hosted Kubernetes cluster, Educates provides it's own CLI which bundles up the
22+
functionality of the Carvel tools so you do not need to install them on your
23+
computer to install Educates.
24+
25+
In the case of installing Educates to your local computer, the CLI is even able
26+
to create a local Kubernetes cluster for you using Kind into which Educates is
27+
then installed.
28+
29+
In this workshop we will use the CLI to install Educates into the Kubernetes
30+
virtual cluster allocated to your workshop session.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Clickable Actions
3+
---
4+
5+
The name of the CLI for Educates is as one might expect, called `educates`.
6+
Running the CLI with no arguments will yield help on the major top level
7+
commands and command groups. Run the command in the terminal of the workshop
8+
session.
9+
10+
```terminal:execute
11+
command: educates
12+
```
13+
14+
If this is your first experience with Educates you may have typed in the command
15+
manually, this however is not necessary and demonstrates the first bit of magic
16+
that Educates provides to make your workshops simpler for your users to work
17+
though.
18+
19+
The highlighed section showing the command to be executed is what in Educates we
20+
call a clickable action block. In this case of a command we want you to execute
21+
in the terminal, rather than typing it yourself, you can click on it and it will
22+
be run for your automatically in the appropriate terminal.
23+
24+
Clickable actions like this in workshop instructions for a training system are
25+
not unique to Educates, however other similar systems only apply them to the
26+
execution of terminal commands or copying text from the instructions. In
27+
Educates we use them for a much broader range of tasks, some of which you will
28+
get to see in this workshop. So whenever you see a clickable action block,
29+
rather than try and work out yourself how you should perform the required task,
30+
just click on it.
31+
32+
Note that for clickable actions for such things as commands, if you wanted to
33+
copy the command shown rather than execute it, hold down the shift key while
34+
clicking on it and the text shown will be copied to your system paste buffer
35+
rather than executing the command. You can then paste it to the terminal or
36+
into another application if you want to capture the text for later.

0 commit comments

Comments
 (0)