Managing Capabilities
In KubeVela, developers can install more capabilities (i.e. new component types and traits) from any GitHub repo that contains OAM definition files. We call these GitHub repos as Capability Centers.
KubeVela is able to discover OAM definition files in this repo automatically and sync them to your own KubeVela platform.
Add a capability center
Add a registry in KubeVela:
vela registry config my-center https://github.com/kubevela/catalog/tree/master/registry
Successfully configured registry my-center
Now, this registry my-center is ready to use.
List capability centers
You are allowed to add more capability centers and list them.
vela registry ls
NAME            URL                                                    
default         oss://registry.kubevela.net/                            
my-center       https://github.com/kubevela/catalog/tree/master/registry 
[Optional] Remove a capability center
Or, remove one.
vela registry remove my-center
List all available capabilities in capability center
Or, list all available ComponentDefinition/TraitDefinition in certain registry.
vela trait --discover --registry=my-center
vela comp --discover --registry=my-center
## Install a capability from capability center
Now let's try to install the new component named `clonesetservice` from `my-center` to your own KubeVela platform.
You need to install OpenKruise first.
```shell
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
Install clonesetservice component from my-center.
vela comp get clonesetservice --registry=my-center
Use the newly installed capability
Let's check the clonesetservice appears in your platform firstly:
vela components
NAME            NAMESPACE   WORKLOAD                    DESCRIPTION
clonesetservice vela-system clonesets.apps.kruise.io    Describes long-running, scalable, containerized services
                                                        that have a stable network endpoint to receive external
                                                        network traffic from customers. If workload type is skipped
                                                        for any service defined in Appfile, it will be defaulted to
                                                        `webservice` type.
Great! Now let's deploy an app via Appfile.
cat << EOF > vela.yaml
name: testapp
services:
  testsvc:
    type: clonesetservice
    image: crccheck/hello-world
    port: 8000
EOF
vela up
Parsing vela appfile ...
Load Template ...
Rendering configs for service (testsvc)...
Writing deploy config to (.vela/deploy.yaml)
Applying application ...
Checking if app has been deployed...
App has not been deployed, creating a new deployment...
Updating:  core.oam.dev/v1alpha2, Kind=HealthScope in default
✅ App has been deployed 🚀🚀🚀
    Port forward: vela port-forward testapp
             SSH: vela exec testapp
         Logging: vela logs testapp
      App status: vela status testapp
  Service status: vela status testapp --svc testsvc
then you can Get a cloneset in your environment.
kubectl get clonesets.apps.kruise.io
NAME      DESIRED   UPDATED   UPDATED_READY   READY   TOTAL   AGE
testsvc   1         1         1               1       1       46s
Uninstall a capability
NOTE: make sure no apps are using the capability before uninstalling.
kubectl delete componentdefinition -n vela-system clonesetservice