Part 2 of 4
What you just installed
educates create-cluster gave you more than a Kind cluster. Before you
write a workshop, take a few minutes to look at what runs in it: the
workloads Educates installed, the security policies that fence in workshop
users, and the custom resources you drive Educates with. The CLI set
kubectl to the cluster's kind-educates context, so every command here
runs from your own terminal.
The workloads
List every pod in the cluster with its namespace:
kubectl get pods --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.nameThe output looks like this, with different random suffixes:
NAMESPACE NAMEeducates image-puller-4qzpheducates secrets-manager-5f78fb8599-kkkw8educates session-manager-5d86cdf4cb-h2flmkube-system coredns-7db6d8ff4d-4rf8fkube-system coredns-7db6d8ff4d-tb9txkube-system etcd-educates-control-planekube-system kindnet-7g59lkube-system kube-apiserver-educates-control-planekube-system kube-controller-manager-educates-control-planekube-system kube-proxy-rpwb8kube-system kube-scheduler-educates-control-planekyverno kyverno-admission-controller-d49646b75-6qhf2kyverno kyverno-background-controller-6f9b5b9d57-ljm66kyverno kyverno-cleanup-controller-5d44984995-dghtbkyverno kyverno-reports-controller-7b4c74c6c5-k7gkklocal-path-storage local-path-provisioner-988d74bc-gt7xrprojectcontour contour-7fb9b8fd87-9w4mcprojectcontour contour-certgen-v1-30-2-d9hqtprojectcontour envoy-2fzc7kube-system and local-path-storage hold Kubernetes' and Kind's own
workloads. The other three namespaces are what Educates needs: Educates
itself, Kyverno and Contour.
Educates
Three workloads run in the educates namespace:
- session-manager is the Educates operator. It deploys a training
portal for each
TrainingPortalresource, and sets up the workshop environments and Sessions the portal asks for: their namespaces, pods, access rules and ingresses. - secrets-manager copies secrets between namespaces, and adds image pull secrets to service accounts, as its own resources describe. The session manager uses it too, for example to copy the ingress TLS certificate into the namespace of each workshop environment.
- image-puller runs on every node and pulls the training portal image, and any workshop images Educates is set to pre-pull, ahead of time, so portals and Sessions start faster.
When you deploy your first workshop in the next part, more pods appear: the training portal, then a pod for each Session.
Kyverno
Kyverno is the policy engine. Workshop users get access to a Kubernetes cluster, and they are not always people you trust, so Educates installs policies that Kyverno enforces on every request to the Kubernetes API: no privileged containers, no host namespaces or paths, no privilege escalation, and more. Together with the access rules and quotas of each Session, they keep a user from harming the cluster or another user's Session.
List the policies Educates installed:
kubectl get clusterpoliciesThere are quite a few:
NAME ADMISSION BACKGROUND READY AGE MESSAGEeducates-baseline-disallow-capabilities true true True 22h Readyeducates-baseline-disallow-host-namespaces true true True 22h Readyeducates-baseline-disallow-host-path true true True 22h Readyeducates-baseline-disallow-host-ports true true True 22h Readyeducates-baseline-disallow-host-ports-range true true True 22h Readyeducates-baseline-disallow-host-process true true True 22h Readyeducates-baseline-disallow-privileged-containers true true True 22h Readyeducates-baseline-disallow-proc-mount true true True 22h Readyeducates-baseline-disallow-selinux true true True 22h Readyeducates-baseline-restrict-seccomp true true True 22h Readyeducates-baseline-restrict-sysctls true true True 22h Readyeducates-restricted-disallow-capabilities-strict true true True 22h Readyeducates-restricted-disallow-privilege-escalation true true True 22h Readyeducates-restricted-require-run-as-non-root-user true true True 22h Readyeducates-restricted-require-run-as-nonroot true true True 22h Readyeducates-restricted-restrict-volume-types true true True 22h ReadyThe docs explain why Educates uses Kyverno rather than Kubernetes' own pod security standards, in Cluster requirements.
Contour
Contour is the ingress controller, built on
the Envoy proxy, and the CLI exposed it on
ports 80 and 443 of your machine. Educates creates an Ingress for each
training portal and Session, and Contour routes your browser to them. On
this local cluster their host names end in a nip.io
domain made from your machine's IP address, such as 192-168-1-1.nip.io,
which always resolves back to your machine.
The custom resources
Educates extends the Kubernetes API with its own resource types, and you work with Educates by creating and changing resources of those types. List them:
kubectl get crds -o custom-columns=NAME:.metadata.name | grep educatesA local install has ten, in two API groups:
secretcopiers.secrets.educates.devsecretexporters.secrets.educates.devsecretimporters.secrets.educates.devsecretinjectors.secrets.educates.devtrainingportals.training.educates.devworkshopallocations.training.educates.devworkshopenvironments.training.educates.devworkshoprequests.training.educates.devworkshops.training.educates.devworkshopsessions.training.educates.devThe resources in secrets.educates.dev are the secrets manager's. Those in
training.educates.dev are the session manager's, and two of them are the
ones you write:
Workshopdefines a workshop: where its content comes from, the applications each Session gets, such as the terminal, editor and Kubernetes console, and the resources and access each Session has. In the next part, the CLI generates one for you inresources/workshop.yaml. Reference: Workshop definition.TrainingPortaldeploys a training portal, the web site where people pick a workshop and get their own Session. It lists the workshops it serves, how many Sessions each can run, and how people get in. The first time you deploy a workshop, the CLI creates one namededucates-cli. Reference: Training portal.
The training portal creates the rest for you: a WorkshopEnvironment for
each workshop it serves, and a WorkshopSession for each Session. The docs
call them internal resources you do not need to touch. Once you have
deployed a workshop, see them all with:
kubectl get workshops,trainingportals,workshopenvironments,workshopsessionsIf you share secrets with your workshops, such as registry credentials, the Secret copier reference is the place to start.