JupyterHub, a multi-user server, manages and proxies multiple instances of the single-user IPython Jupyter notebook server.
This extension allows a JupyterHub front-end to spawn the JupyterNotebooks into cloud computing infrastructure.
Change into the autoaws folder
cd autoaws
- Open Amazon AWS "Your Security Credentials"
- Click "Create New Access Key"
- Store Credentials in a home directory, ~/.aws/credentials
[default]
aws_access_key_id = <your_access_key_id>
aws_secret_access_key = <your_secret_access_key>
autoaws$ python3 run.py <cluster_name>
- NOTE: Wait patiently!
Success! Created cluster.yaml
Next steps:
1. (Optional) Edit cluster.yaml to parameterize the cluster.
2. Use the "kube-aws render" command to render the stack template.
Success! Stack rendered to stack-template.json.
Next steps:
1. (Optional) Validate your changes to cluster.yaml with "kube-aws validate"
2. (Optional) Further customize the cluster by modifying stack-template.json or files in ./userdata.
3. Start the cluster with "kube-aws up".
Creating AWS resources. This should take around 5 minutes.
Success! Your AWS resources have been created:
Cluster Name: <cluster_name>
Controller IP: 52.70.194.118
The containers that power your cluster are now being dowloaded.
You should be able to access the Kubernetes API once the containers finish downloading.
Cluster Name: <cluster_name>
Controller IP: 52.70.194.118
NOTE: You can see your running instances using the AWS Dashboard, EC2 instances, Running Instances
autoaws$ sudo sed -i '$s/$/\n52.70.194.118 <cluster_name>.omgwtf.in/' /etc/hosts
For Linux:
wget https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
For OS X:
wget https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/darwin/amd64/kubectl
autoaws$ chmod +x kubectl
autoaws$ sudo mv kubectl /usr/local/bin/
autoaws$ kubectl --kubeconfig=<cluster_name>/kubeconfig get nodes
NAME LABELS STATUS
ip-10-0-0-50.ec2.internal kubernetes.io/hostname=ip-10-0-0-50.ec2.internal Ready,SchedulingDisabled
ip-10-0-0-64.ec2.internal beta.kubernetes.io/instance-type=m3.medium,failure-domain.beta.kubernetes.io/region=us-east-1,failure-domain.beta.kubernetes.io/zone=us-east-1c,kubernetes.io/hostname=ip-10-0-0-64.ec2.internal Ready
hub$ kubectl --kubeconfig=../autoaws/mudsa/kubeconfig create -f hub.yaml
hub$ kubectl --kubeconfig=../autoaws/mudsa/kubeconfig create -f config.yaml
hub$ kubectl --kubeconfig=../autoaws/mudsa/kubeconfig --namespace=jupyter get pods
NAME READY STATUS RESTARTS AGE
hub-vi9xy 1/1 Running 0 1m
hub$ kubectl --kubeconfig=../autoaws/mudsa/kubeconfig --namespace=jupyter get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
jupyterhub 10.3.0.40 8000/TCP 13m
-
NOTE: Due to bug in AWS(?) the EXTERNAL-IP is not provided.
-
To find the public endpoint of the elastic load balancer:
- In AWS Dashboard > EC2 Dashboard > Load Balancers
- Click on Load Balancer and view description
DNS name:
a3c48b0dc211311e685a612e85b7665b-1960005297.us-east-1.elb.amazonaws.com (A Record)
- Copy the name and append the port in the Browser to access JupyterHub
http://a3c48b0dc211311e685a612e85b7665b-1960005297.us-east-1.elb.amazonaws.com:8000/hub/login
- Log into AWS Dashboard > EC2 Dashboard > Load Balancers
- Remove the load balancer
- Use the Kubernetes to destroy the AWS cluster
autoaws$ cd <cluster_name>
autoaws/<cluster_name>$ ../kube-aws destroy
CloudFormation stack is being destroyed. This will take several minutes