👷 WARNNING: This repo is designed to be used by OAM workloads/traits/scopes developers.
This repo contains Kubernetes controllers for core OAM workloads/traits/scopes.
Workloads
Traits
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"
git clone git@github.com:crossplane/addon-oam-kubernetes-local.git
cd ./addon-oam-kubernetes-local
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.
kubectl create namespace oam-system
helm install controller -n oam-system ./charts/oam-core-resources/
kubectl apply -f examples/containerized-workload/
kubectl describe applicationconfigurations.core.oam.dev example-appconfig
Status:
Conditions:
Last Transition Time: 2020-06-12T21:18:40Z
Reason: Successfully reconciled resource
Status: True
Type: Synced
Workloads:
Component Name: example-component
Traits:
Trait Ref:
API Version: core.oam.dev/v1alpha2
Kind: ManualScalerTrait
Name: example-appconfig-trait
Workload Ref:
API Version: core.oam.dev/v1alpha2
Kind: ContainerizedWorkload
Name: example-appconfig-workload
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal RenderedComponents 6s (x2 over 7s) oam/applicationconfiguration.core.oam.dev Successfully rendered components
Normal AppliedComponents 6s (x2 over 6s) oam/applicationconfiguration.core.oam.dev Successfully applied components
Normal Deployment created 6s (x3 over 6s) ContainerizedWorkload Workload `example-appconfig-workload` successfully server side patched a deployment `example-appconfig-workload`
Normal Service created 6s (x3 over 6s) ContainerizedWorkload Workload `example-appconfig-workload` successfully server side patched a service `example-appconfig-workload`
Normal Manual scalar applied 6s (x2 over 6s) ManualScalarTrait Trait `example-appconfig-trait` successfully scaled a resouce to 3 instances
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