Skip to content

DeveloperKubernetesSetup

Tim Stair edited this page Apr 23, 2020 · 1 revision

Developer Kubernetes Setup

In order to have an Executor dynamically allocate Handler pods in Kubernetes, you will need your Kubernetes secret keys, and namespace.

Prerequisites

  • A Kubernetes cluster! (minikube, etc.)
  • Install kubectl

Setup the Priority Operation Processing Namespace

Using 'kubectl' setup a new namespace. You may need to get permission from your kubernetes administrators to perform this action.

kubectl create namespace pop

The following command will default your context so you don't have to specify each time.

kubectl config set-context $(kubectl config current-context) --namespace=pop

Setup the Priority Operation Processing Service User

⚠️ Please be sure you are on the right cluster and namespace!

cd deploy/resourcepool/kubernetes/setup
kubectl create -f pop-service-account.yaml
kubectl create -f RoleBinding.yaml

Confirm everything:

kubectl get serviceaccounts/pop-service
kubectl describe RoleBinding pop-edit-service
kubectl get serviceaccounts

You should see the pop-service item

kubectl get rolebindings

You should see the pop-edit-service role binding`

Create Credentials

⚠️ Do NOT create/use credentials if you are working with a Minikube cluster. They are not necessary nor will they work!

Switch to your kubernetes instance and new pop context in kubernetes

⚠️ Please replace <your.k8s.instance>

kubectl config use-context <your.k8s.instance>
kubectl config set-context <your.k8s.instance> --namespace=pop

Get the "secret name". Copy the result and use it as the "secret name" below.

echo kubectl get sa -n pop pop-service -o jsonpath={.secrets[0].name}

Create the cert for the "secret name"

kubectl get secret <secret name> -n pop -o jsonpath='{.data.ca\.crt}' > pop-service.ca.cert

Create the token for the "secret name". Note: On the windows/linux use -d instead of -D

kubectl get secret <secret name> -n pop -o jsonpath='{.data.token}' | base64 -D > pop-service.sa.token

Priority Operation Processing

  1. Submission
  2. Scheduling
  3. Execution
    the ResourcePool

Data Object API

Agenda
the workflow
Agenda Template
the workflow definition
Customer
Insight
the scheduling queue definition
Operation Progress
the state of the running Agenda operations
Progress
the state of the running Agendas
ResourcePool
the processing resources

Service Agenda

Agenda Service
the workflow submission
Progress Service
rolled up agenda progress summary
ResourcePool Service
getting work and updating progress

Timed Processes

AgendaReclaimer
restarting stuck Agendas
AgendaRetry
retrying failed Agendas
DataObjectReaper
reaping expired data objects
PodReaper
reaping stuck Kubernetes pods

Installation

Install

Development

DevKubernetesSetup
RunLocalExecution
- RunWithMiniKube

Demo / Examples

SampleAuthorizer
SampleHandler

Clone this wiki locally