Skip to content

Commit 886d177

Browse files
Add workshop skeleton on authoring workshops for Educates.
1 parent b8309f2 commit 886d177

File tree

8 files changed

+348
-0
lines changed

8 files changed

+348
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ of the Educates training platform and how it can be used. The workshops are:
2222
* [Ingress Proxy](workshops/lab-ingress-proxy) - Overview of adding ingresses for local processes.
2323
* [Git Repositories](workshops/lab-git-repositories) - Overview of using local hosted Git repositories.
2424
* [Installing Educates](workshops/lab-installing-educates) - Overview of installing Educates using the CLI.
25+
* [Workshop Authoring](workshops/lab-workshop-authoring) - Overview of authoring workshops for Educates.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Workshop Authoring
2+
3+
Overview of authoring workshops for Educates.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
apiVersion: training.educates.dev/v1beta1
2+
kind: Workshop
3+
metadata:
4+
name: "lab-workshop-authoring"
5+
spec:
6+
title: "Workshop Authoring"
7+
description: "Overview of authoring workshops for Educates."
8+
publish:
9+
image: "$(image_repository)/lab-workshop-authoring-files:$(workshop_version)"
10+
workshop:
11+
files:
12+
- image:
13+
url: "$(image_repository)/lab-workshop-authoring-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:installer-clean
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+
objects:
63+
- apiVersion: v1
64+
kind: Secret
65+
metadata:
66+
name: $(session_name)-admin-vcluster-values
67+
namespace: $(workshop_namespace)
68+
stringData:
69+
values.yaml: |
70+
vcluster:
71+
image: rancher/k3s:v1.25.3-k3s1
72+
syncer:
73+
extraArgs:
74+
- --tls-san=admin-vcluster.$(session_namespace).svc.$(cluster_domain)
75+
- --out-kube-config-server=https://admin-vcluster.$(session_namespace).svc.$(cluster_domain)
76+
mapServices:
77+
fromHost:
78+
- from: $(workshop_namespace)/registry-$(session_name)
79+
to: default/registry
80+
- from: $(workshop_namespace)/localhost-$(session_name)
81+
to: default/loopback
82+
sync:
83+
ingresses:
84+
enabled: true
85+
- apiVersion: kappctrl.k14s.io/v1alpha1
86+
kind: App
87+
metadata:
88+
name: $(session_name)-admin-vcluster-package
89+
namespace: $(workshop_namespace)
90+
spec:
91+
serviceAccountName: kapp-installer
92+
syncPeriod: 720h
93+
noopDelete: true
94+
fetch:
95+
- helmChart:
96+
name: vcluster
97+
repository:
98+
url: https://charts.loft.sh
99+
template:
100+
- helmTemplate:
101+
name: admin-vcluster
102+
namespace: $(session_namespace)
103+
valuesFrom:
104+
- secretRef:
105+
name: $(session_name)-admin-vcluster-values
106+
- ytt:
107+
inline:
108+
paths:
109+
overlays.yaml: |
110+
#@ load("@ytt:data", "data")
111+
#@ load("@ytt:overlay", "overlay")
112+
#@overlay/match by=overlay.all, expects="1+"
113+
---
114+
metadata:
115+
#@overlay/match missing_ok=True
116+
ownerReferences:
117+
- apiVersion: training.educates.dev/v1beta1
118+
kind: WorkshopSession
119+
blockOwnerDeletion: true
120+
controller: true
121+
name: $(session_name)
122+
uid: $(workshop_session_uid)
123+
deploy:
124+
- kapp:
125+
rawOptions:
126+
- --app-changes-max-to-keep=5
127+
- apiVersion: secrets.educates.dev/v1beta1
128+
kind: SecretCopier
129+
metadata:
130+
name: $(session_name)-kubeconfig
131+
spec:
132+
rules:
133+
- sourceSecret:
134+
name: vc-admin-vcluster
135+
namespace: $(session_namespace)
136+
targetNamespaces:
137+
nameSelector:
138+
matchNames:
139+
- $(workshop_namespace)
140+
targetSecret:
141+
name: $(session_name)-kubeconfig
142+
- apiVersion: v1
143+
kind: Service
144+
metadata:
145+
name: registry-$(session_name)
146+
namespace: $(workshop_namespace)
147+
spec:
148+
type: ClusterIP
149+
selector:
150+
deployment: $(session_name)
151+
ports:
152+
- name: registry
153+
port: 80
154+
protocol: TCP
155+
targetPort: 5001
156+
- apiVersion: v1
157+
kind: Service
158+
metadata:
159+
name: localhost-$(session_name)
160+
namespace: $(workshop_namespace)
161+
spec:
162+
type: ClusterIP
163+
selector:
164+
deployment: $(session_name)
165+
ports:
166+
- name: renderer
167+
port: 10081
168+
protocol: TCP
169+
targetPort: 10081
170+
- apiVersion: v1
171+
kind: Secret
172+
metadata:
173+
name: educates-training-platform-values
174+
stringData:
175+
values.yaml: |
176+
clusterInfrastructure:
177+
provider: custom
178+
clusterPackages:
179+
contour:
180+
enabled: false
181+
kyverno:
182+
enabled: false
183+
clusterIngress:
184+
domain: "$(session_name).$(ingress_domain)"
185+
clusterSecurity:
186+
policyEngine: none
187+
workshopSecurity:
188+
rulesEngine: none
189+
imageRegistry:
190+
host: registry.default.svc.cluster.local
191+
namespace: ""
192+
imagePuller:
193+
prePullImages: []
194+
- apiVersion: kappctrl.k14s.io/v1alpha1
195+
kind: App
196+
metadata:
197+
name: educates-training-platform
198+
spec:
199+
noopDelete: true
200+
syncPeriod: 24h
201+
cluster:
202+
namespace: default
203+
kubeconfigSecretRef:
204+
name: vc-admin-vcluster
205+
key: config
206+
fetch:
207+
- imgpkgBundle:
208+
image: ghcr.io/jorgemoralespou/educates-installer:installer-clean
209+
deploy:
210+
- kapp:
211+
rawOptions:
212+
- --app-changes-max-to-keep=5
213+
template:
214+
- ytt:
215+
paths:
216+
- config
217+
- kbld/kbld-bundle.yaml
218+
valuesFrom:
219+
- path: kbld/kbld-images.yaml
220+
- secretRef:
221+
name: educates-training-platform-values
222+
- kbld:
223+
paths:
224+
- .imgpkg/images.yml
225+
- '-'
226+
environment:
227+
images:
228+
registries:
229+
- content:
230+
- destination: /educates-client-programs
231+
prefix: /jorgemoralespou/educates-client-programs
232+
stripPrefix: true
233+
onDemand: true
234+
urls:
235+
- https://ghcr.io
236+
objects:
237+
- apiVersion: v1
238+
kind: ServiceAccount
239+
metadata:
240+
name: kapp-installer
241+
- apiVersion: rbac.authorization.k8s.io/v1
242+
kind: ClusterRoleBinding
243+
metadata:
244+
name: kapp-installer-$(workshop_namespace)
245+
roleRef:
246+
apiGroup: rbac.authorization.k8s.io
247+
kind: ClusterRole
248+
name: cluster-admin
249+
subjects:
250+
- kind: ServiceAccount
251+
name: kapp-installer
252+
namespace: $(workshop_namespace)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# pathways:
2+
# default: workshop
3+
#
4+
# paths:
5+
# workshop:
6+
# title: "Workshop"
7+
#
8+
# steps:
9+
# - 00-workshop-overview
10+
# - 01-workshop-instructions
11+
# - 99-workshop-summary
12+
#
13+
# params:
14+
# - name: NAME
15+
# value: undefined
16+
# aliases:
17+
# - ALIAS
18+
19+
# modules:
20+
# - name: 00-workshop-overview
21+
# title: Workshop Overview
22+
# - name: 01-workshop-instructions
23+
# title: Workshop Instructions
24+
# - name: 99-workshop-summary
25+
# title: Workshop Summary
26+
27+
# params:
28+
# - name: NAME
29+
# value: undefined
30+
# aliases:
31+
# - ALIAS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Workshop Overview
3+
---
4+
5+
```terminal:execute
6+
command: educates new-workshop lab-test-workshop
7+
```
8+
9+
```terminal:execute
10+
command: cd lab-test-workshop
11+
```
12+
13+
```terminal:execute
14+
command: educates publish-workshop
15+
```
16+
17+
```terminal:execute
18+
command: educates deploy-workshop
19+
```
20+
21+
```terminal:execute
22+
command: educates browse-workshops
23+
```
24+
25+
```terminal:execute
26+
command: educates list-portals
27+
```
28+
29+
```terminal:execute
30+
command: educates view-credentials
31+
```
32+
33+
```dashboard:open-url
34+
url: http://educates-cli-ui.{{< param session_name >}}.{{< param ingress_domain >}}
35+
```
36+
37+
Need proxy-host option because vcluster no longer returning correct name from DNS when calculating it.
38+
39+
```terminal:execute
40+
command: educates serve-workshop --patch-workshop --proxy-host=loopback.default.svc.cluster.local
41+
```
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Workshop Instructions
3+
---
4+
5+
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 numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Workshop Summary
3+
---
4+
5+
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 numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
mkdir -p $HOME/bin
4+
5+
ln -s /opt/packages/educates/bin/educates-linux-$PLATFORM_ARCH $HOME/bin/educates
6+
7+
if [[ ! -f $HOME/.bash_profile || ! $(grep -q "__start_educates" $HOME/.bash_profile) ]]; then
8+
/opt/packages/educates/bin/educates-linux-$PLATFORM_ARCH completion bash >> $HOME/.bash_profile
9+
fi

0 commit comments

Comments
 (0)