crossplane / addon-oam-kubernetes-local

Run OAM workloads on a Kubernetes cluster.
Apache License 2.0
21 stars 15 forks source link

OAM Controllers

👷 WARNNING: This repo is designed to be used by OAM workloads/traits/scopes developers.

What's inside?

This repo contains Kubernetes controllers for core OAM workloads/traits/scopes.

Workloads

Traits

Prerequisites

(Optional) In case you don't know how to install Crossplane

Here's an easy three steps version:

kubectl create namespace crossplane-system
helm repo add crossplane-alpha https://charts.crossplane.io/alpha
helm install crossplane --namespace crossplane-system crossplane-alpha/crossplane

Please feel free to ignore this warning which is caused by helm v2 compatibility issue:

manifest_sorter.go:192: info: skipping unknown hook: "crd-install"

Install OAM controllers

Clone this repo

git clone git@github.com:crossplane/addon-oam-kubernetes-local.git
cd ./addon-oam-kubernetes-local

(Optional) Enable webhook and install cert manager

The OAM ManualScalerTrait controller includes a sample webhook to validate the manual scalar trait. This webhook is disabled by default in its helm chart.

You need to install a cert-manager to provide self-signed certifications if you want to play with the webhooks.

kubectl create namespace cert-manager
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v0.14.0/cert-manager.yaml

For more detailed instructions of cert manager please check Cert-manager docs.

Install controllers

kubectl create namespace oam-system
helm install controller -n oam-system ./charts/oam-core-resources/ 

Verify

kubectl apply -f examples/containerized-workload/

You should also see a deployment looking like below
```console
kubectl get deployments
NAME                                    READY   UP-TO-DATE   AVAILABLE   AGE
example-appconfig-workload-deployment   3/3   3           3              28s

And a service looking like below

kubectl get services
AME                                             TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
example-appconfig-workload-deployment-service   NodePort   10.96.78.215   <none>        8080/TCP   28s