Git Product home page Git Product logo

k8s-cluster-deploy's Introduction

k8s-cluster-deploy

Set Up

# Install kops on OS X
$ brew update && brew install kops

# Create S3 bucket to store config
$ aws s3 mb s3://clusters.k8s.calpolydatascience.org

# Set NAME and KOPS_STATE_STORE
# Public was: k8s.thedwightway.com
$ export NAME=calpolydatascience.k8s.local
$ export KOPS_STATE_STORE=s3://clusters.k8s.calpolydatascience.org

Create Cluster

# kops create cluster --zones=us-west-1c k8s.thedwightway.com
$ kops create cluster \
    --zones us-west-2a \
    --node-count=2 \
    --node-size=t2.medium \
    --master-size=t2.medium \
    ${NAME}

# Customize/view the cluster specs
kops edit cluster ${NAME}

# Build the cluster for real
kops update cluster ${NAME} --yes

# Optional Deployment Method via CloudFormation
# Writes tempate to ./out
kops update cluster ${NAME} --target=cloudformation

Set Up Helm

# Install helm, on OS X
$ brew install kubernetes-helm

# Create tiller service account, cluster-side package manager
$ kubectl --namespace kube-system create serviceaccount tiller
$ helm init --service-account tiller

Deploy JupyterHub from Helm Chart

See config.yaml

$ helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
$ helm repo update
$ helm install jupyterhub/jupyterhub \
    --version=v0.6 \
    --name=<YOUR-RELEASE-NAME> \
    --namespace=<YOUR-NAMESPACE> \
    -f config.yaml
# Example
$ helm install jupyterhub/jupyterhub \
    --version=v0.6 \
    --name=alpha \
    --namespace=alpha \
    -f config.yaml

$ kubectl -n alpha get pod
NAME                     READY     STATUS    RESTARTS   AGE
hub-945946ccc-vg77l      1/1       Running   1          1m
proxy-77fc8fdf79-rggvg   2/2       Running   0          1m

$ kubectl -n alpha get svc
NAME           TYPE           CLUSTER-IP       EXTERNAL-IP        PORT(S)                      AGE
hub            ClusterIP      100.65.176.102   <none>             8081/TCP                     2m
proxy-api      ClusterIP      100.71.252.191   <none>             8001/TCP                     2m
proxy-http     ClusterIP      100.64.150.111   <none>             8000/TCP                     2m
proxy-public   LoadBalancer   100.66.142.110   a73e49ae81e4d...   80:32174/TCP,443:31291/TCP   2m

Making changes

$ helm upgrade alpha jupyterhub/jupyterhub --version=v0.6 -f config.yaml

To Do:

  • Configure GitHibOAuth via config.yaml
  • Create kops user and policies in AWS IAM
  • This: aws s3api put-bucket-versioning --bucket prefix-example-com-state-store --versioning-configuration Status=Enabled
  • AWS EFS storage BS: https://github.com/kubernetes-incubator/external-storage/tree/master/aws/efs
  • Secure Helm:
    kubectl --namespace=kube-system patch deployment tiller-deploy --type=json --patch='[{"op": "add", "path": "/spec/template/spec/containers/0/command", "value": ["/tiller", "--listen=localhost:44134"]}]'
    
  • Fix the RBAC stuff
  • Load test based on DATA301 course work
  • Document pip install --user [package], so user can persist packages. Maybe set as the default?

Sources:

k8s-cluster-deploy's People

Contributors

awstown avatar

Stargazers

Ernesto Espinosa avatar

Watchers

 avatar Ernesto Espinosa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.