Skip to content

Commit

Permalink
Refactor workshop definitions to make use of ytt templating.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Aug 9, 2023
1 parent f86a607 commit ba616a3
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.hugo_build.lock
39 changes: 33 additions & 6 deletions workshops/lab-builtin-vcluster/resources/workshop.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
#@ load("@ytt:data", "data")

#@ imageCaching = getattr(data.values, "imageCaching", True)
#@ localContent = getattr(data.values, "localContent", False)

---
apiVersion: training.educates.dev/v1beta1
kind: Workshop
metadata:
name: "lab-builtin-vcluster"
spec:
title: "Test of builtin virtual cluster"
description: "Test of using builtin support for creating a virtual cluster."
publish:
image: $(image_repository)/labs-vcluster-testing/lab-builtin-vcluster-files:$(workshop_version)
files:
- directory:
path: workshop
path: workshop
workshop:
files:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/workshops/lab-builtin-vcluster/.tgz
includePaths:
- /workshop/**
url: http://$(assets_repository)/.tgz
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-builtin-vcluster-files:$(workshop_version)
#@ end
session:
namespaces:
budget: medium
security:
token:
enabled: false
applications:
workshop:
enabled: true
#@ if localContent:
proxy:
protocol: http
host: localhost.$(ingress_domain)
port: 10081
changeOrigin: false
headers:
- name: X-Session-Name
value: $(session_name)
#@ end
terminal:
enabled: true
layout: split
Expand All @@ -30,7 +57,7 @@ spec:
environment:
assets:
files:
#@ if imageCaching:
- image:
url: $(image_repository)/labs-vcluster-testing-files:latest
includePaths:
- /workshops/lab-builtin-vcluster/**
url: $(image_repository)/labs-vcluster-testing/lab-builtin-vcluster-files:$(workshop_version)
#@ end
31 changes: 31 additions & 0 deletions workshops/lab-builtin-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
9 changes: 0 additions & 9 deletions workshops/lab-builtin-vcluster/workshop/modules.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions workshops/lab-builtin-vcluster/workshop/workshop.yaml

This file was deleted.

57 changes: 51 additions & 6 deletions workshops/lab-remote-cluster/resources/workshop.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,57 @@
#@ load("@ytt:data", "data")

#@ imageCaching = getattr(data.values, "imageCaching", True)
#@ localContent = getattr(data.values, "localContent", False)

---
apiVersion: training.educates.dev/v1beta1
kind: Workshop
metadata:
name: "lab-remote-cluster"
spec:
title: "Test of using a remote cluster"
description: "Test of using remote cluster and single namespace per session."
publish:
image: $(image_repository)/labs-vcluster-testing/lab-remote-cluster-files:$(workshop_version)
files:
- directory:
path: workshop
path: workshop
- directory:
path: ../../packages
path: packages
workshop:
files:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/workshops/lab-remote-cluster/.tgz
url: http://$(assets_repository)/.tgz
includePaths:
- workshop/**
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-remote-cluster-files:$(workshop_version)
includePaths:
- /workshop/**
- workshop/**
#@ end
session:
namespaces:
budget: medium
security:
token:
enabled: false
applications:
workshop:
enabled: true
#@ if localContent:
proxy:
protocol: http
host: localhost.$(ingress_domain)
port: 10081
changeOrigin: false
headers:
- name: X-Session-Name
value: $(session_name)
#@ end
terminal:
enabled: true
layout: split
Expand Down Expand Up @@ -105,9 +139,16 @@ spec:
name: admin-credentials-$(session_name)
key: config
fetch:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/packages/developer-namespace/.tgz
path: packages/developer-namespace
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-remote-cluster-files:$(workshop_version)
includePaths:
- packages/developer-namespace/**
#@ end
template:
- ytt:
paths:
Expand All @@ -123,10 +164,7 @@ spec:
assets:
files:
- image:
url: $(image_repository)/labs-vcluster-testing-files:latest
includePaths:
- /workshops/lab-remote-cluster/**
- /packages/**
url: $(image_repository)/labs-vcluster-testing/lab-remote-cluster-files:latest
objects:
- apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -163,9 +201,16 @@ spec:
syncPeriod: 720h
noopDelete: true
fetch:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/packages/cluster-credentials/.tgz
path: packages/cluster-credentials
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-remote-cluster-files:$(workshop_version)
includePaths:
- packages/cluster-credentials/**
#@ end
template:
- ytt:
paths:
Expand Down
31 changes: 31 additions & 0 deletions workshops/lab-remote-cluster/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
9 changes: 0 additions & 9 deletions workshops/lab-remote-cluster/workshop/modules.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions workshops/lab-remote-cluster/workshop/workshop.yaml

This file was deleted.

57 changes: 51 additions & 6 deletions workshops/lab-shared-vcluster/resources/workshop.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,57 @@
#@ load("@ytt:data", "data")

#@ imageCaching = getattr(data.values, "imageCaching", True)
#@ localContent = getattr(data.values, "localContent", False)

---
apiVersion: training.educates.dev/v1beta1
kind: Workshop
metadata:
name: "lab-shared-vcluster"
spec:
title: "Test of shared virtual cluster"
description: "Test of using shared virtual cluster and single namespace per session."
publish:
image: $(image_repository)/labs-vcluster-testing/lab-shared-vcluster-files:$(workshop_version)
files:
- directory:
path: workshop
path: workshop
- directory:
path: ../../packages
path: packages
workshop:
files:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/workshops/lab-shared-vcluster/.tgz
url: http://$(assets_repository)/.tgz
includePaths:
- workshop/**
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-shared-vcluster-files:$(workshop_version)
includePaths:
- /workshop/**
- workshop/**
#@ end
session:
namespaces:
budget: medium
security:
token:
enabled: false
applications:
workshop:
enabled: true
#@ if localContent:
proxy:
protocol: http
host: localhost.$(ingress_domain)
port: 10081
changeOrigin: false
headers:
- name: X-Session-Name
value: $(session_name)
#@ end
terminal:
enabled: true
layout: split
Expand Down Expand Up @@ -84,9 +118,16 @@ spec:
name: vc-shared-vcluster
key: config
fetch:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/packages/developer-namespace/.tgz
path: packages/developer-namespace
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-shared-vcluster-files:$(workshop_version)
includePaths:
- packages/developer-namespace/**
#@ end
template:
- ytt:
paths:
Expand All @@ -102,10 +143,7 @@ spec:
assets:
files:
- image:
url: $(image_repository)/labs-vcluster-testing-files:latest
includePaths:
- /workshops/lab-shared-vcluster/**
- /packages/**
url: $(image_repository)/labs-vcluster-testing/lab-shared-vcluster-files:latest
objects:
- apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -180,9 +218,16 @@ spec:
syncPeriod: 720h
noopDelete: true
fetch:
#@ if imageCaching:
- http:
url: http://$(assets_repository)/packages/cluster-credentials/.tgz
path: packages/cluster-credentials
#@ else:
- image:
url: $(image_repository)/labs-vcluster-testing/lab-shared-vcluster-files:$(workshop_version)
includePaths:
- packages/cluster-credentials/**
#@ end
template:
- ytt:
paths:
Expand Down

0 comments on commit ba616a3

Please sign in to comment.