### Install VS Code extensions via setup script Source: https://docs.educates.dev/en/stable/_sources/workshop-migration/learning-center.md.txt Example bash script for installing Java-related VS Code extensions during container startup. ```bash #!/bin/bash set +x code-server --install-extension Pivotal.vscode-spring-boot@1.30.0 code-server --install-extension redhat.java@1.3.0 code-server --install-extension vscjava.vscode-java-debug@0.38.0 code-server --install-extension vscjava.vscode-java-dependency@0.19.0 code-server --install-extension vscjava.vscode-java-test@0.34.1 code-server --install-extension vscjava.vscode-maven@0.35.0 code-server --install-extension vscjava.vscode-spring-initializr@0.8.0 ``` -------------------------------- ### Rebuild Workshop Setup Source: https://docs.educates.dev/en/stable/_sources/workshop-content/working-on-content.md.txt Command to re-run setup scripts located in /opt/workshop/setup.d. ```bash rebuild-workshop ``` -------------------------------- ### Install Educates Package Source: https://docs.educates.dev/en/stable/_sources/installation-guides/carvel-based-installation.md.txt Deploys the Educates training platform using the latest installer manifest. ```bash kubectl apply -f https://github.com/educates/educates-training-platform/releases/latest/download/educates-installer-app.yaml ``` -------------------------------- ### Installing System Packages as Root Source: https://docs.educates.dev/en/stable/_sources/workshop-content/building-an-image.md.txt Pattern for switching to root to install packages and returning to the default user. ```text USER root RUN ... commands to install system packages USER 1001 ``` -------------------------------- ### Installing System Packages with HOME Override Source: https://docs.educates.dev/en/stable/_sources/workshop-content/building-an-image.md.txt Recommended pattern for installing packages as root while preventing configuration files from being written to the user home directory. ```text USER root RUN HOME=/root && \ ... commands to install system packages USER 1001 ``` -------------------------------- ### Run Workshop Server Source: https://docs.educates.dev/en/stable/_sources/workshop-content/working-on-content.md.txt Command to start the workshop server after manual configuration. ```bash educates serve-workshop ``` -------------------------------- ### Run Workshop Server with Token Source: https://docs.educates.dev/en/stable/_sources/workshop-content/working-on-content.md.txt Command to start the workshop server with a specified access token. ```bash educates serve-workshop --access-token secret-token ``` -------------------------------- ### Deploy with verbose output Source: https://docs.educates.dev/en/stable/_sources/installation-guides/cli-based-installation.md.txt Use the --verbose flag to debug the installation process. ```shell educates deploy-platform --config config.yaml --verbose ``` -------------------------------- ### Create Installer Service Account Source: https://docs.educates.dev/en/stable/_sources/installation-guides/carvel-based-installation.md.txt Applies the RBAC configuration required for the Educates installer to function with cluster-admin privileges. ```bash kubectl apply -f https://github.com/educates/educates-training-platform/releases/latest/download/educates-installer-app-rbac.yaml ``` -------------------------------- ### Configure Workshop Start and Finish Dialogs Source: https://docs.educates.dev/en/stable/_sources/installation-guides/configuration-settings.md.txt Provide custom content for dialogs shown when a workshop starts or finishes. ```yaml websiteStyling: workshopStarted: html: "" workshopFinished: html: "" ``` -------------------------------- ### Install kapp-controller in Virtual Cluster Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Defines an App resource to install kapp-controller into the virtual cluster. ```yaml spec: session: objects: - apiVersion: kappctrl.k14s.io/v1alpha1 kind: App metadata: name: kapp-controller.0.44.9 namespace: $(vcluster_namespace) spec: noopDelete: true syncPeriod: 24h cluster: namespace: default kubeconfigSecretRef: name: $(vcluster_secret) key: config fetch: - http: url: https://github.com/carvel-dev/kapp-controller/releases/download/v0.44.9/release.yml template: - ytt: {} deploy: - kapp: {} ``` -------------------------------- ### Install system packages with HOME override Source: https://docs.educates.dev/en/stable/workshop-content/building-an-image.html Recommended pattern that sets the HOME environment variable to /root during installation to prevent configuration files from being written to the user home directory. ```dockerfile USER root RUN HOME=/root && \ ... commands to install system packages USER 1001 ``` -------------------------------- ### Add an init container for setup Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Defines an init container to execute setup scripts from a mounted secret, useful for sensitive operations. ```yaml spec: session: initContainers: - name: special-workshop-setup image: $(workshop_image) imagePullPolicy: $(workshop_image_pull_policy) command: ["/opt/special-workshop-setup-scripts/setup.sh"] volumeMounts: - name: special-workshop-setup-scripts mountPath: /opt/special-workshop-setup-scripts volumes: - name: special-workshop-setup-scripts secret: secretName: $(session_name)-special-workshop-setup-scripts defaultMode: 0755 objects: - apiVersion: v1 kind: Secret metadata: name: $(session_name)-special-workshop-setup-scripts namespace: $(workshop_namespace) stringData: setup.sh: | #!/bin/bash ... ``` -------------------------------- ### Connect via SSH Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Example command to connect to the workshop container via SSH. ```shell ssh eduk8s@$SESSION_NAME.$WORKSHOP_NAMESPACE ``` -------------------------------- ### Install VS Code extensions Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Command to install VS Code extensions during the Docker image build process. ```text code-server --install-extension vendor.extension ``` -------------------------------- ### Install kapp-controller Source: https://docs.educates.dev/en/stable/_sources/installation-guides/carvel-based-installation.md.txt Deploys the Carvel kapp-controller to the Kubernetes cluster if it is not already present. ```bash kubectl apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml ``` -------------------------------- ### Example Status Output Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/client-authentication.md.txt The expected output format when describing the training portal resource. ```text Status: educates: Clients: Robot: Id: ACZpcaLIT3qr725YWmXu8et9REl4HBg1 Secret: t5IfXbGZQThAKR43apoc9usOFVDv2BLE Credentials: Admin: Password: 0kGmMlYw46BZT2vCntyrRuFf1gQq5ohi Username: educates Robot: Password: QrnY67ME9yGasNhq2OTbgWA4RzipUvo5 Username: robot@educates ``` -------------------------------- ### Deploy the Educates platform Source: https://docs.educates.dev/en/stable/_sources/installation-guides/cli-based-installation.md.txt Installs Educates into a Kubernetes cluster using a specified configuration file. ```shell educates deploy-platform --config config.yaml ``` -------------------------------- ### Deploy with custom kubeconfig Source: https://docs.educates.dev/en/stable/_sources/installation-guides/cli-based-installation.md.txt Specify an alternate kubeconfig file for the installation. ```shell educates deploy-platform --config config.yaml --kubeconfig kubeconfig.yaml ``` -------------------------------- ### Example DNS resolver output Source: https://docs.educates.dev/en/stable/_sources/getting-started/local-environment.md.txt Expected output format when querying the local DNS resolver. ```text resolver #8 domain : educates-local-dev.test nameserver[0] : 127.0.0.1 flags : Request A records, Request AAAA records reach : 0x00030002 (Reachable,Local Address,Directly Reachable Address) ``` -------------------------------- ### Construct WebDAV URL Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Examples for constructing the WebDAV endpoint URL from the terminal or within workshop content. ```text $INGRESS_PROTOCOL://$SESSION_NAME.$INGRESS_DOMAIN/webdav/ ``` ```text {{ingress_protocol}}://{{session_name}}.{{ingress_domain}}/webdav/ ``` -------------------------------- ### Example Session Response Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/session-management.md.txt The JSON response returned after querying or extending a workshop session. ```json { "name": "lab-markdown-sample-w01-s001", "namespace": "lab-markdown-sample-w01-s001", "user": "8d2d0c8b-6ff5-4244-b136-110fd8d8431a", "started": "2020-07-31T03:57:33.942Z", "expires": "2020-07-31T04:57:33.942Z", "countdown": 3353, "extendable": false } ``` -------------------------------- ### Examiner test script implementation Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-instructions.md.txt A bash script example for the examiner to verify if a specific pod is running. ```bash #!/bin/bash kubectl get pods --field-selector=status.phase=Running -o name | egrep -e "^pod/$1$" if [ "$?" != "0" ]; then exit 1 fi exit 0 ``` -------------------------------- ### Create copyable download command Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Example of a clickable action to copy a curl command for downloading files with authentication. ```text ```workshop:copy text: curl -o config.yaml {{ingress_protocol}}://{{session_name}}.{{ingress_domain}}/files/config.yaml?token={{services_password}} ``` ``` -------------------------------- ### Deploy local DNS resolver on macOS Source: https://docs.educates.dev/en/stable/_sources/getting-started/local-environment.md.txt Starts the dnsmasq instance within the local docker daemon. ```bash educates local resolver deploy ``` -------------------------------- ### GET /workshops/catalog/environments/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/workshops-catalog.md.txt Retrieves a list of workshop environments hosted by the training portal. By default, it returns only environments in the 'RUNNING' state. ```APIDOC ## GET /workshops/catalog/environments/ ### Description Retrieves a list of workshop environments and their associated workshops. By default, only environments in a 'RUNNING' state are returned. ### Method GET ### Endpoint /workshops/catalog/environments/ ### Parameters #### Query Parameters - **state** (string) - Optional - The state of the workshop environments to return. Can be specified multiple times to include multiple states (e.g., RUNNING, STOPPING). ### Response #### Success Response (200) - **portal** (object) - Information about the training portal. - **environments** (array) - A list of available workshop environments. #### Response Example { "portal": { "name": "lab-markdown-sample", "labels": {}, "uid": "91dfa283-fb60-403b-8e50-fb30943ae87d", "generation": 2, "url": "https://lab-markdown-sample-ui.test", "sessions": { "maximum": 0, "registered": 0, "anonymous": 0, "allocated": 1 } }, "environments": [ { "name": "lab-markdown-sample-w01", "state": "RUNNING", "workshop": { "name": "lab-markdown-sample", "title": "Markdown Sample", "description": "A sample workshop using Markdown", "vendor": "", "authors": [], "difficulty": "", "duration": "", "tags": [], "labels": {}, "logo": "", "url": "" }, "duration": 3600, "capacity": 10, "reserved": 2, "allocated": 1, "available": 2 } ] } ``` -------------------------------- ### Configure Educates for Kind Source: https://docs.educates.dev/en/stable/_sources/installation-guides/installation-instructions.md.txt Minimal YAML configuration required when installing Educates on a Kind-based Kubernetes cluster. ```yaml # Specify the infrastructure provider hosting the Kubernetes cluster. clusterInfrastructure: provider: kind # Specify the ingress domain to be used to access the workshops hosted by # the Educates installation. clusterIngress: domain: educates-local-dev.test ``` -------------------------------- ### Configure Linux dnsmasq Source: https://docs.educates.dev/en/stable/_sources/getting-started/local-environment.md.txt Example configuration line for mapping an ingress domain to an IP address on Linux. ```text address=/educates-local-dev.test/192.168.168.1 ``` -------------------------------- ### GET /api/v1/tenants/ Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Get details for a specific tenant. ```APIDOC ## GET /api/v1/tenants/ ### Description Get details for a specific tenant. ### Method GET ### Endpoint /api/v1/tenants/ ### Parameters #### Path Parameters - **tenant** (string) - Required - The identifier of the tenant. ``` -------------------------------- ### Configure WorkshopSession ingress class Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-session.md.txt Example showing how to specify an ingress class and TLS secret for the workshop session. ```yaml apiVersion: training.educates.dev/v1beta1 kind: WorkshopSession metadata: name: lab-markdown-sample spec: environment: name: lab-markdown-sample-user1 session: ingress: domain: training.educates.dev secret: training.educates.dev-tls class: nginx ``` -------------------------------- ### Pre-create Git repository Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Script to be used in setup.d to clone a bare repository on the Git server. ```bash #!/bin/bash set -eo pipefail set -x cd /opt/git/repositories git clone --bare https://github.com/example/project.git ``` -------------------------------- ### GET /api/v1/clusters/ Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Get details for a specific cluster. ```APIDOC ## GET /api/v1/clusters/ ### Description Get details for a specific cluster. ### Method GET ### Endpoint /api/v1/clusters/ ### Parameters #### Path Parameters - **cluster** (string) - Required - The identifier of the cluster. ``` -------------------------------- ### GET /api/v1/clients/ Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Get details for a specific client. ```APIDOC ## GET /api/v1/clients/ ### Description Get details for a specific client. ### Method GET ### Endpoint /api/v1/clients/ ### Parameters #### Path Parameters - **client** (string) - Required - The identifier of the client. ``` -------------------------------- ### Define Workshop with Custom Image Source: https://docs.educates.dev/en/stable/_sources/workshop-content/working-on-content.md.txt Example Workshop resource configuration using a mutable image tag for development. ```yaml apiVersion: training.educates.dev/v1beta1 kind: Workshop metadata: name: lab-sample-workshop spec: title: Sample Workshop description: A sample workshop workshop: image: ghcr.io/educates/lab-sample-workshop:latest ``` -------------------------------- ### Create a training portal with labels Source: https://docs.educates.dev/en/stable/_sources/lookup-service/custom-resources.md.txt Use the Educates CLI to define custom labels for a training portal during creation. ```bash educates create-portal -p portal-1 -l environment=production ``` -------------------------------- ### Download and Install Educates CLI Source: https://docs.educates.dev/en/stable/_sources/getting-started/quick-start-guide.md.txt Commands to download the latest Educates binary and set execution permissions for different operating systems and architectures. ```bash curl -o educates -sL https://github.com/educates/educates-training-platform/releases/latest/download/educates-linux-amd64 && chmod +x educates ``` ```bash curl -o educates -sL https://github.com/educates/educates-training-platform/releases/latest/download/educates-linux-arm64 && chmod +x educates ``` ```bash curl -o educates -sL https://github.com/educates/educates-training-platform/releases/latest/download/educates-darwin-amd64 && chmod +x educates ``` ```bash curl -o educates -sL https://github.com/educates/educates-training-platform/releases/latest/download/educates-darwin-arm64 && chmod +x educates ``` -------------------------------- ### GET /api/v1/clusters//portals/ Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Get details for a specific portal on a cluster, including capacity and allocation. ```APIDOC ## GET /api/v1/clusters//portals/ ### Description Get details for a specific portal on a cluster, including capacity and allocation. ### Method GET ### Endpoint /api/v1/clusters//portals/ ### Parameters #### Path Parameters - **cluster** (string) - Required - The identifier of the cluster. - **portal** (string) - Required - The identifier of the portal. ``` -------------------------------- ### Initialize a workshop with the classic renderer Source: https://docs.educates.dev/en/stable/_sources/getting-started/workshop-templates.md.txt Creates a new workshop using the deprecated classic renderer. ```bash educates new-workshop lab-new-workshop --template classic ``` -------------------------------- ### Serve static workshop instructions Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Specifies a directory path for serving pre-generated static HTML files from the workshop container. ```yaml spec: session: applications: workshop: path: public ``` -------------------------------- ### Workshop Event JSON Payload Example Source: https://docs.educates.dev/en/stable/_sources/installation-guides/configuration-settings.md.txt Example of the JSON structure sent to the webhook for standard workshop events. ```json { "portal": { "name": "lab-markdown-sample", "uid": "91dfa283-fb60-403b-8e50-fb30943ae87d", "generation": 3, "url": "https://lab-markdown-sample-ui.training.educates.dev" }, "event": { "name": "Session/Started", "timestamp": "2021-03-18T02:50:40.861392+00:00", "user": "c66db34e-3158-442b-91b7-25391042f037", "session": "lab-markdown-sample-w01-s001", "environment": "lab-markdown-sample-w01", "workshop": "lab-markdown-sample", "data": {} } } ``` -------------------------------- ### Deploy Workshop via CLI Source: https://docs.educates.dev/en/stable/_sources/getting-started/workshop-templates.md.txt Use the Educates CLI to deploy a workshop directly from a GitHub release URL. ```bash educates deploy-workshop -f https://github.com/educates/lab-k8s-fundamentals/releases/latest/download/workshop.yaml ``` -------------------------------- ### Deploy a workshop Source: https://docs.educates.dev/en/stable/_sources/getting-started/creating-a-workshop.md.txt Creates the workshop environment within the Kubernetes cluster. ```bash educates deploy-workshop ``` -------------------------------- ### GET /api/v1/clusters//portals//environments/ Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Get details for a specific workshop environment, including capacity, reserved slots, and allocation. ```APIDOC ## GET /api/v1/clusters//portals//environments/ ### Description Get details for a specific workshop environment, including capacity, reserved slots, and allocation. ### Method GET ### Endpoint /api/v1/clusters//portals//environments/ ### Parameters #### Path Parameters - **cluster** (string) - Required - The identifier of the cluster. - **portal** (string) - Required - The identifier of the portal. - **environment** (string) - Required - The identifier of the environment. ``` -------------------------------- ### Protocol Configuration Scenarios Source: https://docs.educates.dev/en/stable/_sources/installation-guides/secure-http-connections.md.txt A reference table mapping deployment scenarios to TLS and protocol settings. ```text | Scenario | TLS Certificate in Educates | Protocol Setting | |-----------------------------------|-----------------------------|------------------| | No secure ingress (HTTP only) | No | (default) | | Direct TLS at ingress router | Yes | (automatic) | | External proxy forwarding HTTP | No | "https" | | External proxy re-encrypting | Yes (private certificate) | (automatic) | | Cloudflare proxy with origin cert | Yes (origin certificate) | (automatic) | | Cloudflare Tunnel | No | "https" | | AWS ALB with ACM | No | "https" | | cert-manager with own CA | Yes (via secret reference) | (automatic) | | cert-manager with Let's Encrypt | Yes (via secret reference) | (automatic) | ``` -------------------------------- ### Create a local Kubernetes cluster Source: https://docs.educates.dev/en/stable/_sources/getting-started/quick-start-guide.md.txt Initializes a Kind-based Kubernetes cluster with the necessary Educates components and security policies. ```bash educates create-cluster ``` -------------------------------- ### GET /api/v1/tenants Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List all configured tenants with their mapped clients. ```APIDOC ## GET /api/v1/tenants ### Description List all configured tenants with their mapped clients. ### Method GET ### Endpoint /api/v1/tenants ``` -------------------------------- ### Create the configuration namespace Source: https://docs.educates.dev/en/stable/_sources/lookup-service/custom-resources.md.txt Ensure the educates-config namespace exists before applying configuration resources. ```bash kubectl create ns educates-config ``` -------------------------------- ### Define Session Resources in Workshop Definition Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Example configuration for deploying a registry service and deployment within a workshop session. ```yaml spec: session: objects: - apiVersion: apps/v1 kind: Deployment metadata: name: registry spec: replicas: 1 selector: matchLabels: deployment: registry strategy: type: Recreate template: metadata: labels: deployment: registry spec: containers: - name: registry image: registry.hub.docker.com/library/registry:2.6.1 imagePullPolicy: IfNotPresent ports: - containerPort: 5000 protocol: TCP env: - name: REGISTRY_STORAGE_DELETE_ENABLED value: "true" - apiVersion: v1 kind: Service metadata: name: registry spec: type: ClusterIP ports: - port: 80 targetPort: 5000 selector: deployment: registry ``` -------------------------------- ### GET /api/v1/portals Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List all training portals across all clusters. ```APIDOC ## GET /api/v1/portals ### Description List all training portals across all clusters. ### Method GET ### Endpoint /api/v1/portals ``` -------------------------------- ### GET /api/v1/clusters Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List all registered clusters with their names and labels. ```APIDOC ## GET /api/v1/clusters ### Description List all registered clusters with their names and labels. ### Method GET ### Endpoint /api/v1/clusters ``` -------------------------------- ### List configuration resources Source: https://docs.educates.dev/en/stable/_sources/lookup-service/custom-resources.md.txt Retrieve the current configuration resources from the educates-config namespace. ```bash kubectl get clusterconfigs -n educates-config kubectl get tenantconfigs -n educates-config kubectl get clientconfigs -n educates-config ``` -------------------------------- ### GET /session//schedule/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/session-management.md.txt Checks if a workshop session is extendable. ```APIDOC ## GET /session//schedule/ ### Description Determines if a workshop session is extendable by checking the extendable property in the response. ### Method GET ### Endpoint /session//schedule/ ### Parameters #### Path Parameters - **name** (string) - Required - The name of the workshop session. ``` -------------------------------- ### Initialize a new workshop Source: https://docs.educates.dev/en/stable/_sources/getting-started/workshop-templates.md.txt Creates a new workshop directory structure using the default hugo renderer. ```bash educates new-workshop lab-new-workshop ``` -------------------------------- ### GET /api/v1/workshops Source: https://docs.educates.dev/en/stable/_sources/lookup-service/workshops-api.md.txt Retrieves a list of workshops available through a specific tenant. ```APIDOC ## GET /api/v1/workshops ### Description Retrieves the list of workshops available through a tenant. The tenant parameter is required to filter the results. ### Method GET ### Endpoint /api/v1/workshops ### Parameters #### Query Parameters - **tenant** (string) - Required - The name of the tenant to query workshops for. ### Response #### Success Response (200) - **workshops** (array) - A list of available workshops, each containing name, title, and description. #### Response Example { "workshops": [ { "name": "lab-k8s-fundamentals", "title": "Kubernetes Fundamentals", "description": "An introduction to Kubernetes concepts" } ] } ``` -------------------------------- ### Update Educates Platform Configuration Source: https://docs.educates.dev/en/stable/_sources/release-notes/version-3.0.0.md.txt Commands for editing local configuration and deploying the platform using the local configuration option. ```bash educates local config edit educates admin platform deploy --local-config ``` -------------------------------- ### Delete the installation Source: https://docs.educates.dev/en/stable/_sources/installation-guides/cli-based-installation.md.txt Removes Educates and associated services or operators from the cluster. ```shell educates delete-platform ``` -------------------------------- ### Configure an autostart action Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-instructions.md.txt Set autostart to true to trigger an action automatically upon page load or when a parent section is expanded. ```yaml ```examiner:execute-test name: test-that-pod-exists title: Verify that pod named "one" exists args: - one timeout: 5 retries: .INF delay: 1 autostart: true ``` ``` -------------------------------- ### GET /api/v1/tenants//workshops Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List the workshops available through a specific tenant. ```APIDOC ## GET /api/v1/tenants//workshops ### Description List the workshops available through a specific tenant. ### Method GET ### Endpoint /api/v1/tenants//workshops ### Parameters #### Path Parameters - **tenant** (string) - Required - The identifier of the tenant. ``` -------------------------------- ### Publish a workshop Source: https://docs.educates.dev/en/stable/_sources/getting-started/creating-a-workshop.md.txt Builds an OCI image artifact from the workshop directory and pushes it to the local registry. ```bash educates publish-workshop ``` -------------------------------- ### GET /api/v1/clusters//portals Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List all training portals on a specific cluster. ```APIDOC ## GET /api/v1/clusters//portals ### Description List all training portals on a specific cluster. ### Method GET ### Endpoint /api/v1/clusters//portals ### Parameters #### Path Parameters - **cluster** (string) - Required - The identifier of the cluster. ``` -------------------------------- ### Download a file with preview Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-instructions.md.txt Downloads a file from the workshop session container and displays a preview in the browser. ```yaml files:download-file path: .kube/config download: kubeconfig-{{session_name}} preview: true ``` -------------------------------- ### GET /api/v1/clusters//kubeconfig Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt Retrieve the kubeconfig for a specific cluster as YAML. ```APIDOC ## GET /api/v1/clusters//kubeconfig ### Description Retrieve the kubeconfig for a specific cluster as YAML. ### Method GET ### Endpoint /api/v1/clusters//kubeconfig ### Parameters #### Path Parameters - **cluster** (string) - Required - The identifier of the cluster. ``` -------------------------------- ### Configure vCluster Infrastructure Provider Source: https://docs.educates.dev/en/stable/_sources/installation-guides/infrastructure-providers.md.txt Example configuration for deploying Educates on a vCluster, including disabling Kyverno and security policy engines when running nested instances. ```yaml # Specify the infrastructure provider hosting the Kubernetes cluster. clusterInfrastructure: provider: vcluster # Specify the ingress domain to be used to access the workshops hosted by # the Educates installation. clusterIngress: domain: educates-local-dev.test # Disable the cluster and security policy engines, and skip installing # Kyverno, as policies are enforced by the Educates installation running # this workshop session. clusterPackages: kyverno: enabled: false clusterSecurity: policyEngine: none workshopSecurity: rulesEngine: none ``` -------------------------------- ### GET /api/v1/clients Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List all configured clients with their names, roles, and tenant access. ```APIDOC ## GET /api/v1/clients ### Description List all configured clients with their names, roles, and tenant access. ### Method GET ### Endpoint /api/v1/clients ``` -------------------------------- ### Wait for kapp-controller readiness in setup script Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Use this bash script in setup.d to ensure CRDs and the kapp-controller deployment are ready before proceeding with workshop instructions. ```bash #!/bin/bash # Wait for CRDs for kapp-controller to have been created. STATUS=1 ATTEMPTS=0 COMMAND="kubectl get crd/packagerepositories.packaging.carvel.dev" until [ $STATUS -eq 0 ] || $COMMAND || [ $ATTEMPTS -eq 12 ]; do sleep 5 $COMMAND STATUS=$? ATTEMPTS=$((ATTEMPTS + 1)) done # Now wait for deployment of kapp-controller. STATUS=1 ATTEMPTS=0 COMMAND="kubectl rollout status deployment/kapp-controller -n kapp-controller" until [ $STATUS -eq 0 ] || $COMMAND || [ $ATTEMPTS -eq 12 ]; do sleep 5 $COMMAND STATUS=$? ATTEMPTS=$((ATTEMPTS + 1)) done ``` -------------------------------- ### Apply configuration resources Source: https://docs.educates.dev/en/stable/_sources/lookup-service/custom-resources.md.txt Use kubectl to apply configuration files to the cluster. ```bash kubectl apply -f cluster-config.yaml kubectl apply -f tenant-config.yaml kubectl apply -f client-config.yaml ``` -------------------------------- ### GET /workshops/catalog/environments/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/session-management.md.txt Lists all running workshop sessions allocated to users across the portal. ```APIDOC ## GET /workshops/catalog/environments/ ### Description Retrieves a list of all running workshop sessions allocated to users by providing the sessions=true query parameter. ### Method GET ### Endpoint https://lab-markdown-sample-ui.test/workshops/catalog/environments/ ### Parameters #### Query Parameters - **sessions** (boolean) - Required - Set to true to include active sessions in the response. ``` -------------------------------- ### GET /workshops/environment//status/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/workshops-catalog.md.txt Retrieves the status of a specific workshop environment by its name. ```APIDOC ## GET /workshops/environment//status/ ### Description Obtains detailed status information for a specific workshop environment. ### Method GET ### Endpoint /workshops/environment//status/ ### Parameters #### Path Parameters - **name** (string) - Required - The name of the workshop environment. ### Response #### Success Response (200) - **name** (string) - Environment name. - **state** (string) - Current state. - **workshop** (object) - Associated workshop details. - **duration** (integer) - Duration in seconds. - **capacity** (integer) - Total capacity. - **reserved** (integer) - Reserved count. - **allocated** (integer) - Allocated count. - **available** (integer) - Available count. ``` -------------------------------- ### GET /api/v1/tenants//portals Source: https://docs.educates.dev/en/stable/_sources/lookup-service/admin-rest-api.md.txt List the training portals accessible through a specific tenant. ```APIDOC ## GET /api/v1/tenants//portals ### Description List the training portals accessible through a specific tenant. ### Method GET ### Endpoint /api/v1/tenants//portals ### Parameters #### Path Parameters - **tenant** (string) - Required - The identifier of the tenant. ``` -------------------------------- ### Delete Educates package Source: https://docs.educates.dev/en/stable/_sources/installation-guides/carvel-based-installation.md.txt Removes the primary Educates installation managed by the Carvel package. ```bash kubectl delete -n educates-installer app/installer.educates.dev ``` -------------------------------- ### Enable presentation slides Source: https://docs.educates.dev/en/stable/_sources/custom-resources/workshop-definition.md.txt Enable the slides application to serve static content from the workshop/slides directory. ```yaml spec: session: applications: slides: enabled: true ``` -------------------------------- ### Select lines by range Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-instructions.md.txt Selects a range of lines by number, where both start and stop are inclusive. ```yaml ```editor:select-lines-in-range file: ~/exercises/sample.txt start: 5 stop: 10 ``` ``` -------------------------------- ### Configure supervisor for background applications Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-runtime.md.txt Create a configuration file in the workshop/supervisor directory to manage background applications with the supervisor daemon. ```text [program:myapplication] process_name=myapplication command=/opt/myapplication/sbin/start-myapplication stdout_logfile=/proc/1/fd/1 stdout_logfile_maxbytes=0 redirect_stderr=true ``` -------------------------------- ### Example session response Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/session-management.md.txt The JSON structure returned when querying active user sessions. ```json { "user": "8d2d0c8b-6ff5-4244-b136-110fd8d8431a", "sessions": [ { "name": "lab-markdown-sample-w01-s001", "workshop": "lab-markdown-sample", "environment": "lab-markdown-sample-w01", "namespace": "lab-markdown-sample-w01-s001", "started": "2020-07-31T03:57:33.942Z", "expires": "2020-07-31T04:57:33.942Z", "countdown": 3353, "extendable": false } ] } ``` -------------------------------- ### Configure a Workshop with a Java base image Source: https://docs.educates.dev/en/stable/_sources/workshop-content/workshop-configuration.md.txt Specifies a pre-built Educates base image with Java JDK 17 support. ```yaml apiVersion: training.educates.dev/v1beta1 kind: Workshop metadata: name: lab-markdown-sample spec: title: Markdown Sample description: A sample workshop using Markdown workshop: image: jdk17-environment:* files: - git: url: https://github.com/educates/lab-markdown-sample ref: origin/main includePaths: - /workshop/** - /exercises/** - /README.md session: namespaces: budget: small applications: console: enabled: true editor: enabled: true ``` -------------------------------- ### GET /workshops/user//sessions/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/session-management.md.txt Retrieves a list of active workshop sessions for a specific user. ```APIDOC ## GET /workshops/user//sessions/ ### Description Retrieves a list of active workshop sessions allocated to a specific user. ### Method GET ### Endpoint https://lab-markdown-sample-ui.test/workshops/user//sessions/ ### Parameters #### Path Parameters - **user** (string) - Required - The unique identifier of the user. ### Response #### Success Response (200) - **user** (string) - The user ID. - **sessions** (array) - List of active workshop sessions. #### Response Example { "user": "8d2d0c8b-6ff5-4244-b136-110fd8d8431a", "sessions": [ { "name": "lab-markdown-sample-w01-s001", "workshop": "lab-markdown-sample", "environment": "lab-markdown-sample-w01", "namespace": "lab-markdown-sample-w01-s001", "started": "2020-07-31T03:57:33.942Z", "expires": "2020-07-31T04:57:33.942Z", "countdown": 3353, "extendable": false } ] } ``` -------------------------------- ### GET /workshops/catalog/workshops/ Source: https://docs.educates.dev/en/stable/_sources/portal-rest-api/workshops-catalog.md.txt Retrieves a list of workshops along with the details of the current running workshop environment. ```APIDOC ## GET /workshops/catalog/workshops/ ### Description Returns a list of available workshops and the details of the current running workshop environment. ### Method GET ### Endpoint /workshops/catalog/workshops/ ### Response #### Success Response (200) - **portal** (object) - Portal configuration details. - **workshops** (array) - List of workshops with their environment details. ```