Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions deploy/charts/rig-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ config:
webhooksEnabled: true
devModeEnabled: false
leaderElectionEnabled: true
prometheusServiceMonitor:
path: ""
portName: ""
pipeline:
Comment thread
andersjohnsen marked this conversation as resolved.
serviceAccountStep:
plugin: "rigdev.service_account"
deploymentStep:
plugin: "rigdev.deployment"
routesStep:
plugin: "rigdev.ingress_routes"
config: |
clusterIssuer: ""
createCertificateResources: false
ingressClassName: ""
disableTLS: false
cronJobsStep:
plugin: "rigdev.cron_jobs"
# serviceMonitorStep:
# plugin: "rigdev.service_monitor"
# config: |
# portName: "system"
# path: "metrics"
steps:
[]
# - plugins:
Expand Down
64 changes: 21 additions & 43 deletions docs/docs/api/config/v1alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ _Appears in:_
| `enableForPlatform` _boolean_ | If set, will enable the step for the Rig platform which is a Capsule as well |


### CapsuleStep





_Appears in:_
- [Pipeline](#pipeline)

| Field | Description |
| --- | --- |
| `plugin` _string_ | The plugin to use for handling the capsule step. fx. "rigdev.ingress_routes" for routesStep will create an ingress resource per route. fx. "rigdev.deployment" for deploymentStep will use the default deployment plugin. |
| `config` _string_ | Config is a string defining the plugin-specific configuration of the plugin. |


### Client


Expand Down Expand Up @@ -392,8 +407,6 @@ OperatorConfig is the Schema for the operator config API
| `webhooksEnabled` _boolean_ | WebhooksEnabled sets wether or not webhooks should be enabled. When enabled a certificate should be mounted at the webhook server certificate path. Defaults to true if omitted. |
| `devModeEnabled` _boolean_ | DevModeEnabled enables verbose logs and changes the logging format to be more human readable. |
| `leaderElectionEnabled` _boolean_ | LeaderElectionEnabled enables leader election when running multiple instances of the operator. |
| `prometheusServiceMonitor` _[PrometheusServiceMonitor](#prometheusservicemonitor)_ | PrometheusServiceMonitor defines if Rig should spawn a Prometheus ServiceMonitor per capsule for use with a Prometheus Operator stack. |
| `verticalPodAutoscaler` _[VerticalPodAutoscaler](#verticalpodautoscaler)_ | VerticalPodAutoscaler holds the configuration for the VerticalPodAutoscaler resources potentially generated by the operator. |
| `pipeline` _[Pipeline](#pipeline)_ | Pipeline defines the capsule controller pipeline |


Expand Down Expand Up @@ -423,7 +436,12 @@ _Appears in:_

| Field | Description |
| --- | --- |
| `routesStep` _[RoutesStep](#routesstep)_ | How to handle the routes for capsules in the cluster. |
| `serviceAccountStep` _[CapsuleStep](#capsulestep)_ | How to handle the service account step of capsules in the cluster. Defaults to rigdev.service_account. |
| `deploymentStep` _[CapsuleStep](#capsulestep)_ | How to handle the deployment step of capsules in the cluster. Defaults to rigdev.deployment. |
| `routesStep` _[CapsuleStep](#capsulestep)_ | How to handle the routes for capsules in the cluster. If left empty, routes will not be handled. |
| `cronJobsStep` _[CapsuleStep](#capsulestep)_ | How to handle the cronjob step of capsules in the cluster. Defaults to rigdev.cron_jobs |
| `vpaStep` _[CapsuleStep](#capsulestep)_ | How to handle the VPA step of capsules in the cluster. If left empty, no VPAs will be created. |
| `serviceMonitorStep` _[CapsuleStep](#capsulestep)_ | How to handle the service monitor step of capsules in the cluster. If left empty, no service monitors will be created. rigdev.service_monitor plugin spawns a Prometheus ServiceMonitor per capsule for use with a Prometheus Operator stack. |
| `steps` _[Step](#step) array_ | Steps to perform as part of running the operator. |
| `customPlugins` _[CustomPlugin](#customplugin) array_ | CustomPlugins enables custom plugins to be injected into the operator. The plugins injected here can then be referenced in 'steps' |

Expand Down Expand Up @@ -469,19 +487,6 @@ _Appears in:_
| `config` _string_ | Config is a string defining the plugin-specific configuration of the plugin. |


### PrometheusServiceMonitor





_Appears in:_
- [OperatorConfig](#operatorconfig)

| Field | Description |
| --- | --- |
| `path` _string_ | Path is the path which Prometheus should query on ports. Defaults to /metrics if not set. |
| `portName` _string_ | PortName is the name of the port which Prometheus will query metrics on |


### Repository
Expand All @@ -499,21 +504,6 @@ _Appears in:_
| `secret` _string_ | Secret is a secret key used for encrypting sensitive data before saving it in the database. |


### RoutesStep





_Appears in:_
- [Pipeline](#pipeline)

| Field | Description |
| --- | --- |
| `plugin` _string_ | The plugin to use for handling routes in capsule interfaces. If not set, routes will not be handled. fx. "rigdev.ingress_routes" will create an ingress resource per route. |
| `config` _string_ | Config is a string defining the plugin-specific configuration of the plugin. |


### SSHCredential


Expand Down Expand Up @@ -562,18 +552,6 @@ _Appears in:_
| `enableForPlatform` _boolean_ | If set, will enable the step for the Rig platform which is a Capsule as well Deprecated, use Match.EnableForPlatform. |


### VerticalPodAutoscaler





_Appears in:_
- [OperatorConfig](#operatorconfig)

| Field | Description |
| --- | --- |
| `enabled` _boolean_ | Enabled enables the creation of a VerticalPodAutoscaler per capsule |



Expand Down
13 changes: 13 additions & 0 deletions docs/docs/operator-manual/plugins/builtin/cron_jobs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cron Jobs Plugin

The `rigdev.cron_jobs` plugin is the default plugin for handling the jobs specified in the `capsule spec` in the reconcilliation pipeline. For each job specified in the capsule spec, if the job is specified by a command, the plugin will create a cron job based on the container of the capsule deployment. Alternatively, if the job is specified by a URL, the plugin will create a cron job that will curl the URL.

## Config



Configuration for the deployment plugin




17 changes: 17 additions & 0 deletions docs/docs/operator-manual/plugins/builtin/deployment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Deployment Plugin

Default plugin for handling deployments in the reconcilliation pipeline. Another plugin can be specified in the `deploymentStep` in the pipeline in the operator config.
The `rigdev.deployment` plugin will create a deployment for the capsule, and a service if the the capsule has interfaces defined.




## Config



Configuration for the deployment plugin




15 changes: 7 additions & 8 deletions docs/docs/operator-manual/plugins/builtin/ingress_routes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Config (in context of the rig-operator Helm values):
```
config:
pipeline:
steps:
- plugins:
- name: rigdev.ingress_routes
config: |
clusterIssuer: letsencrypt-prod
createCertificateResources: true
ingressClassName: nginx
disableTLS: false
routesStep:
plugin: "rigdev.ingress_routes"
config: |
clusterIssuer: letsencrypt-prod
createCertificateResources: true
ingressClassName: nginx
disableTLS: false
```

## Config
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/operator-manual/plugins/builtin/service_account.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Service Account Plugin
The `rigdev.service_account` plugin provides the default way of handling service accounts in the reconcilliation pipeline. It will create a service account with the name and namespace of the capsule.

## Config



Configuration for the deployment plugin




30 changes: 30 additions & 0 deletions docs/docs/operator-manual/plugins/builtin/service_monitor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Service Monitor Plugin
The `rigdev.service_monitor` plugin spawns a Prometheus ServiceMonitor per capsule
for use with a Prometheus Operator stack. The service monitor will monitor services with the same name as the capsule and will use the endpoint specified by the `path` and `portName` fields in the configuration.

## Example

Config (in the context of the rig-operator Helm values):
```
config:
pipeline:
serviceMonitorStep:
plugin: "rigdev.service_monitor"
config: |
path: metrics
portName: metricsport
```

## Config



Configuration for the deployment plugin

| Field | Description |
| --- | --- |
| `Path` _string_ | |
| `PortName` _string_ | |



12 changes: 12 additions & 0 deletions docs/docs/operator-manual/plugins/builtin/vpa.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Vertical Pod Autoscaler Plugin


## Config



Configuration for the deployment plugin




36 changes: 23 additions & 13 deletions pkg/api/config/v1alpha1/operator_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,31 @@ type OperatorConfig struct {
// instances of the operator.
LeaderElectionEnabled *bool `json:"leaderElectionEnabled,omitempty"`

// PrometheusServiceMonitor defines if Rig should spawn a Prometheus ServiceMonitor per capsule
// for use with a Prometheus Operator stack.
PrometheusServiceMonitor *PrometheusServiceMonitor `json:"prometheusServiceMonitor,omitempty"`

// VerticalPodAutoscaler holds the configuration for the VerticalPodAutoscaler resources
// potentially generated by the operator.
VerticalPodAutoscaler VerticalPodAutoscaler `json:"verticalPodAutoscaler,omitempty"`

// Pipeline defines the capsule controller pipeline
Pipeline Pipeline `json:"pipeline,omitempty"`
}

type Pipeline struct {
// How to handle the service account step of capsules in the cluster.
// Defaults to rigdev.service_account.
ServiceAccountStep CapsuleStep `json:"serviceAccountStep,omitempty"`
// How to handle the deployment step of capsules in the cluster.
// Defaults to rigdev.deployment.
DeploymentStep CapsuleStep `json:"deploymentStep,omitempty"`
// How to handle the routes for capsules in the cluster.
RoutesStep RoutesStep `json:"routesStep,omitempty"`
// If left empty, routes will not be handled.
RoutesStep CapsuleStep `json:"routesStep,omitempty"`
// How to handle the cronjob step of capsules in the cluster.
// Defaults to rigdev.cron_jobs
CronJobsStep CapsuleStep `json:"cronJobsStep,omitempty"`
// How to handle the VPA step of capsules in the cluster.
// If left empty, no VPAs will be created.
VPAStep CapsuleStep `json:"vpaStep,omitempty"`
// How to handle the service monitor step of capsules in the cluster.
// If left empty, no service monitors will be created.
// rigdev.service_monitor plugin spawns a Prometheus ServiceMonitor per capsule
// for use with a Prometheus Operator stack.
ServiceMonitorStep CapsuleStep `json:"serviceMonitorStep,omitempty"`
// Steps to perform as part of running the operator.
// +patchStrategy=merge
Steps []Step `json:"steps,omitempty"`
Expand All @@ -51,10 +61,10 @@ type Pipeline struct {
CustomPlugins []CustomPlugin `json:"customPlugins,omitempty"`
}

type RoutesStep struct {
// The plugin to use for handling routes in capsule interfaces. If not set,
// routes will not be handled.
// fx. "rigdev.ingress_routes" will create an ingress resource per route.
type CapsuleStep struct {
// The plugin to use for handling the capsule step.
// fx. "rigdev.ingress_routes" for routesStep will create an ingress resource per route.
// fx. "rigdev.deployment" for deploymentStep will use the default deployment plugin.
Plugin string `json:"plugin,omitempty"`

// Config is a string defining the plugin-specific configuration of the plugin.
Expand Down
41 changes: 20 additions & 21 deletions pkg/api/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading