Skip to content

Commit f66f151

Browse files
authored
Merge pull request #3197 from yuvipanda/bare
Add another smaller 2i2c federation member + k3s docs
2 parents 20cba1f + 72a1a34 commit f66f151

File tree

3 files changed

+55
-8
lines changed

3 files changed

+55
-8
lines changed

config/prod.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,16 @@ federationRedirect:
234234
weight: 70
235235
health: https://2i2c.mybinder.org/health
236236
versions: https://2i2c.mybinder.org/versions
237+
hetzner-2i2c-bare:
238+
prime: false
239+
url: https://2i2c-bare.mybinder.org
240+
weight: 5
241+
health: https://2i2c-bare.mybinder.org/health
242+
versions: https://2i2c-bare.mybinder.org/versions
237243
gesis:
238244
prime: false
239245
url: https://notebooks.gesis.org/binder
240-
weight: 30
246+
weight: 25
241247
health: https://notebooks.gesis.org/binder/health
242248
versions: https://notebooks.gesis.org/binder/versions
243249
ovh2:

deploy.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232

3333
# Projects using raw KUBECONFIG files
34-
KUBECONFIG_CLUSTERS = {"ovh2", "hetzner-2i2c"}
34+
KUBECONFIG_CLUSTERS = {"ovh2", "hetzner-2i2c", "hetzner-2i2c-bare"}
3535

3636
# Mapping of config name to cluster name for AWS EKS deployments
3737
AWS_DEPLOYMENTS = {"curvenote": "binderhub"}
@@ -437,7 +437,10 @@ def main():
437437
argparser.add_argument(
438438
"release",
439439
help="Release to deploy",
440-
choices=["staging", "prod", "ovh", "ovh2", "curvenote", "hetzner-2i2c"],
440+
choices=list(KUBECONFIG_CLUSTERS)
441+
+ list(GCP_PROJECTS.keys())
442+
+ list(AWS_DEPLOYMENTS.keys())
443+
+ list(AZURE_RGs.keys()),
441444
)
442445
argparser.add_argument(
443446
"--name",

docs/source/deployment/k3s.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,30 @@ do not need traefik.
5555

5656
## Extracting authentication information via a `KUBECONFIG` file
5757

58-
Follow https://docs.k3s.io/cluster-access#accessing-the-cluster-from-outside-with-kubectl
58+
Next, we extract the `KUBECONFIG` file that the `mybinder.org-deploy` repo and team members can use to access
59+
this cluster externally by following [upstream documentation](https://docs.k3s.io/cluster-access#accessing-the-cluster-from-outside-with-kubectl).
60+
The short version is:
61+
62+
1. Copy the `/etc/rancher/k3s/k3s.yaml` into the `secrets/` directory in this repo:
63+
64+
```bash
65+
scp root@<public-ip>:/etc/rancher/k3s/k3s.yaml secrets/<cluster-name>-kubeconfig.yml
66+
```
67+
68+
Pick a `<cluster-name>` that describes what cluster this is - we will be consistently using it for other files too.
69+
70+
Note the `.yml` here - everything else is `.yaml`!
71+
72+
2. Change the `server` field under `clusters.0.cluster` from `https://127.0.0.1:6443` to `https://<public-ip>:6443`.
73+
74+
## Create a new ssh key for mybinder team members
75+
76+
For easy access to this node for mybinder team members, we create and check-in an ssh key as
77+
a secret.
78+
79+
1. Run `ssh-keygen -t ed25519 -f secrets/<cluster-name>.key` to create the ssh key. Leave the passphrase blank.
80+
2. Set appropriate permissions with `chmod 0400 secrets/<cluster-name>.key`.
81+
3. Copy `secrets/<cluster-name>.key.pub` (**NOTE THE .pub**) and paste it as a **new line** in `/root/.ssh/authorized_keys` on your server. Do not replace any existing lines in this file.
5982

6083
## Setup DNS entries
6184

@@ -70,16 +93,31 @@ Add the following entries:
7093

7194
Give this a few minutes because it may take a while to propagate.
7295

73-
## Make a config copy for this new member
96+
## Make a config + secret copy for this new member
97+
98+
Now we gotta start a config file and a secret config file for this new member. We can start off by copying an existing one!
7499

75-
TODO
100+
Let's copy `config/hetzner-2i2c.yaml` to `config/<cluster-name>.yaml` and make changes!
76101

77-
## Make a secret config for this new member
102+
1. Find all hostnames, and change them to point to the DNS entries you made in the previous step.
103+
2. Change `ingress-nginx.controller.service.loadbalancerIP` to be the external public IP of your cluster
104+
3. Adjust the following parameters based on the size of the server:
105+
a. `binderhub.config.LaunchQuota.total_quota`
106+
b. `dind.resources`
107+
c. `imageCleaner`
108+
4. TODO: Something about the registry.
78109

79-
TODO
110+
We also need a secrets file, so let's copy `secrets/config/hetzner-2i2c.yaml` to `secrets/config/<cluster-name>.yaml` and make changes!
111+
112+
1. Find all hostnames, and change them to point to the DNS entries you made in the previous step.
113+
2. TODO: Something about the registry
80114

81115
## Deploy binder!
82116

117+
Let's tell `deploy.py` script that we have a new cluster by adding `<cluster-name>` to `KUBECONFIG_CLUSTERS` variable in `deploy.py`.
118+
119+
Once done, you can do a deployment with `./deploy.py <cluster-name>`! If it errors out, tweak and debug until it works.
120+
83121
## Test and validate
84122

85123
## Add to the redirector

0 commit comments

Comments
 (0)