From a5b82274963c020a58394b705849389a80b51083 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Mon, 1 Aug 2022 10:46:58 +1000 Subject: [PATCH] Add Spring Boot on Kubernetes workshop from separate repository using vendir. --- README.md | 4 + resources/trainingportal.yaml | 4 + vendir.lock.yml | 9 ++ vendir.yml | 12 +++ .../resources/workshop.yaml | 88 +++++++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 vendir.lock.yml create mode 100644 vendir.yml create mode 100644 workshops/lab-spring-boot-on-k8s/resources/workshop.yaml diff --git a/README.md b/README.md index 33f454c..6803292 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,7 @@ Workshops included are: * [lab-containerizing-spring](workshops/lab-containerizing-spring) - A workshop describing how to containerize a Spring Boot application and run it in docker. + +* [lab-spring-boot-on-k8s](workshops/lab-spring-boot-on-k8s) - A workshop which + steps through creating a Spring Boot application, containerizing it, and + deploying it to Kubernetes. diff --git a/resources/trainingportal.yaml b/resources/trainingportal.yaml index b69547e..b7d1c08 100644 --- a/resources/trainingportal.yaml +++ b/resources/trainingportal.yaml @@ -20,3 +20,7 @@ spec: capacity: 1 expires: 15m orphaned: 5m + - name: lab-spring-boot-on-k8s + capacity: 1 + expires: 60m + orphaned: 5m diff --git a/vendir.lock.yml b/vendir.lock.yml new file mode 100644 index 0000000..1830466 --- /dev/null +++ b/vendir.lock.yml @@ -0,0 +1,9 @@ +apiVersion: vendir.k14s.io/v1alpha1 +directories: +- contents: + - githubRelease: + tag: "4.0" + url: https://api.github.com/repos/vmware-tanzu-labs/lab-spring-boot-on-k8s/releases/70829547 + path: . + path: workshops/lab-spring-boot-on-k8s/resources +kind: LockConfig diff --git a/vendir.yml b/vendir.yml new file mode 100644 index 0000000..25e8376 --- /dev/null +++ b/vendir.yml @@ -0,0 +1,12 @@ +apiVersion: vendir.k14s.io/v1alpha1 +kind: Config +directories: +- path: workshops/lab-spring-boot-on-k8s/resources + contents: + - path: . + githubRelease: + slug: vmware-tanzu-labs/lab-spring-boot-on-k8s + tag: "4.0" + assetNames: + - workshop.yaml + disableAutoChecksumValidation: true diff --git a/workshops/lab-spring-boot-on-k8s/resources/workshop.yaml b/workshops/lab-spring-boot-on-k8s/resources/workshop.yaml new file mode 100644 index 0000000..3e91f2d --- /dev/null +++ b/workshops/lab-spring-boot-on-k8s/resources/workshop.yaml @@ -0,0 +1,88 @@ +apiVersion: training.educates.dev/v1beta1 +kind: Workshop +metadata: + name: lab-spring-boot-on-k8s +spec: + title: Spring Boot on Kubernetes + description: Introduction to Spring Boot on Kubernetes + workshop: + image: jdk17-environment:* + files: + - image: + url: ghcr.io/vmware-tanzu-labs/lab-spring-boot-on-k8s-files:4.0 + includePaths: + - /workshop/** + - /exercises/** + - /README.md + - path: .m2 + image: + url: ghcr.io/vmware-tanzu-labs/lab-spring-boot-on-k8s-maven:latest + session: + namespaces: + budget: large + security: + policy: baseline + resources: + memory: 2Gi + applications: + terminal: + enabled: true + layout: split + console: + enabled: true + vendor: octant + editor: + enabled: true + registry: + enabled: true + docker: + enabled: true + dashboards: + - name: Initializr + url: $(ingress_protocol)://initializr-$(session_namespace).$(ingress_domain) + ingresses: + - name: initializr + protocol: http + host: initializr.$(workshop_namespace).svc.cluster.local + port: 8080 + environment: + objects: + - apiVersion: apps/v1 + kind: Deployment + metadata: + name: initializr + labels: + app: initializr + spec: + replicas: 1 + selector: + matchLabels: + app: initializr + template: + metadata: + labels: + app: initializr + spec: + containers: + - name: dashboard + image: ghcr.io/vmware-tanzu-labs/educates-spring-initializr:2.0 + imagePullPolicy: Always + ports: + - name: 8080-tcp + containerPort: 8080 + protocol: TCP + - apiVersion: v1 + kind: Service + metadata: + name: initializr + labels: + app: initializr + spec: + type: ClusterIP + selector: + app: initializr + ports: + - name: 8080-tcp + port: 8080 + protocol: TCP + targetPort: 8080