Skip to content

Commit

Permalink
add more prettier changes;
Browse files Browse the repository at this point in the history
  • Loading branch information
MridulS committed Sep 29, 2021
1 parent 02c5bd9 commit 07968e7
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 58 deletions.
29 changes: 16 additions & 13 deletions examples/nodeport/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
This example is created for documentation purposes and
it contains a minimal configuration to deploy a persistent BinderHub.
This example is created for documentation purposes and
it contains a minimal configuration to deploy a persistent BinderHub.
It is not meant to be used in production.

This example configuration
- requires that a default [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/)
is set (see https://zero-to-jupyterhub.readthedocs.io/en/latest/customizing/user-storage.html)
- uses [nodePort services](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
to expose the application on `<NodeIP>:<NodePort>`
- doesn't uses a [container registry](https://binderhub.readthedocs.io/en/latest/setup-registry.html),
so only local docker images are used, this is useful when running in a single node
- uses the default authenticator (DummyAuthenticator),
see the [authentication guide](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/authentication.html) to obtain more information

- requires that a default [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/)
is set (see https://zero-to-jupyterhub.readthedocs.io/en/latest/customizing/user-storage.html)
- uses [nodePort services](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
to expose the application on `<NodeIP>:<NodePort>`
- doesn't uses a [container registry](https://binderhub.readthedocs.io/en/latest/setup-registry.html),
so only local docker images are used, this is useful when running in a single node
- uses the default authenticator (DummyAuthenticator),
see the [authentication guide](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/authentication.html) to obtain more information
- uses the default [database for hub](https://zero-to-jupyterhub.readthedocs.io/en/latest/reference/reference.html#hub-db)
- doesn't define [compute resources for user containers](https://zero-to-jupyterhub.readthedocs.io/en/latest/customizing/user-resources.html#set-user-memory-and-cpu-guarantees-limits)
- disables [cluster autoscaling](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/optimization.html#efficient-cluster-autoscaling) for simplicity
- disables image cleaner,
[dind](https://binderhub.readthedocs.io/en/latest/setup-binderhub.html#use-docker-inside-docker-dind)
and [https](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/advanced.html#ingress) for simplicity
- disables image cleaner,
[dind](https://binderhub.readthedocs.io/en/latest/setup-binderhub.html#use-docker-inside-docker-dind)
and [https](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/advanced.html#ingress) for simplicity

If you want to deploy a test persistent BinderHub with this config:

1. you have to replace `<NodeIP>` in `examples/nodeport/config.yaml` with the IP of your node
2. then assuming that you are at repo root, run

```bash
helm dependency update persistent_binderhub
kubectl create namespace pbhub-test-ns
Expand All @@ -31,4 +33,5 @@ helm upgrade pbhub-test persistent_binderhub \
--debug

```

3. and finally you can reach it at `http://<NodeIP>:30123`
1 change: 0 additions & 1 deletion examples/nodeport/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
binderhub:

config:
BinderHub:
debug: true
Expand Down
84 changes: 44 additions & 40 deletions local/minikube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,55 @@ If you would like to contribute to Persistent BinderHub you can set up a local
deployment of Persistent BinderHub using minikube.

1. Follow the [documentation](https://kubernetes.io/docs/tasks/tools/install-minikube/) to install minikube
and then start your local cluster with
`minikube start --driver <driver_name>`
or if you want to start it with a specific kubernetes version and with 4 CPUs and 8 GB
`minikube start --kubernetes-version v1.18.3 --driver <driver_name> --cpus 4 --memory 8192`
and when the local cluster is ready, you can check the status with
`minikube status`.

2. Install and initialize helm:
```bash
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm version
```

3. Clone the repo and cd into it:
and then start your local cluster with
`minikube start --driver <driver_name>`
or if you want to start it with a specific kubernetes version and with 4 CPUs and 8 GB
`minikube start --kubernetes-version v1.18.3 --driver <driver_name> --cpus 4 --memory 8192`
and when the local cluster is ready, you can check the status with
`minikube status`.

2. Install and initialize helm:

```bash
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm version
```

3. Clone the repo and cd into it:

```bash
git clone https://github.com/gesiscss/persistent_binderhub.git
cd persistent_binderhub
```

4. Run `minikube ip` to get the IP of the running cluster and
in `local/minikube/config.yaml` replace all occurrences of the dummy IP (`127.0.0.1`) with the IP of the cluster.

5. Deploy persistent BinderHub:
```bash
# fetch the required charts (BinderHub and JupyterHub charts) into charts folder
helm dependency update persistent_binderhub
# test local config
helm template persistent_binderhub -f local/minikube/config.yaml
# install it in minikube cluster
kubectl create namespace pbhub-dev-ns
helm upgrade pbhub-dev persistent_binderhub/. \
--install --namespace=pbhub-dev-ns \
-f local/minikube/config.yaml \
--debug
```
Make sure you are in the `/path_to_folder/persistent_binderhub/` directory while running these commands.

It takes couple of minutes until all pods get ready,
because required docker images must be downloaded into the local minikube cluster.
Meanwhile you can run the following command to observe the pods until they have status `Running`:
`kubectl get pod --namespace=pbhub-dev-ns --watch`
You can exit watching pods by `CTRL+C`.
```

4. Run `minikube ip` to get the IP of the running cluster and
in `local/minikube/config.yaml` replace all occurrences of the dummy IP (`127.0.0.1`) with the IP of the cluster.

5. Deploy persistent BinderHub:

```bash
# fetch the required charts (BinderHub and JupyterHub charts) into charts folder
helm dependency update persistent_binderhub
# test local config
helm template persistent_binderhub -f local/minikube/config.yaml
# install it in minikube cluster
kubectl create namespace pbhub-dev-ns
helm upgrade pbhub-dev persistent_binderhub/. \
--install --namespace=pbhub-dev-ns \
-f local/minikube/config.yaml \
--debug
```

Make sure you are in the `/path_to_folder/persistent_binderhub/` directory while running these commands.

It takes couple of minutes until all pods get ready,
because required docker images must be downloaded into the local minikube cluster.
Meanwhile you can run the following command to observe the pods until they have status `Running`:
`kubectl get pod --namespace=pbhub-dev-ns --watch`
You can exit watching pods by `CTRL+C`.

6. Finally run this command to get the url of your persistent BinderHub instance:
`minikube service proxy-public --namespace=pbhub-dev-ns --url=true`
`minikube service proxy-public --namespace=pbhub-dev-ns --url=true`

## Tearing everything down

Expand Down
8 changes: 4 additions & 4 deletions local/minikube/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ binderhub:
config:
BinderHub:
debug: true
hub_url: http://127.0.0.1:31123
hub_url: http://192.168.99.181:31123
# use only local docker images
use_registry: false

Expand All @@ -28,16 +28,16 @@ binderhub:
hub:
services:
binder:
url: http://127.0.0.1:31124
oauth_redirect_uri: "http://127.0.0.1:31123/services/binder/oauth_callback"
url: http://192.168.99.181:31124
oauth_redirect_uri: "http://192.168.99.181:31123/services/binder/oauth_callback"
oauth_client_id: "binder-oauth-client-dev"
resources:
requests:
cpu: 0
memory: 0
config:
Authenticator:
admin_users: ['admin']
admin_users: ["admin"]

proxy:
https:
Expand Down

0 comments on commit 07968e7

Please sign in to comment.