CLI
Users can use RCTL to create custom catalogs and automate the creation of Add-On and Workload from Catalog.
Create Custom Catalog¶
Users can create a custom catalog using a YAML spec that you can store in a Git repository.
The below rctl command is to create a custom catalog
./rctl create catalog -f <filename.yaml>
An illustrative example of the custom catalog YAML file is shown below. Remove the highlighted (yellow) parameters to not share the catalog with other project(s)
apiVersion: apps.k8smgmt.io/v3
kind: Catalog
metadata:
name: demo-catalog
project: defaultproject
spec:
autoSync: true
repository: demorepo
type: HelmRepository
sharing:
enabled: true
projects:
- name: project1
Create Workload Template from Catalog¶
Users can create a workload template from catalog using a YAML spec that you can store in a Git repository.
The below rctl command is to create an Workload Template from Catalog
./rctl create workloadtemplate --v3 -f catalog-workloadtemplate_filename.yaml
An illustrative example of the workload template spec YAML file is shown below
apiVersion: apps.k8smgmt.io/v3
kind: WorkloadTemplate
metadata:
name: wl-temp-cat
project: defaultproject
spec:
artifact:
artifact:
chartName: nginx
chartVersion: 10.2.1
catalog: default-bitnami
valuesPaths:
- name: file://nginx-values.yaml
options:
maxHistory: 10
timeout: 5m0s
type: Helm
Create Add-On from Catalog¶
Users can create an add-on from catalog using a YAML spec that you can store in a Git repository.
The below rctl command is to create an Add-On from Catalog
./rctl create addon version -f catalog-addon_filename.yaml --v3
An illustrative example of the add-on spec YAML file is shown below
apiVersion: infra.k8smgmt.io/v3
kind: Addon
metadata:
name: addon-number5-rctlv3
project: demo-project
spec:
artifact:
artifact:
catalog: default-bitnami
chartName: apache
chartVersion: 9.1.0
valuesPaths:
- name: file://apache-values.yaml
options:
maxHistory: 1
timeout: 1m0s
type: Helm
namespace: fleet-ns1
sharing:
enabled: false
version: v1
Create Workload from Catalog¶
Users can create a workload from catalog using a YAML spec that you can store in a Git repository.
The below rctl command is to create an Workload from Catalog
./rctl create workload --v3 -f catalog-workload_filename.yaml
An illustrative example of the workload spec YAML file is shown below
apiVersion: apps.k8smgmt.io/v3
kind: Workload
metadata:
name: workload-rctlv3-1
project: demo_project
spec:
artifact:
artifact:
catalog: default-bitnami
chartName: nats
chartVersion: 7.1.0
valuesPaths:
- name: file://nats-values.yaml
options:
maxHistory: 2
timeout: 1m0s
type: Helm
drift:
enabled: false
namespace: teststage
placement:
selector: rafay.dev/clusterName=aks-stage114x-1
version: workload-rctlv3-1-v1