Overrides
The table below describes the list of actions that can be performed on "Cluster Overrides" using the RCTL CLI Utility.
Resource | Create | Get | Update | Delete |
---|---|---|---|---|
Cluster Overrides | YES | YES | YES | YES |
Create Cluster Override for Add-ons/Workloads¶
Use the following command to create/update a cluster override.
./rctl apply -f <overridefile_name.yaml>
Helm & Local File type¶
An example of a helm type workload cluster override spec is shown below that uses AddonOverride, Helm type, and local file artifact type.
apiVersion: infra.k8smgmt.io/v3
kind: AddonOverride
metadata:
labels:
rafay.dev/overrideScope: clusterLabels
rafay.dev/overrideType: valuesFile
name: addon-helm
project: defaultproject
spec:
placement:
labels:
- key: rafay.dev/clusterName
value: minikube
resource:
selector:
name: helm-addon
type: Addon
sharing:
enabled: true
projects:
- name: demo-project1
type: Helm
valuesPath:
name: file://artifact/helm.yaml
Helm & Pull from Git type¶
An example of a helm type workload cluster override spec is shown below that uses Override (WorkloadOverride), Helm type, and pull from git artifact type.
apiVersion: apps.k8smgmt.io/v3
kind: Override
metadata:
name: workload-helm-repo
project: defaultproject
spec:
placement:
labels:
- key: rafay.dev/clusterName
value: minikube
repo:
path:
name: /test/test.yaml
repository: pvt-sync
revision: main
resource:
selector:
name: helm-workload
type: Workload
sharing:
enabled: true
projects:
- name: demo-project1
type: Helm
Yaml & Pull from Git type¶
An example of a helm type workload cluster override spec is shown below that uses AddOnOverride, Yaml type, and pull from git artifact type.
apiVersion: infra.k8smgmt.io/v3
kind: AddonOverride
metadata:
name: addon-yaml-repo
project: defaultproject
spec:
placement:
labels:
- key: rafay.dev/clusterName
value: minikube
repo:
path:
name: /test/test-w.yaml
repository: pvt-sync
revision: main
resource:
selector:
name: yaml-addon
type: Addon
sharing:
enabled: true
projects:
- name: demo-project1
type: Yaml
Yaml & Local File type¶
An example of a helm type workload cluster override spec is shown below that uses Override (WorkloadOverride), Yaml type, and local file artifact type.
apiVersion: apps.k8smgmt.io/v3
kind: Override
metadata:
labels:
rafay.dev/overrideScope: clusterLabels
rafay.dev/overrideType: valuesFile
name: workload-yaml
project: defaultproject
spec:
placement:
labels:
- key: rafay.dev/clusterName
value: minikube
resource:
selector:
name: yaml-workload
type: Workload
sharing:
enabled: true
projects:
- name: demo-project1
type: Yaml
valuesPath:
name: file://artifact/yaml.yaml
List Cluster overrides¶
Use this command to retrieve the list of cluster overrides in the configured Project. The name of the override, override and artifact type, and value file are returned.
./rctl get cluster-override --v3
Example
./rctl get cluster-override --v3
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
| CLUSTEROVERRIDE NAME | OVERRIDE TYPE | ARTIFACT TYPE | VALUE FILE | REPOSITORY |
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
| busyboxov1 | Workload | Yaml | file://busyboxov1/busyboxov1.yaml | |
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
| demo-override | Workload | Helm | | |
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
| demo-override-a | Workload | Helm | file://demo-override-a/demo-override-a.yaml | |
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
| demohelmoverride | Workload | Helm | file://demohelmoverride/demohelmoverride.yaml | |
+-----------------------------------+---------------+---------------+---------------------------------------------------------------------------------+------------+
Type Add-On
To get a list of cluster overrides of type Add-On, use the below command in the configured Project.
./rctl get co --type ClusterOverrideTypeAddon
Example
./rctl get co --type ClusterOverrideTypeAddon
+-----------------------------------+--------------------------------+----------------------------------------------------------------------------------+--------------------------+---------------+-----------------+-----------+
| OVERRIDE NAME | CLUSTER SELECTOR | RESOURCE SELECTOR | TYPE | ARTIFACT TYPE | OVERRIDE VALUES | OWNERSHIP |
+-----------------------------------+--------------------------------+----------------------------------------------------------------------------------+--------------------------+---------------+-----------------+-----------+
| connector-override-temp | venus=flytrap | rafay.dev/system=true,rafay.dev/component=v2-infra | ClusterOverrideTypeAddon | Helm | | self |
+-----------------------------------+--------------------------------+----------------------------------------------------------------------------------+--------------------------+---------------+-----------------+-----------+
| prometheus-helm-exporter-override | rafay.dev/clusterName in | rafay.dev/system=true,rafay.dev/component=rafay-prometheus | ClusterOverrideTypeAddon | Helm | | self |
| | (nikhildemonewv3c1) | | | | | |
+-----------------------------------+--------------------------------+----------------------------------------------------------------------------------+--------------------------+---------------+-----------------+-----------+
Type Workload
To get a list of cluster overrides of type Workload, use the below command in the configured Project.
./rctl get co --type ClusterOverrideTypeWorkload
Example
./rctl get co --type ClusterOverrideTypeWorkload
+-------------------------+--------------------------------+-----------------------------+-----------------------------+---------------+-----------------+-----------+
| OVERRIDE NAME | CLUSTER SELECTOR | RESOURCE SELECTOR | TYPE | ARTIFACT TYPE | OVERRIDE VALUES | OWNERSHIP |
+-------------------------+--------------------------------+-----------------------------+-----------------------------+---------------+-----------------+-----------+
| demohelmoverride | a=apple | | ClusterOverrideTypeWorkload | Helm | | self |
+-------------------------+--------------------------------+-----------------------------+-----------------------------+---------------+-----------------+-----------+
| demoyamloverride | | | ClusterOverrideTypeWorkload | Yaml | | self |
+-------------------------+--------------------------------+-----------------------------+-----------------------------+---------------+-----------------+-----------+
| demo-override | | | ClusterOverrideTypeWorkload | Helm | | self |
+-------------------------+--------------------------------+-----------------------------+-----------------------------+---------------+-----------------+-----------+
Delete Cluster Override¶
Delete a cluster override in the configured project using the below command.
./rctl delete cluster-override --v3 -f <overridefilename.yaml>