selkies-project / selkies-operator

K8s operator for per-user stateful workloads
https://selkies.io
Apache License 2.0
72 stars 13 forks source link
gke kubernetes selkies

Selkies - Stateful Workload Operator

Discord

Selkies is a platform built on GKE to orchestrate per-user stateful workloads.

Quick start

Assumptions

Steps

The steps below will create the infrastructure for the app launcher. You should deploy to a new project.

  1. Clone the source repository:

    git clone -b master https://github.com/selkies-project/selkies.git
    cd selkies
  2. Configure gcloud (replace XXX & us-west1 with your project ID & preferred region):

    export PROJECT_ID=XXX
    export REGION=us-west1
    gcloud config set project ${PROJECT_ID?}
    gcloud config set compute/region ${REGION?}
  3. Enable the required GCP project services:

    gcloud services enable \
        --project ${PROJECT_ID?} \
        cloudresourcemanager.googleapis.com \
        compute.googleapis.com \
        container.googleapis.com \
        cloudbuild.googleapis.com \
        servicemanagement.googleapis.com \
        serviceusage.googleapis.com \
        stackdriver.googleapis.com \
        secretmanager.googleapis.com \
        iap.googleapis.com
  4. Grant the cloud build service account permissions on your project:

    PROJECT_NUMBER=$(
      gcloud projects describe ${PROJECT_ID?} \
        --format='value(projectNumber)'
    ) && \
      CLOUDBUILD_SA="${PROJECT_NUMBER?}@cloudbuild.gserviceaccount.com" && \
      gcloud projects add-iam-policy-binding ${PROJECT_ID?} \
        --member serviceAccount:${CLOUDBUILD_SA?} \
        --role roles/owner && \
      gcloud projects add-iam-policy-binding ${PROJECT_ID?} \
        --member serviceAccount:${CLOUDBUILD_SA?} \
        --role roles/iam.serviceAccountTokenCreator
  5. Deploy with Cloud Build:

    ACCOUNT=$(gcloud config get-value account) && \
      gcloud builds submit \
        --project=${PROJECT_ID?} \
        --substitutions=_USER=${ACCOUNT?},_REGION=${REGION?}
  6. Deploy sample app:

    (cd examples/jupyter-notebook/ && \
      gcloud builds submit \
        --project=${PROJECT_ID?} \
        --substitutions=_REGION=${REGION?})
  7. Connect to the App Launcher web interface at the URL output below:

    echo "https://broker.endpoints.${PROJECT_ID?}.cloud.goog/"

Troubleshooting