Skip to content

Commit fd6704b

Browse files
author
davidmirror-ops
committed
Expand single node onprem docs
Signed-off-by: davidmirror-ops <david [email protected]>
1 parent 01ed612 commit fd6704b

7 files changed

+446
-98
lines changed

docs/on-premises/single-node/001-configure-single-node-k8s.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
By following this tutorial, you will deploy a Kubernetes cluster on a single VM.
44
Feel free to skip this section if you already have a working Kubernetes environment.
55

6-
> Do you plan to add more nodes/physical machines to your K8s environment? Then head over to the multi-node guide and start from there. **This guide doesn't currently provide a migration path from single-node to multi-node deployments**.
7-
86
## Prerequisites
97

108
- A Linux or macOS machine
119
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/) to interact with the K8s cluster
12-
- [`multipass`](https://multipass.run/install) to manage VMs.
10+
- [`multipass`](https://multipass.run/install) if you plan to run K8s on VMs.
1311

1412
## Configuration process
15-
> If you plan to run Flyte directly on bare-metal servers, just follow the microk8s [installation instructions](https://microk8s.io/docs/getting-started) and skip to step 3
13+
> If you plan to run Flyte directly on Linux bare-metal servers, just follow the microk8s [installation instructions](https://microk8s.io/docs/getting-started) and skip to step 4:
14+
15+
1616
1. Create the VM where you'll run Kubernetes:
1717
``` bash
1818
multipass launch --name k8smaster --memory 4G --disk 40G
@@ -51,7 +51,11 @@ sudo usermod -a -G microk8s ubuntu
5151
``` bash
5252
cat /var/snap/microk8s/current/credentials/client.config
5353
```
54-
7. On a new terminal tab, open your kubectl config file (typically located at `$HOME/.kube/config`) and the the config for your new K8s instance:
54+
7. Exit the shell session
55+
```bash
56+
exit
57+
```
58+
8. On a new terminal tab, open your kubectl config file (typically located at `$HOME/.kube/config`) and the the config for your new K8s instance:
5559

5660
- a. Add a new entry to the `clusters` section including the `certificate-authority-data` and `server`
5761
- b. Replace the `server` IP with the IP for your machine/VM
@@ -88,7 +92,7 @@ Example output:
8892
```bash
8993
Switched to context "microk8s".
9094
```
91-
7. Test your connection:
95+
9. Test your connection:
9296
```bash
9397
kubectl get nodes
9498
```

docs/on-premises/single-node/002-single-node-onprem-install.md

Lines changed: 90 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
This section assumes that you have a working Kubernetes environment.
44

5-
You'll be configuring the external platform dependencies of Flyte:
5+
The external platform dependencies of Flyte are:
66

7-
- An S3-compliant object storage used for task metadata and to retrieve data to be processed by workflows.
7+
- An S3-compatible object storage used for task metadata and to retrieve data to be processed by workflows.
88
- A relational database.
99

1010
In this tutorial, we'll use Minio with a single bucket as the object storage provider and Postgres as the relational database. These two elements are configured to retain data even if the corresponding Pod is deleted.
1111

12-
> NOTE: this guide is intended for single-node K8s installations and doesn't provide migration instructions to switch to multi-node afterwards. If you plan to use multiple servers to run Flyte, go to the multi-node section and start from there.
12+
> NOTE: if you plan to run Flyte on a K8s environment with multiple nodes, the instructions in these section should be generally useful regardless of number of K8s worker and controlplane nodes. Also, to provide shared storage for your environment make sure to check out the supported `minio` [topologies](https://min.io/docs/minio/linux/operations/installation.html) and [supported backend storage systems](https://blog.min.io/best-practices-minio-virtualized/).
1313
1414
1. Prepare your K8s cluster to provision Persistent Volumes:
1515
```bash
1616
microk8s enable hostpath-storage
1717
```
1818
> NOTE: for other K8s distributions, verify the provisioner available for local storage, typically associated with a StorageClass (`kubectl get storageclass`). If there isn't any, consider using [this implementation](https://github.com/rimusz/hostpath-provisioner) of the hostpath provisioner. To learn more about how Kubernetes handles data persistency, go to [the docs](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).
1919
20-
> PersistentVolumeClaims created by the hostpath storage provisioner are bound to the local node, so **it is impossible to move them to a different node**.
20+
> PersistentVolumeClaims created by the hostpath storage provisioner are bound to the local node, so **it is impossible to move them to a different node**. For multi-node K8s environments, use the StorageClass surfaced by your shared storage backend.
2121
22-
2. Download the manifest that will provision the Flyte dependencies:
22+
2. Download the manifest that will deploy the Flyte dependencies:
2323
``` bash
24-
curl -sl https://raw.githubusercontent.com/davidmirror-ops/flyte-the-hard-way/main/docs/on-premises/single-node/manifests/local-flyte-resources.yaml > local-flyte-resources.yaml
24+
curl -sl https://raw.githubusercontent.com/davidmirror-ops/flyte-the-hard-way/main/docs/on-premises/single-node/manifests/onprem-flyte-dependencies.yaml > onprem-flyte-dependencies.yaml
2525
```
2626
3. Make sure to adjust sensitive values like `MINIO_ROOT_PASSWORD` and `POSTGRES_PASSWORD` before submitting the manifest:
2727
``` bash
@@ -47,10 +47,25 @@ NAME READY STATUS RESTARTS AGE
4747
postgres-6f6bb8bff7-9sjnj 1/1 Running 0 75s
4848
minio-7d795cd5d8-dlk54 1/1 Running 0 75s
4949
```
50-
5. In order to avoid saving the DB password in plain text to the `values` file, we leverage a recent addition to the `flyte-binary` chart that allows to consume pre-created secrets:
50+
5. Add the Flyte Helm repo:
51+
```bash
52+
helm repo add flyteorg https://flyteorg.github.io/flyte
53+
```
54+
At this point the dependencies required by Flyte are ready. You can now choose which form factor to deploy:
55+
56+
- Single binary: all [Flyte components](https://docs.flyte.org/en/latest/concepts/architecture.html) (`flyteadmin`,`flytepropeller`, `flyteconsole`, etc) packaged into a single Pod. This is useful for environments with limited resources and a need for quick setup.
57+
58+
- Core: all components as standalone Pods, and potentially different number of replicas. This is required for multi-K8s-cluster environments.
59+
60+
You can only have one of these form factors on a single K8s cluster.
61+
The following sections guide you through the setup process for each.
62+
63+
## Install single binary
64+
65+
1. In order to avoid saving the DB password in plain text to the `values` file, we leverage a feature of the `flyte-binary` chart that allows to consume pre-created secrets:
5166

5267
- Create an external secret containing the DB password:
53-
>Replace `<POSTGRES_PASSWORD>` with what you configured on step 3
68+
5469
```yaml
5570
cat <<EOF >local-secret.yaml
5671
apiVersion: v1
@@ -63,7 +78,7 @@ stringData:
6378
202-database-secrets.yaml: |
6479
database:
6580
postgres:
66-
password: <POSTGRES_PASSWORD>
81+
password: "postgres"
6782
EOF
6883
```
6984
- Submit the manifest:
@@ -87,17 +102,14 @@ Data
87102
====
88103
202-database-secrets.yaml: 48 bytes
89104
```
90-
6. Download the values file:
105+
2. Download the values file:
91106
```bash
92-
curl -sL https://raw.githubusercontent.com/davidmirror-ops/flyte-the-hard-way/main/docs/on-premises/single-node/manifests/local-values.yaml > local-values.yaml
107+
curl -sL https://raw.githubusercontent.com/davidmirror-ops/flyte-the-hard-way/main/docs/on-premises/single-node/manifests/onprem-flyte-binary/values.yaml > onprem-flyte-binary-values.yaml
93108

94-
7. Add the Flyte Helm repo:
95-
```bash
96-
helm repo add flyteorg https://flyteorg.github.io/flyte
97-
```
98-
8. Install Flyte:
109+
110+
3. Install Flyte:
99111
```bash
100-
helm install flyte-binary flyteorg/flyte-binary --values local-values.yaml -n flyte
112+
helm install flyte-binary flyteorg/flyte-binary --values onprem-flyte-binary-values.yaml -n flyte
101113
```
102114
Example output:
103115

@@ -110,7 +122,7 @@ REVISION: 1
110122
TEST SUITE: None
111123
```
112124

113-
9. Verify the `flyte-binary` Pod is in `Running` state:
125+
4. Verify the `flyte-binary` Pod is in `Running` state:
114126
```bash
115127
kubectl get pods -n flyte
116128
```
@@ -121,8 +133,49 @@ postgres-6f6bb8bff7-9sjnj 1/1 Running 0 30m
121133
minio-7d795cd5d8-dlk54 1/1 Running 0 30m
122134
flyte-binary-58d779b9d8-z2hzs 1/1 Running 0 23s
123135
```
124-
10. Configure your Flyte config file for local connections (typically located at `$HOME/.flyte/config.yaml`):
125-
> If you haven't done so, install `flytectl` so the config file is created. Check out the instructions [here](https://docs.flyte.org/en/latest/flytectl_overview.html#installation)
136+
Congratulations!
137+
You have setup Flyte single binary. Now, learn [how to connect to your Flyte instance](#connecting-to-flyte)
138+
## Install Flyte core
139+
140+
> The following configuration requests about 3 CPU cores and 3 GB of memory for the different Flyte components without accounting for workflow executions.
141+
142+
1. Download the values file
143+
```bash
144+
curl -sL https://raw.githubusercontent.com/davidmirror-ops/flyte-the-hard-way/main/docs/on-premises/single-node/manifests/onprem-flyte-core-values.yaml > onprem-flyte-core-values.yaml
145+
```
146+
2. Review the values file if you need to change anything in the `userSettings` section.
147+
3. Install the `flyte-core` Helm chart:
148+
```bash
149+
helm install flyte-core flyteorg/flyte-core --values onprem-flyte-core-values.yaml -n flyte
150+
```
151+
Example output
152+
```bash
153+
NAME: flyte-core
154+
LAST DEPLOYED: Fri Mar 8 11:09:10 2024
155+
NAMESPACE: flyte
156+
STATUS: deployed
157+
REVISION: 1
158+
TEST SUITE: None
159+
```
160+
4. Wait for the Pods to come up:
161+
```bash
162+
kubectl get po -n flyte
163+
164+
NAME READY STATUS RESTARTS AGE
165+
postgres-d56745848-7dkhl 1/1 Running 4 (3d ago) 16d
166+
minio-758b9b5d86-s2tnl 1/1 Running 3 (3d ago) 7d21h
167+
syncresources-7cdd9f468c-kzndm 1/1 Running 0 58s
168+
flyteconsole-856d9c594b-qmjv8 1/1 Running 0 58s
169+
datacatalog-bddddcc47-lnmhk 1/1 Running 0 58s
170+
flytepropeller-6dbb9f8cb5-w7wsn 1/1 Running 0 58s
171+
flyte-pod-webhook-867c44bdd4-thrth 1/1 Running 0 58s
172+
flyteadmin-66cb66764d-j7cx2 1/1 Running 0 58s
173+
flytescheduler-579b6cb648-jmmgm 1/1 Running 0 58s
174+
```
175+
## Connecting to Flyte
176+
177+
1. Configure your Flyte config file for local connections (typically located at `$HOME/.flyte/config.yaml`):
178+
> If you haven't done so, install `flytectl` and run `flytectl config init` so the config file is created. Check out the instructions [here](https://docs.flyte.org/en/latest/flytectl_overview.html#installation)
126179
127180
```yaml
128181
admin:
@@ -134,7 +187,7 @@ logger:
134187
show-source: true
135188
level: 6
136189
```
137-
11. Create a local DNS entry so the Flyte CLI connects to the `minio` service using its FQDN:
190+
2. Create a local DNS entry so the Flyte CLI connects to the `minio` service using its FQDN:
138191
139192
- In an OSX environment:
140193
```bash
@@ -149,9 +202,9 @@ sudo vi /etc/hosts
149202
##
150203
127.0.0.1 minio.flyte.svc.cluster.local
151204
```
152-
12. In three different terminal windows, start three port-forwarding sessions:
153-
205+
3. In three different terminal windows, start three port-forwarding sessions. As each Helm chart uses different Services and ports, the commands are different:
154206
207+
### Single binary
155208
```bash
156209
kubectl -n flyte port-forward service/minio 9000:9000
157210
```
@@ -161,9 +214,19 @@ kubectl -n flyte port-forward service/flyte-binary-grpc 8089:8089
161214
```bash
162215
kubectl -n flyte port-forward service/flyte-binary-http 8088:8088
163216
```
217+
### Core
218+
```bash
219+
kubectl -n flyte port-forward service/minio 9000:9000
220+
```
221+
```bash
222+
kubectl -n flyte port-forward service/flyteadmin 8089:81
223+
```
224+
```bash
225+
kubectl -n flyte port-forward service/flyteconsole 8088:80
226+
```
227+
## Using Flyte
164228
165-
166-
13. Save the following "hello world" workflow definition:
229+
4. Save the following "hello world" workflow definition:
167230
168231
```bash
169232
cat <<<EOF >hello_world.py
@@ -179,7 +242,7 @@ if __name__ == "__main__":
179242
print(f"Running my_wf() {my_wf()}")
180243
EOF
181244
```
182-
14. Execute the workflow on the Flyte cluster:
245+
5. Execute the workflow on the Flyte cluster:
183246
```bash
184247
pyflyte run --remote hello_world.py my_wf
185248
```
@@ -188,7 +251,7 @@ Example output:
188251
Go to http://localhost:8089/console/projects/flytesnacks/domains/development/executions/f0c602e28c5c84d46b22 to see execution in the console.
189252
```
190253
> NOTE: different to what the CLI output indicates, use the `8088` port instead of 8089 to connect to the UI
191-
15. Go to the Flyte console and monitor the execution:
254+
6. Go to the Flyte console and monitor the execution:
192255
![](../../images/local-flyte-ui.png)
193256
194257
---

docs/on-premises/single-node/003-ingress-tls.md

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add Ingress and Transport Layer Security (TLS)
22

3-
To avoid the need to open port-forward sessions and being able to connect to the Flyte instance using a single IP/FQDN, this guide will help you add Ingress networking to your deployment. Also, to create a secure communication tunnel between the client and the Flyte instance, you'll configure TLS.
3+
To avoid the need to open port-forward sessions to connect to the Flyte instance using a single IP/FQDN, this guide will help you add and [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) resource to your deployment. Also, to create a secure communication tunnel between the client and the Flyte instance, you'll configure TLS.
44

55
## Add Ingress networking
66

@@ -12,6 +12,7 @@ microks enable ingress
1212
>NOTE: for other distributions, check out the NGINX [installation instructions](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-helm/)
1313
1414
>This guide uses NGINX as it supports the annotations that Flyte uses.
15+
1516
2. Verify the status of the NGINX Ingress controller pod:
1617
```bash
1718
kubectl get pod -n ingress
@@ -21,32 +22,64 @@ Example output:
2122
NAME READY STATUS RESTARTS AGE
2223
nginx-ingress-microk8s-controller-6tdpg 1/1 Running 0 50m
2324
```
24-
3. Add the following block to your `local-values.yaml` file:
25+
26+
27+
3. Add the following block to values file, depending on the Helm chart you installed:
28+
29+
## Single binary
2530
```yaml
2631
ingress:
2732
create: true
2833
ingressClassName: nginx
2934
httpAnnotations:
30-
nginx.ingress.kubernetes.io/app-root: /console
35+
nginx.ingress.kubernetes.io/app-root: /console
3136
grpcAnnotations:
32-
nginx.ingress.kubernetes.io/backend-protocol: GRPC
37+
nginx.ingress.kubernetes.io/backend-protocol: GRPC
3338
host: flyteonprem.fthw.local #Replace this with the domain name you plan to use to connect to Flyte
3439
```
40+
## Core
41+
```yaml
42+
common:
43+
ingress:
44+
create: true
45+
ingressClassName: nginx
46+
httpAnnotations:
47+
nginx.ingress.kubernetes.io/app-root: /console
48+
grpcAnnotations:
49+
nginx.ingress.kubernetes.io/backend-protocol: GRPC
50+
host: flyteonprem.fthw.local #Replace this with the domain name you plan to use to connect to Flyte.
51+
```
52+
3553
4. Save your changes.
36-
5. Upgrade the Helm deployment:
54+
5. Upgrade the Helm release:
55+
56+
## Single binary
3757
```bash
38-
helm upgrade flyte-binary flyteorg/flyte-binary --values local-values.yaml -n flyte
58+
helm upgrade flyte-binary flyteorg/flyte-binary --values onprem-flyte-binary-values.yaml -n flyte
59+
```
60+
61+
## Core
62+
```bash
63+
helm upgrade flyte-core flyteorg/flyte-core --values onprem-flyte-core-values.yaml -n flyte
3964
```
4065
6. Verify the status of your Ingress resource:
4166
```bash
4267
kubectl get ingress -n flyte
4368
```
4469
Example output:
70+
71+
## Single binary
4572
```bash
4673
NAME CLASS HOSTS ADDRESS PORTS AGE
4774
flyte-binary-http nginx flyteonprem.fthw.local 127.0.0.1 80 168m
4875
flyte-binary-grpc nginx flyteonprem.fthw.local 127.0.0.1 80 168m
4976
```
77+
## Core
78+
```bash
79+
NAME CLASS HOSTS ADDRESS PORTS AGE
80+
flyte-core nginx flyteonprem.fthw.local 127.0.0.1 80 168m
81+
```
82+
5083
7. Create a new A register for your `HOST` in your DNS server pointing to the IP address of your server. In the absence of a DNS server, edit your local file adding a new entry:
5184

5285
- In an OSX environment:
@@ -86,29 +119,38 @@ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${KEY_FILE} -out ${C
86119
``` bash
87120
kubectl create secret tls ${CERT_NAME} --key ${KEY_FILE} --cert ${CERT_FILE} -n flyte
88121
```
89-
4. Add a `tls` section to the ingress definition in you `local-values.yaml` file:
122+
4. Add a `tls` section to the ingress definition in you `values` file:
90123
```yaml
91124
ingress:
92125
tls:
93-
- hosts:
94-
- "flyteonprem.fthw.local"#replace with your hostname
126+
enabled: true
127+
- hosts:
128+
- "flyteonprem.fthw.local"#replace with your hostname
95129
secretName: flytetls
96-
create: true
97-
ingressClassName: nginx
98-
httpAnnotations:
99-
nginx.ingress.kubernetes.io/app-root: /console
100-
grpcAnnotations:
101-
nginx.ingress.kubernetes.io/backend-protocol: GRPC
102-
host: flyteonprem.fthw.local
130+
...
103131
```
104132
5. Upgrade your Helm release
133+
## Single binary
105134
```bash
106-
helm upgrade flyte-binary flyteorg/flyte-binary --values local-values.yaml -n flyte
135+
helm upgrade flyte-binary flyteorg/flyte-binary --values onprem-flyte-binary-values.yaml -n flyte
107136
```
108-
6. Verify that your Ingress resource now includes TLS:
137+
138+
## Core
139+
```bash
140+
helm upgrade flyte-core flyteorg/flyte-core --values onprem-flyte-core-values.yaml -n flyte
141+
```
142+
6. Verify that your Ingress configuration now includes TLS:
143+
144+
## Single binary
109145
```bash
110146
kubectl describe ingress flyte-binary-grpc -n flyte
111147
```
148+
149+
## Core
150+
```bash
151+
kubectl describe ingress flyte-core -n flyte
152+
```
153+
112154
The output should include a line similar to:
113155
```yaml
114156
...

0 commit comments

Comments
 (0)