Skip to content

Instantly share code, notes, and snippets.

@abarciauskas-bgse
Last active May 18, 2019 05:42
Show Gist options
  • Save abarciauskas-bgse/06bba856b9713fecabffed703f370667 to your computer and use it in GitHub Desktop.
Save abarciauskas-bgse/06bba856b9713fecabffed703f370667 to your computer and use it in GitHub Desktop.

Kubernetes Cluster Setup

Started from https://zero-to-jupyterhub.readthedocs.io/en/latest/amazon/step-zero-aws-eks.html

Notes from each step:

Step 1: EKS Service Role

Step 2: EKS Cluster

Steps 3-5 nothing to add

Step 6 This was a bit confusing because the zero-to-jupyterhub guide makes me think I need to update ~/.kube/config but it looks like that file is generated completely by the aws cli correctly when you run:

aws eks --region {region} update-kubeconfig --name {cluster_name}

per AWS instructions

Steps 7-10 Nothing to add

Deploying Helm

Now using https://docs.dask.org/en/latest/setup/kubernetes.html

helm repo update 
helm install stable/dask
helm upgrade --force --recreate-pods --devel singed-sabertooth stable/dask -f dask_config.yml

See dask_config.yml in this gist.

AWS EKS Cluster

  • 3 m4.2xlarge ec2 instances

Other references

Other notes (can ignore)

  • When runninng ./3_deploy_helm.sh got the error:

    Error: priorityclasses.scheduling.k8s.io "pangeohub-default-priority" is forbidden: User "system:serviceaccount:kube-system:default" cannot delete priorityclasses.scheduling.k8s.io at the cluster scope

    This might be because of the instruction https://zero-to-jupyterhub.readthedocs.io/en/latest/amazon/step-zero-aws-eks.html to use

    kubectl create clusterrolebinding cluster-system-anonymous --clusterrole=cluster-admin --user=system:anonymous

    I googled the error and ran these commands and it seems to have resolved itself. I can now run ./3_deploy_helm.sh without error.

  • When running kubectl commands, always need to add --namespace pangeo

  • Using kubectl logs is critical, worker logs will not show up in jupyter

jupyter:
name: jupyter
env:
- name: EXTRA_CONDA_PACKAGES
value: numpy zarr netCDF4 xarray s3fs -c conda-forge --yes
- name: AWS_ACCESS_KEY_ID
value: xxx
- name: AWS_SECRET_ACCESS_KEY
value: xxx
worker:
name: worker
env:
- name: EXTRA_CONDA_PACKAGES
value: numpy zarr netCDF4 xarray s3fs -c conda-forge --yes
- name: AWS_ACCESS_KEY_ID
value: xxx
- name: AWS_SECRET_ACCESS_KEY
value: xxx
scheduler:
name: scheduler
env:
- name: EXTRA_CONDA_PACKAGES
value: numpy zarr netCDF4 xarray s3fs -c conda-forge --yes
- name: AWS_ACCESS_KEY_ID
value: xxx
- name: AWS_SECRET_ACCESS_KEY
value: xxx
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment