diff --git a/src/content/posts/2026-11-25-educates-4-cli-config-kinds/index.md b/src/content/posts/2026-11-25-educates-4-cli-config-kinds/index.md index 93bc620..8dba112 100644 --- a/src/content/posts/2026-11-25-educates-4-cli-config-kinds/index.md +++ b/src/content/posts/2026-11-25-educates-4-cli-config-kinds/index.md @@ -1,7 +1,7 @@ --- slug: educates-4-cli-config-kinds title: "Educates 4 Configuration: From One Values File to a Ladder of Kinds" -description: "Educates 4 replaces the 3.x values.yaml with versioned, schema-validated config kinds, from a five-line laptop file to a verbatim escape hatch. How the CLI translates each one into the operator chart and four resources, and why it never applies them." +description: "Educates 4 replaces the 3.x values.yaml with versioned, schema-validated config kinds, from a three-line laptop file to a verbatim escape hatch. How the CLI translates each one into the operator chart and four resources, and why it never applies them." date: 2026-11-25 authors: [jorge] tags: [educates, installation, cli, kubernetes, v4-new] @@ -11,7 +11,7 @@ part: 3 In [Part 1](/blog/installing-educates-4-with-helm), we installed Educates 4 the way a GitOps tool does: the operator's Helm chart plus four resources. In [Part 2](/blog/educates-4-operator-and-crds), we followed the operator as it reconciles those four singleton resources and reports their status. This last part is about the `educates` CLI, which is where most of you start. You describe an install as a config kind, a short versioned YAML file, and the CLI translates it into the chart's values and the four resources. It never applies the config kind to a cluster. -Educates 4.0 isn't final yet at the time of writting this post, so be mindful that some output might have changed. Always look at the current docs. +Educates 4.0 isn't final yet at the time of writing this post, so be mindful that some output might have changed. Always look at the current docs. ## One Values File for Every Install @@ -73,7 +73,7 @@ flowchart TB r1 & r2 & r3 & r4 -.-> out ``` -- **`EducatesLocalConfig`** is a kind cluster on your laptop. The envelope plus a listen address is a complete install. +- **`EducatesLocalConfig`** is a kind cluster on your laptop. The envelope alone is a complete install. - **`EducatesGKEConfig` and `EducatesEKSConfig`** are a GKE or EKS cluster where Educates installs and manages the ingress controller, certificates, DNS and policy engine. - **`EducatesInlineConfig`** is a cluster that already has an ingress controller, certificates and a policy engine, such as OpenShift. - **`EducatesConfig`** is the escape hatch: the specs of the four resources, verbatim, with no CLI defaults at all. @@ -87,17 +87,16 @@ No rung is ever applied to a cluster, so no cluster ever holds an `EducatesGKECo `educates local config init` writes the smallest config there is: ``` -$ educates local config init --listen-address 10.10.10.1 +$ educates local config init +wrote /Users/me/Library/Application Support/educates/router.yaml, with this host's IP address 192.168.1.10 as the router address wrote /Users/me/Library/Application Support/educates/config.yaml $ educates local config view --raw # yaml-language-server: $schema=https://schemas.educates.dev/cli/v1alpha1/EducatesLocalConfig.json apiVersion: cli.educates.dev/v1alpha1 kind: EducatesLocalConfig -cluster: - listenAddress: 10.10.10.1 ``` -It lives in the data home, `~/Library/Application Support/educates` on macOS and `~/.local/share/educates` on Linux. A first install doesn't even need `init`: `educates local cluster create` writes the same file when there is none, with your host's current IP address as the listen address. That address must be a specific IP of your host, neither `0.0.0.0` nor loopback; [Running Several Educates Clusters on One Laptop](/blog/multiple-local-clusters) explains why, and how each named cluster gets a config of its own. +It lives in the data home, `~/Library/Application Support/educates` on macOS and `~/.local/share/educates` on Linux. A first install doesn't even need `init`: `educates local cluster create` writes the same file when there is none. The cluster's config holds no address. Every local cluster is served through one shared router, on the router address, which `init` writes first to `router.yaml` beside it, a kind of its own, `EducatesLocalRouter`, with your host's current IP address. That address must be a specific IP of your host, neither `0.0.0.0` nor loopback, and an alias such as `10.10.10.1`, which survives network changes, is the better choice. The rest of this post uses one, set with `educates local router update --address 10.10.10.1`. [Running Several Educates Clusters on One Laptop](/blog/multiple-local-clusters) explains the router, and how each named cluster gets a config of its own. `view --raw` prints the file as written. `view` without it prints what the CLI will actually use, and says where the extra values came from: @@ -108,8 +107,9 @@ $ educates local config view # Effective EducatesLocalConfig with all CLI defaults applied. Values # absent from the configuration file are filled in by the CLI: static # defaults, the image registry and version compiled into this CLI, and -# (when no ingress.domain is set) the nip.io name of cluster.listenAddress, -# with ingress.insecure defaulted to true. +# (when no ingress.domain is set) a nip.io name of the router address, +# with a named local cluster's name under it, and ingress.insecure +# defaulted to true. # # To see the configuration file as written, run: # educates local config view --raw @@ -117,8 +117,6 @@ $ educates local config view # apiVersion: cli.educates.dev/v1alpha1 kind: EducatesLocalConfig -cluster: - listenAddress: 10.10.10.1 ingress: domain: 10-10-10-1.nip.io insecure: true @@ -129,7 +127,7 @@ imagePrePuller: operator: image: repository: ghcr.io/educates/educates-operator - tag: 4.0.0 + tag: 4.0.0-alpha.15 logLevel: info ``` @@ -137,26 +135,27 @@ Three layers fill those values in, and we keep them apart on purpose: - **Static defaults**, applied when the file loads: `clusterAdmin`, `lookupService`, the image pre-puller and the `info` log level. - **The CLI binary**: the operator image comes from the CLI's own registry and version, so one CLI version always installs the operator of the same version. -- **Local cluster rules**: with no `ingress.domain`, the domain becomes the nip.io name of the listen address, now with dashes where 3.x used dots, and `ingress.insecure` becomes `true`, so a first install needs no certificate authority. +- **Local cluster rules**: with no `ingress.domain`, the domain becomes the nip.io name of the router address, now with dashes where 3.x used dots, with a named cluster's name under it, and `ingress.insecure` becomes `true`, so a first install needs no certificate authority. `init --defaults` writes that effective config into the file instead. The catch is that it pins the operator tag, so a newer CLI keeps installing the old operator until you remove the line. The minimal file follows the CLI. The file never carries certificates. For a domain of your own, `render` and `deploy` take a cached wildcard certificate or mint a CA from a cached root CA, and with neither they stop and print the commands that fix it. -The rest of the kind is short on purpose: the kind cluster itself (API server, subnets, volume mounts and [nodes](/blog/multi-node-local-clusters)), extra resolver domains, the lookup service, the image pre-puller, website styling, image versions and the operator. It has no mode, DNS, ACME, registry prefix or analytics; those live further down the ladder. The registry mirrors every local cluster shares sit beside it in `mirrors.yaml`, a kind of their own, `EducatesLocalMirrors`. +The rest of the kind is short on purpose: the kind cluster itself (API server, subnets, volume mounts and [nodes](/blog/multi-node-local-clusters)), extra resolver domains, the lookup service, the image pre-puller, website styling, image versions and the operator. It has no mode, DNS, ACME, registry prefix or analytics; those live further down the ladder. The registry mirrors every local cluster shares sit beside it in `mirrors.yaml`, a kind of their own, `EducatesLocalMirrors`, as the router address does in `router.yaml`. -## Five Lines In, Four Resources Out +## Three Lines In, Four Resources Out -Render that five-line file, with no cluster and no CA: +Render that three-line file, with no cluster and no CA: ``` $ educates admin platform render --local-config -# === operator chart values (helm install -f - educates-installer ...) === +# === operator chart values (educates-installer chart) === image: repository: ghcr.io/educates/educates-operator - tag: 4.0.0-alpha.14 + tag: 4.0.0-alpha.15 logLevel: info -# === platform CRs (kubectl apply -f - ...) === +--- +# === platform CRs === apiVersion: config.educates.dev/v1alpha1 kind: EducatesClusterConfig metadata: @@ -213,7 +212,7 @@ spec: storageGroup: 1 ``` -Five lines became one Helm values file and four custom resources, each a singleton named `cluster`, in the order `deploy` applies them. What each resource does is the subject of [Part 2](/blog/educates-4-operator-and-crds). Everything that isn't in your file is the laptop rung's locked choices: Managed mode, Contour with a `ClusterIP` Envoy service on host ports 80 and 443 (kind has no load balancer), Kyverno for both policy engines, `storageGroup: 1`, and the cloud metadata addresses blocked from sessions. +Three lines became one Helm values file and four custom resources, each a singleton named `cluster`, in the order `deploy` applies them. What each resource does is the subject of [Part 2](/blog/educates-4-operator-and-crds). Everything that isn't in your file is the laptop rung's locked choices: Managed mode, Contour with a `ClusterIP` Envoy service on host ports 80 and 443 (kind has no load balancer), Kyverno for both policy engines, `storageGroup: 1`, and the cloud metadata addresses blocked from sessions. Render is deterministic for a given config file and CLI version, with its keys sorted, so the output diffs cleanly in a review or in Git. That is why the translator never looks at the environment: the command applies the nip.io name, the CLI version and the certificate decision before translating. `--local-config` is the laptop mode that applies those local rules. `--config` is the explicit mode for a file of any kind, so an `EducatesLocalConfig` passed that way has to set its own domain: @@ -221,7 +220,7 @@ Render is deterministic for a given config file and CLI version, with its keys s $ educates admin platform render --config local-no-domain.yaml Error: ingress.domain is required when using --config. Set it explicitly in local-no-domain.yaml, or use --local-config to fall back to the nip.io -name of cluster.listenAddress. +name of the router address. ``` ## The Cloud Rungs: GKE and EKS @@ -313,7 +312,7 @@ Error: gke-noacme.yaml: schema validation failed: - acme: required unless externalTLSTermination is true; it holds the ACME issuer settings for the wildcard certificate ``` -`externalTLSTermination: true` is for a cloud load balancer or proxy that terminates TLS in front of the cluster. No certificate is issued inside the cluster, URLs still use `https`, and `acme` is no longer required. +`externalTLSTermination: true` is for a cloud load balancer or proxy that terminates TLS in front of the cluster. No certificate is issued inside the cluster, URLs still use `https`, and `acme` is no longer required. The laptop kind has the same switch, `ingress.externalTLSTermination`, which has the local router [play that load balancer](/blog/multiple-local-clusters#letting-the-router-end-tls). `EducatesEKSConfig` is the same stack on Route53 with IRSA: @@ -424,7 +423,6 @@ Every kind has a JSON schema embedded in the CLI, and every command that reads a apiVersion: cli.educates.dev/v1alpha1 kind: EducatesLocalConfig cluster: - listenAddress: 10.10.10.1 networking: podCIDR: 10.244.0.0/16 serviceCIDR: 10.96.0.0/12 @@ -488,8 +486,6 @@ apiVersion: cli.educates.dev/v1alpha1 kind: EducatesLocalConfig operator: logLevel: trace -cluster: - listenAddress: 10.10.10.1 ``` Save it empty to give up, and the CLI keeps a copy of your changes beside the config, which stays as it was. In 3.x, the same mistake lost the edit. @@ -497,14 +493,14 @@ Save it empty to give up, and the CLI keeps a copy of your changes beside the co Editors get the schemas through the `yaml-language-server` modeline that `init` writes: any editor using the [YAML language server](https://github.com/redhat-developer/yaml-language-server) completes, hovers and validates from it. Not yet, though. `schemas.educates.dev` returns 404 until 4.0.0 ships, because the job that publishes the schemas runs only on final release tags. Until then, a file in your repository can point its modeline at a tag's copy, which resolves today: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/educates/educates-training-platform/4.0.0-alpha.14/client-programs/pkg/config/v1alpha1/schemas/EducatesGKEConfig.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/educates/educates-training-platform/4.0.0-alpha.15/client-programs/pkg/config/v1alpha1/schemas/EducatesGKEConfig.schema.json ``` Name such files `*.educates.yaml`, the convention the [schema notes](https://github.com/educates/educates-training-platform/blob/develop/developer-docs/json-schemas.md) document for a SchemaStore entry once the schemas are published. ## Coming from 3.x -On a laptop, you don't migrate by hand. The first 4.0 command that needs the local config finds a 3.x `values.yaml` whose provider is `kind` or empty, translates it to an `EducatesLocalConfig`, moves any registry mirrors to `mirrors.yaml`, keeps the original as `values.yaml.v3-backup`, and prints a line for each thing it changed or dropped. [Running Several Educates Clusters on One Laptop](/blog/multiple-local-clusters#upgrading-from-a-single-cluster) shows that receipt. Check two things after it. Settings the laptop kind has no place for, such as an analytics tracking ID, are dropped without a line. And an explicit nip.io domain from 3.x becomes a custom domain in 4.0, secure by default, so set `ingress.insecure` or remove the domain to get the dashed nip.io default. +On a laptop, you don't migrate by hand. The first 4.0 command that needs the local config finds a 3.x `values.yaml` whose provider is `kind` or empty, translates it to an `EducatesLocalConfig`, writes the router address to `router.yaml`, moves any registry mirrors to `mirrors.yaml`, keeps the original as `values.yaml.v3-backup`, and prints a line for each thing it changed or dropped. [Running Several Educates Clusters on One Laptop](/blog/multiple-local-clusters#upgrading-from-a-single-cluster) shows that receipt. Check two things after it. Settings the laptop kind has no place for, such as an analytics tracking ID, are dropped without a line. And an explicit nip.io domain from 3.x becomes a custom domain in 4.0, secure by default, so set `ingress.insecure` or remove the domain to get the dashed nip.io default. Any other provider gets an honest error and an untouched file: the DNS, ACME and identity wiring of a cloud install can't be guessed safely, so the CLI lists the five kinds and asks you to declare one. The [migration guide](https://docs.educates.dev/en/latest/installation-guides/migrating-from-v3.html) maps each 3.x provider to its kind and each removed command to its replacement. `educates create-cluster` and `educates deploy-platform --config` still work as aliases, but there is no in-place upgrade of a 3.x cluster install: delete it and install 4.0. diff --git a/src/content/posts/2026-11-26-multiple-local-clusters/index.md b/src/content/posts/2026-11-26-multiple-local-clusters/index.md index 3147cf8..ce73531 100644 --- a/src/content/posts/2026-11-26-multiple-local-clusters/index.md +++ b/src/content/posts/2026-11-26-multiple-local-clusters/index.md @@ -1,7 +1,7 @@ --- slug: multiple-local-clusters title: Running Several Educates Clusters on One Laptop -description: "Educates 4.0 runs named local clusters beside the default one, each on a host IP of its own, sharing one registry, resolver and CA. Why one cluster wasn't enough, how named clusters work, and where to read more." +description: "Educates 4.0 runs named local clusters beside the default one, all served through one shared router on one host address, and sharing one registry, resolver and CA. Why one cluster wasn't enough, how named clusters work, and where to read more." date: 2026-11-26 authors: [jorge] tags: [educates, local, kind, cli, dns, v4-new] @@ -9,9 +9,9 @@ tags: [educates, local, kind, cli, dns, v4-new] Until now, the Educates CLI assumed there was exactly one local cluster on your machine. A second `educates local cluster create` failed with "cluster for Educates already exists", and there was no way around it. -We are pleased to announce that, in Educates 4.0, you can run named local clusters beside the default one. A command you run without a cluster name behaves as it always did, and a second cluster is one command away once your host has an address for it. +We are pleased to announce that, in Educates 4.0, you can run named local clusters beside the default one. A command you run without a cluster name behaves as it always did, and a second cluster is one command away. -4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.14. Use that version or a later one: an older CLI knows only one cluster, and can delete what the others need. +4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.15. Use that version or a later one: a 3.x CLI knows only one cluster, and can delete what the others need, and earlier 4.0 prereleases served each cluster on a host address of its own, which recent Docker Desktop releases no longer allow. ## The Problem with One Local Cluster @@ -31,57 +31,128 @@ The only way out was to tear down one cluster to create the next, or to build a In 4.0, the cluster you have always created is the default local cluster, and you can create any number of named ones beside it: ```bash -educates local cluster create --local-cluster test2 --listen-address 10.10.10.2 +educates local cluster create --local-cluster test2 ``` -That writes the cluster's config to the data home, creates the kind cluster `educates-test2` with the kube context `kind-educates-test2`, and installs Educates in it, while the default cluster keeps running. Everything about a named cluster derives from its name, so you never have to remember which context goes with which cluster. +That writes the cluster's config to the data home, creates the kind cluster `educates-test2` with the kube context `kind-educates-test2`, and installs Educates in it, while the default cluster keeps running. Everything about a named cluster derives from its name, so you never have to remember which context goes with which cluster. That includes its domain: with none given, `test2` is served at its name under the nip.io name of the router address, such as `test2.10-10-10-1.nip.io`. Add `--domain` for a domain of your own. -### One host IP per cluster +### One router for every cluster -Educates builds every workshop URL on ports 80 and 443 with no port suffix, so clusters can't be told apart by port. They are told apart by address instead. Every local cluster, the default one included, declares a host IP of its own in `cluster.listenAddress`, publishes its ports 80 and 443 there, and has its domain resolve to it. +Educates builds every workshop URL on ports 80 and 443 with no port suffix, so clusters can't be told apart by port. They are told apart by name. Every local cluster is served through one router, `educates-router`, an HAProxy container on Docker's `kind` network. It publishes ports 80 and 443 once, on the router address, and sends each request to the control-plane node of the cluster that owns the name it asks for: plain HTTP by the `Host` header, and HTTPS by the server name in the TLS handshake. Kind nodes publish no ports on your host at all. -The address has to be a specific IP of your host. `0.0.0.0` claims ports 80 and 443 on every address and leaves none for a second cluster. A loopback address such as `127.0.0.2` works from your browser, but not from inside the cluster, where a pod resolving the ingress domain would reach itself instead of your host. +```mermaid +flowchart LR + accTitle: One router in front of every local cluster + accDescr: The browser connects to the router address, 10.10.10.1, on port 80 or 443. The router, the container educates-router on the kind network, sends names under test2.educates.test to the control-plane node of the cluster test2, and every other name under educates.test to the control-plane node of the default cluster, by the Host header for HTTP and by the TLS server name for HTTPS. + browser["Browser"] -->|"10.10.10.1, ports 80 and 443"| router["educates-router
on the kind network"] + router -->|"educates.test"| main["educates-control-plane
default cluster"] + router -->|"test2.educates.test"| test2["educates-test2-control-plane
cluster test2"] +``` + +HTTPS passes through the router untouched, so each cluster still presents its own certificate, and the router holds no cluster's keys. When several domains match a name, the most specific one wins, so `workshop.test2.educates.test` reaches `test2` and `workshop.educates.test` the default cluster. Over plain HTTP, a name no cluster serves gets a plain-text 404 listing the domains the router serves, and a stopped cluster's name gets a 503 naming the cluster and the `educates local cluster start` command that brings it back. Over HTTPS the router has no certificate to answer those with, so it closes the connection instead. + +Earlier 4.0 prereleases did this differently. Each cluster had a host IP of its own, `cluster.listenAddress`, and published its ports 80 and 443 there. Docker Desktop 4.100.0 broke that. macOS lets a process that isn't root bind a port below 1024 only on the wildcard address, and Docker Desktop now binds such a publish there whatever address it names, so a second cluster's publish of port 80 failed with the port already in use. One publish of each port is what Docker Desktop serves, so now the clusters share it. + +### The router address + +The router address is the one host address the local environment needs. It lives in `router.yaml` in the data home, a kind of its own, `EducatesLocalRouter`, since every cluster shares it: + +```yaml +# yaml-language-server: $schema=https://schemas.educates.dev/cli/v1alpha1/EducatesLocalRouter.json +apiVersion: cli.educates.dev/v1alpha1 +kind: EducatesLocalRouter +# This host's IP address when this file was written. An alias such as +# 10.10.10.1, added to a network interface, survives network changes. +address: 192.168.1.10 +``` + +The first `educates local cluster create` writes it with your host's IP address. The address has to be a specific IP that one of your host's network interfaces has. `0.0.0.0` names no address the clusters' names could resolve to. A loopback address such as `127.0.0.1` works from your browser, but not from inside a cluster, where a pod resolving the ingress domain would reach itself instead of your host. -The CLI never runs `sudo`, so adding the address to a network interface is a one-time step that is yours to take. On macOS, the [fixed IP post](/blog/fixed-ip-bridge-macos) gives your machine a `bridge1` interface at `10.10.10.1`, and every further cluster gets an alias on the same bridge. The CLI checks that the address is really there before it creates a cluster, and refuses an address or a domain that another cluster, running or stopped, already uses. +Your host's IP changes when your laptop moves between networks, and the router never follows it, since a nip.io domain contains the address. An alias on a network interface survives network changes. The CLI never runs `sudo`, so adding one is a one-time step that is yours to take. On macOS, the [fixed IP post](/blog/fixed-ip-bridge-macos) gives your machine a `bridge1` interface at `10.10.10.1`. Then make it the router address: -If you use Docker Desktop 4.97 or later, there is one more setting: turn on **Settings > Advanced > Allow privileged port forwarding to external machines**. Without it, Docker Desktop serves ports below 1024 on loopback only, and no local cluster is reachable from your browser, the default one included. +```bash +educates local router update --address 10.10.10.1 +``` + +That checks that the address is really on one of your interfaces, writes it to `router.yaml`, points the DNS resolver at it, and re-creates the router there, while the clusters keep running. A cluster on the nip.io name of the old address takes the new name, and the command names each such cluster with the `educates admin platform deploy --local-config` command that deploys it again. One alias serves every cluster, where earlier prereleases needed one for each. + +If you use Docker Desktop 4.97 or later, there is one more setting: turn on **Settings > Advanced > Allow privileged port forwarding to external machines**. Without it, Docker Desktop serves ports below 1024 on loopback only, and the router, and with it every local cluster, is unreachable from your browser. `educates local cluster create` and `educates local cluster start` refuse to run while the setting is off. + +`educates local router status` shows the router and where it sends each name: + +``` +Router address: 10.10.10.1 +Router: running (educates-router), publishing ports 80 and 443 on 10.10.10.1 +Image: haproxy:3.4.8-alpine@sha256:8aa6458a9d22a8364a2d2ee9ce93de0cc4a2789e3cf63f0b44adc972863724d7 + +NAME CLUSTER TLS STATE +educates.test (default) passthrough running +test2.10-10-10-1.nip.io test2 passthrough stopped +``` ### Picking the cluster you mean You select a cluster per command with `--local-cluster`, or per terminal with the `EDUCATES_LOCAL_CLUSTER` environment variable. It works like `kubectl --context` and `KUBECONFIG`, minus a stored current context: the CLI never remembers a selection, so one terminal can work on `test2` while another works on the default cluster, and neither follows the other. With a cluster selected, the `educates cluster` and `educates admin` commands use its kube context, whatever context kind last made current. -`educates local cluster list` shows every local cluster, running or stopped: +`educates local cluster list` shows the router address, then every local cluster, running or stopped: ``` -NAME STATE NODES KUBERNETES LISTEN IP DOMAIN CONTEXT -(default) running 1 v1.36.4 10.10.10.1 educates.test kind-educates -test2 stopped 3 - 10.10.10.2 10-10-10-2.nip.io kind-educates-test2 +Router address: 10.10.10.1 + +NAME STATE NODES KUBERNETES DOMAIN CONTEXT +(default) running 1 v1.36.4 educates.test kind-educates +test2 stopped 3 v1.36.4 test2.10-10-10-1.nip.io kind-educates-test2 ``` +`educates cluster workshop serve` follows the selection too. It listens on the router address, on a free port it picks for each run, so two terminals can serve one workshop to two clusters at once, and an edit shows in the sessions of both. + ### What every cluster shares -Each cluster has its own address, config and kube context, but some things are the same for all of them, so there is only one of each: +Each cluster has its own name, domain, config and kube context, but some things are the same for all of them, so there is only one of each: +- **One router.** It publishes ports 80 and 443 on the router address, and sends each name to the cluster that owns it. - **One registry.** `localhost:5001` serves every cluster, so a workshop you publish once can be deployed to all of them. - **One set of registry mirrors.** Mirrors are declared once for the whole machine, and linked into every node of every cluster. -- **One DNS resolver.** It serves every cluster's domain at that cluster's address. A cluster on `test2.educates.test` gets its own name, while every other name under `educates.test` still reaches the default cluster. +- **One DNS resolver.** It resolves every cluster's names to the router address, and like the router, it picks the most specific domain. A cluster on `test2.educates.test` gets its own name, while every other name under `educates.test` still reaches the default cluster. - **One root CA.** You trust it once, and every cluster's domain gets an intermediate CA minted from it, so a named cluster can serve HTTPS with nothing new to trust. -A named cluster with no domain uses the nip.io name of its address over plain HTTP, so it needs no CA and no resolver entry at all. +A named cluster with no domain uses its name under the nip.io name of the router address, over plain HTTP, so it needs no CA and no resolver entry at all. + +Clusters no longer clash on addresses, only on domains, since a name leads to one cluster. `educates local cluster create` and `start` refuse a domain that another cluster, running or stopped, already claims, before kind runs. A subdomain of another cluster's domain is no clash. + +Deleting a named cluster keeps its config, so creating it again brings it back as it was. And `delete --all` removes the shared router, registry, mirrors and resolver only with the last local cluster, never while another one still needs them, and keeps `router.yaml`. + +### Letting the router end TLS -Deleting a named cluster keeps its config, so creating it again brings it back as it was. And `delete --all` removes the shared registry, mirrors and resolver only with the last local cluster, never while another one still needs them. +The router can also play the cloud load balancer that ends TLS in front of a cluster, the setup `externalTLSTermination` declares for GKE, EKS and Inline installs. Set it in a local cluster's config before you create the cluster: + +```yaml +ingress: + domain: test2.educates.test + externalTLSTermination: true +``` + +The router then ends TLS for the cluster's domain with a certificate from your local CA, and sends each request on as plain HTTP with `X-Forwarded-Proto: https`. The cluster installs no cert-manager, its URLs still use HTTPS, and its ingress trusts the forwarded headers the router sets, so you can check how a workshop behaves behind a load balancer without leaving your laptop. `educates local router status` shows its domain as `terminated` in the `TLS` column. ### Upgrading from a single cluster -Your first 4.0 command migrates your 3.x config and tells you what it changed. Two of those changes need you to act: +Your first 4.0 command migrates your 3.x config and tells you what it changed, including where the address went. A 3.x cluster that left its listen address to kind, which published its ports on every host address, gets your host's IP address as the router address: + +``` +migrated /Users/me/Library/Application Support/educates/values.yaml → /Users/me/Library/Application Support/educates/config.yaml; original saved as /Users/me/Library/Application Support/educates/values.yaml.v3-backup +wrote /Users/me/Library/Application Support/educates/router.yaml with this host's IP address 192.168.1.10 as the router address: localKindCluster.listenAddress was not set, so the cluster published its ports 80 and 443 on every host address, and every local cluster is now served on the router address, a specific IP address of the host. An alias such as 10.10.10.1, added to a network interface, survives network changes, where the host's IP address may not +``` + +Three changes need you to act: -- **A cluster on `0.0.0.0` blocks every new one.** The migration sets the listen address to your host's IP, but kind fixes the binding when it creates a cluster, so re-create the default cluster on a stable address before you add a second. -- **The resolver sync LaunchAgent has nothing left to do.** With a stable address per cluster, the agent from the [resolver sync post](/blog/sync-resolver-macos) is no longer needed, so unload it. +- **A cluster from an earlier CLI has to be created again.** Kind fixes the ports a node publishes when it creates the cluster, so a cluster created by 3.x or by an earlier 4.0 prerelease publishes ports 80 and 443 from its own node, which leaves the router nothing to bind. Creating the router fails, naming each such cluster with the commands that delete it and create it again. +- **A prerelease config loses `cluster.listenAddress`.** The first command that reads a config in the data home moves the default cluster's address to `router.yaml`, drops a named cluster's, and keeps the previous config as a backup beside it. A config outside the data home fails, saying where the address went, and the `--listen-address` option is gone. +- **The resolver sync LaunchAgent has nothing left to do.** Every cluster's names resolve to the router address, which doesn't follow your host's IP, so the agent from the [resolver sync post](/blog/sync-resolver-macos) is no longer needed. Unload it, and make an alias the router address instead. ## Conclusions -One local cluster was enough until it wasn't, and the workarounds cost you the very wiring that makes local clusters handy. Give each cluster an address of its own, name the ones beside the default, and select the one you mean per terminal. That is the recommended way to run more than one Educates cluster on your laptop, because every cluster gets the same registry, mirrors, resolver and CA without any of them stepping on the others. +One local cluster was enough until it wasn't, and the workarounds cost you the very wiring that makes local clusters handy. Give the router one stable address, name the clusters beside the default, and select the one you mean per terminal. That is the recommended way to run more than one Educates cluster on your laptop, because every cluster gets the same router, registry, mirrors, resolver and CA without any of them stepping on the others. -The [running several local clusters](https://docs.educates.dev/en/latest/getting-started/local-environment.html#running-several-local-clusters) section of the local environment docs covers adding host addresses on macOS and Linux, selecting clusters, serving one workshop to several clusters, and cleaning up. The [migration guide](https://docs.educates.dev/en/latest/installation-guides/migrating-from-v3.html) covers the rest of the move from 3.x. +The [router address](https://docs.educates.dev/en/latest/getting-started/local-environment.html#router-address) and [running several local clusters](https://docs.educates.dev/en/latest/getting-started/local-environment.html#running-several-local-clusters) sections of the local environment docs cover adding an alias on macOS and Linux, the router's commands, selecting clusters, serving one workshop to several clusters, and cleaning up. The [migration guide](https://docs.educates.dev/en/latest/installation-guides/migrating-from-v3.html) covers the rest of the move from 3.x. In the next post, we'll give a local cluster more than one node, with the labels and taints of a production node pool: [Multi-Node Local Clusters](/blog/multi-node-local-clusters). diff --git a/src/content/posts/2026-11-27-multi-node-local-clusters/index.md b/src/content/posts/2026-11-27-multi-node-local-clusters/index.md index 978c464..6ebde52 100644 --- a/src/content/posts/2026-11-27-multi-node-local-clusters/index.md +++ b/src/content/posts/2026-11-27-multi-node-local-clusters/index.md @@ -11,7 +11,7 @@ Every Educates local cluster has always been a single node. That is fine for run We are pleased to announce that, in Educates 4.0, a local cluster can have several nodes, each with the Kubernetes labels and taints you declare, so a laptop cluster can model the node pools of a production one. -4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.14. +4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.15. ## The Problem with a Single-Node Local Cluster @@ -29,7 +29,6 @@ In 4.0, the `EducatesLocalConfig` takes a `cluster.nodes` list. This one declare ```yaml cluster: - listenAddress: 10.10.10.1 nodes: - role: control-plane - role: worker @@ -49,7 +48,7 @@ Each node has a `role`, either `control-plane` or `worker`, optional `labels` an A few rules keep it simple: - **Leaving `cluster.nodes` out keeps one node**, the single control-plane cluster of 3.x. -- **Exactly one node is the control plane.** It's the node that publishes ports 80 and 443 on the listen address, and a second one couldn't bind them. The CLI refuses a list with none or with more than one. +- **Exactly one node is the control plane.** It's the node the [shared router](/blog/multiple-local-clusters#one-router-for-every-cluster) sends the cluster's names to, where Envoy serves ports 80 and 443. The CLI refuses a list with none or with more than one. - **Taints apply to workers.** Labels apply to every node. - **Every node runs the same Kubernetes version.** `--kubernetes-version` picks it, from 1.34 to 1.37, defaulting to 1.36. @@ -57,13 +56,13 @@ A few rules keep it simple: ### Three fields, not a kind config -The surface is narrow on purpose: three fields per node, not a raw kind config. The CLI renders them into the kind config you would otherwise write by hand, labels as the kubelet's `node-labels` and taints as its `register-with-taints`, as kind's [configuration guide](https://kind.sigs.k8s.io/docs/user/configuration/#nodes) describes. What Educates depends on stays under the CLI's control: the port mappings on the control plane, its `ingress-ready` label, and the containerd configuration that points every node at the local registry and mirrors. +The surface is narrow on purpose: three fields per node, not a raw kind config. The CLI renders them into the kind config you would otherwise write by hand, labels as the kubelet's `node-labels` and taints as its `register-with-taints`, as kind's [configuration guide](https://kind.sigs.k8s.io/docs/user/configuration/#nodes) describes. What Educates depends on stays under the CLI's control: the control plane's `ingress-ready` label, and the containerd configuration that points every node at the local registry and mirrors. No node maps a host port, since the router reaches the control plane over Docker's `kind` network by its container name. The cost is that nothing else of kind is reachable from `cluster.nodes`: no per-node images, no mounts on workers, no feature gates or API server flags. ### Where Educates puts itself -Educates doesn't pick nodes for its own components. Where each one lands follows from tolerations alone: kind keeps the control-plane taint once a cluster has workers, and almost nothing Educates installs tolerates a taint. The Envoy ingress runs on the control plane, where ports 80 and 443 arrive, and on untainted workers. The operator, the session manager, training portals and every workshop session run on untainted workers. +Educates doesn't pick nodes for its own components. Where each one lands follows from tolerations alone: kind keeps the control-plane taint once a cluster has workers, and almost nothing Educates installs tolerates a taint. The Envoy ingress runs on the control plane, where the router sends ports 80 and 443, and on untainted workers. The operator, the session manager, training portals and every workshop session run on untainted workers. On the cluster above, that puts all of them on the general worker, and leaves the batch worker free for whatever your workshop schedules there. `educates local cluster status` shows each node with the labels and taints you declared, so you can check the shape before you build on it: diff --git a/src/content/posts/2026-11-28-extension-packages-as-image-volumes/index.md b/src/content/posts/2026-11-28-extension-packages-as-image-volumes/index.md index 45b2e29..b5d8842 100644 --- a/src/content/posts/2026-11-28-extension-packages-as-image-volumes/index.md +++ b/src/content/posts/2026-11-28-extension-packages-as-image-volumes/index.md @@ -11,7 +11,7 @@ Every session of a workshop that used the argocd extension package downloaded it We are pleased to announce that, in Educates 4.0, an extension package can be published as an image of its own and declared in a workshop by reference. Where the cluster supports Kubernetes image volumes, the package is mounted straight into the session, and where it doesn't, the same image is fetched instead. The workshop definition is the same either way. -4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.14. +4.0 isn't final yet, so everything here uses the latest prerelease at the moment of writing, 4.0.0-alpha.15. ## The Problem with Downloading Packages per Session