Skip to content

Commit 0ea6613

Browse files
Merge pull request #5 from educates/develop
How the installer works, part 1
2 parents 62f4b3c + 11a91b4 commit 0ea6613

2 files changed

Lines changed: 186 additions & 0 deletions

File tree

141 KB
Loading
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
---
2+
slug: how-installer-works-part-1
3+
title: How the installer works (Part 1)
4+
authors: [jorge]
5+
tags: [educates, installation, cli]
6+
---
7+
8+
In **Educates 3.0**, we introduced a new installer mechanism designed to simplify the deployment of Educates on your preferred cluster infrastructure. This new approach provides an opinionated yet flexible way to set up the platform, addressing common challenges faced by our users.
9+
10+
Before Educates 3.0, installation was limited to deploying the Educates Training Platform on an existing Kubernetes cluster. However, we realized that many users lacked the technical expertise to configure a fully functional Kubernetes cluster with all the necessary prerequisites. Tasks such as setting up an ingress controller, managing certificates, configuring DNS, and enforcing policies often posed significant barriers to adoption. To address this, we developed a streamlined installer that abstracts these complexities, making it easier for users to adopt the Educates Training Platform.
11+
12+
In this article, we’ll explore how the new installer works, the supported cluster infrastructure providers in **Educates 3.2.0**, and the design decisions behind its implementation. Let’s dive in!
13+
14+
---
15+
16+
## Backward Compatibility with Educates 2.x
17+
18+
One of our key goals with Educates 3.x was to maintain backward compatibility with Educates 2.x or, at the very least, ensure a smooth transition for users upgrading to the new version.
19+
20+
In Educates 2.x, the platform was installed using [Carvel's kapp-controller](https://carvel.dev/kapp-controller/). This required the target cluster to have kapp-controller pre-installed. The Educates CLI automated this process for local clusters via the `educates create-cluster` command.
21+
22+
The installation process in Educates 2.x involved two main steps:
23+
24+
1. **Cluster Prerequisites Installation**: Pre-requisites like [Contour](https://projectcontour.io) and [Kyverno](https://kyverno.io) were installed using Carvel Packages (or Apps). Configuration was managed through a dedicated configuration file, as outlined in the [2.x documentation](https://docs.educates.dev/en/2.7.x/installation-guides/installation-instructions.html#installing-cluster-essentials).
25+
26+
2. **Platform Installation**: The Educates Training Platform itself was installed as another Carvel Package, with its configuration defined in a separate file.
27+
28+
For local clusters, both configurations were often combined into a single file, though each deployment process only referenced the relevant sections.
29+
30+
---
31+
32+
## Enhancements in Educates 3.x
33+
34+
With Educates 3.x, we retained the familiar configuration file format but expanded its capabilities. The new installer introduces several key improvements:
35+
36+
1. **Integrated Installer**: The installer is now part of the Educates CLI, written in Golang. It leverages Carvel tools as internal libraries for tasks such as configuration templating, image resolution, and Kubernetes resource deployment.
37+
38+
2. **Infrastructure-Aware Configuration**: The installer adapts the configuration based on the target cluster infrastructure provider. This allows us to provide opinionated defaults that simplify the installation process for less experienced users while remaining flexible for advanced users.
39+
40+
3. **Augmented Configuration**: The configuration file now supports additional settings, such as specifying the `clusterInfrastructure.provider`. This enables the installer to tailor the deployment process to the chosen provider.
41+
42+
---
43+
44+
## How the Installer Works
45+
46+
The installer processes the user-provided configuration into a more detailed and opinionated set of values required by the target cluster infrastructure provider. For example, running the command:
47+
48+
```bash
49+
educates admin platform config --local-config
50+
```
51+
52+
Generates a default configuration for a local cluster, which might look like this:
53+
54+
```yaml
55+
clusterInfrastructure:
56+
provider: kind
57+
clusterPackages:
58+
contour:
59+
enabled: true
60+
settings: {}
61+
kyverno:
62+
enabled: true
63+
settings: {}
64+
educates:
65+
enabled: true
66+
settings: {}
67+
clusterSecurity:
68+
policyEngine: kyverno
69+
clusterIngress:
70+
domain: 172.20.10.12.nip.io
71+
workshopSecurity:
72+
rulesEngine: kyverno
73+
```
74+
75+
This configuration is then transformed by the installer into a more detailed set of values specific to the chosen infrastructure provider. For example, running:
76+
77+
```bash
78+
educates admin platform values --local-config
79+
```
80+
81+
Produces the following output:
82+
83+
```yaml
84+
clusterPackages:
85+
contour:
86+
enabled: true
87+
settings:
88+
infraProvider: kind
89+
contour:
90+
replicas: 1
91+
configFileContents:
92+
defaultHttpVersions:
93+
- HTTP/1.1
94+
service:
95+
type: ClusterIP
96+
useHostPorts: true
97+
cert-manager:
98+
enabled: false
99+
settings: {}
100+
external-dns:
101+
enabled: false
102+
settings: {}
103+
certs:
104+
enabled: false
105+
settings: {}
106+
kyverno:
107+
enabled: true
108+
settings: {}
109+
kapp-controller:
110+
enabled: false
111+
settings: {}
112+
educates:
113+
enabled: true
114+
settings:
115+
imageVersions:
116+
- name: session-manager
117+
image: ghcr.io/educates/educates-session-manager:3.2.0
118+
- name: training-portal
119+
image: ghcr.io/educates/educates-training-portal:3.2.0
120+
- name: docker-registry
121+
image: ghcr.io/educates/educates-docker-registry:3.2.0
122+
- name: pause-container
123+
image: ghcr.io/educates/educates-pause-container:3.2.0
124+
- name: base-environment
125+
image: ghcr.io/educates/educates-base-environment:3.2.0
126+
- name: jdk8-environment
127+
image: ghcr.io/educates/educates-jdk8-environment:3.2.0
128+
- name: jdk11-environment
129+
image: ghcr.io/educates/educates-jdk11-environment:3.2.0
130+
- name: jdk17-environment
131+
image: ghcr.io/educates/educates-jdk17-environment:3.2.0
132+
- name: jdk21-environment
133+
image: ghcr.io/educates/educates-jdk21-environment:3.2.0
134+
- name: conda-environment
135+
image: ghcr.io/educates/educates-conda-environment:3.2.0
136+
- name: secrets-manager
137+
image: ghcr.io/educates/educates-secrets-manager:3.2.0
138+
- name: tunnel-manager
139+
image: ghcr.io/educates/educates-tunnel-manager:3.2.0
140+
- name: image-cache
141+
image: ghcr.io/educates/educates-image-cache:3.2.0
142+
- name: assets-server
143+
image: ghcr.io/educates/educates-assets-server:3.2.0
144+
- name: lookup-service
145+
image: ghcr.io/educates/educates-lookup-service:3.2.0
146+
- name: debian-base-image
147+
image: debian:sid-20230502-slim
148+
- name: docker-in-docker
149+
image: docker:27.5.1-dind
150+
- name: rancher-k3s-v1.27
151+
image: rancher/k3s:v1.27.14-k3s1
152+
- name: rancher-k3s-v1.28
153+
image: rancher/k3s:v1.28.10-k3s1
154+
- name: rancher-k3s-v1.29
155+
image: rancher/k3s:v1.29.5-k3s1
156+
- name: rancher-k3s-v1.30
157+
image: rancher/k3s:v1.30.1-k3s1
158+
- name: loftsh-vcluster
159+
image: loftsh/vcluster:0.18.1
160+
clusterIngress:
161+
domain: 172.20.10.12.nip.io
162+
clusterSecurity:
163+
policyEngine: kyverno
164+
workshopSecurity:
165+
rulesEngine: kyverno
166+
```
167+
168+
This transformation ensures that the configuration is optimized for the specific infrastructure provider while maintaining the flexibility to customize settings as needed.
169+
170+
![Config to values](config_to_values.png)
171+
172+
---
173+
174+
## Supported Infrastructure Providers
175+
176+
Educates 3.x supports a variety of cluster infrastructure providers, each with its own set of opinionated defaults. These providers are defined in the [Educates repository](https://github.com/educates/educates-training-platform/tree/develop/carvel-packages/installer/bundle/config/ytt/_ytt_lib/infrastructure) and include configurations for packages such as [Contour](https://projectcontour.io) and [Kyverno](https://kyverno.io).
177+
178+
Refer to the official documentation for more details on the [configuration format](https://docs.educates.dev/en/stable/installation-guides/configuration-settings.html) and [supported infrastructure providers](https://docs.educates.dev/en/stable/installation-guides/infrastructure-providers.html).
179+
180+
---
181+
182+
## Conclusion
183+
184+
The new installer in Educates 3.x represents a significant step forward in simplifying the deployment process. By integrating the installer into the CLI, providing infrastructure-aware configurations, and maintaining backward compatibility, we’ve made it easier than ever to deploy Educates on a variety of Kubernetes environments.
185+
186+
In the next part of this series, we’ll take a closer look at the specific cluster infrastructure providers supported by the installer and the rationale behind our opinionated defaults. Stay tuned!

0 commit comments

Comments
 (0)