From 3de6d58278e088010e7cde7fb5fd818f4f4e5e1e Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Tue, 17 Jan 2023 17:56:27 +1100 Subject: [PATCH 01/36] Start stubbing out methods for agent config. --- apis/telemetry/v1alpha1/telemetry_types.go | 18 +++++++++++++++--- .../cassandra_telemetry_reconciler.go | 9 ++++++--- pkg/telemetry/cassandra_agent_config.go | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 pkg/telemetry/cassandra_agent_config.go diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index 37f32062e..7202ab8b1 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -3,14 +3,16 @@ package v1alpha1 import ( + promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type TelemetrySpec struct { - Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` - Mcac *McacTelemetrySpec `json:"mcac,omitempty"` - Vector *VectorSpec `json:"vector,omitempty"` + Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` + Mcac *McacTelemetrySpec `json:"mcac,omitempty"` + Vector *VectorSpec `json:"vector,omitempty"` + Cassandra *CassandraTelemetryAgentSpec `json:"cassandra,omitempty"` } type PrometheusTelemetrySpec struct { @@ -126,3 +128,13 @@ type McacTelemetrySpec struct { // This is considered true by default. Enabled *bool `json:"enabled,omitempty"` } + +type CassandraTelemetryAgentSpec struct { + Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` + Filters promapi.RelabelConfig `json:"filters,omitempty"` +} + +type TelemetryAgentEndpoint struct { + Address string `json:"address,omitempty"` + Port string `json:"port,omitempty"` +} diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler.go b/controllers/k8ssandra/cassandra_telemetry_reconciler.go index aef72ad09..ab90ee8af 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler.go @@ -8,7 +8,6 @@ import ( "github.com/go-logr/logr" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" - api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/result" "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" @@ -17,8 +16,8 @@ import ( func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( ctx context.Context, - kc *api.K8ssandraCluster, - dcTemplate api.CassandraDatacenterTemplate, + kc *k8ssandraapi.K8ssandraCluster, + dcTemplate k8ssandraapi.CassandraDatacenterTemplate, actualDc *cassdcapi.CassandraDatacenter, logger logr.Logger, remoteClient client.Client, @@ -72,6 +71,10 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( return result.Error(err) } } + if err = telemetry.ReconcileTelemetryAgentConfigMap(ctx, remoteClient, *mergedSpec); err != nil { + + } + return result.Continue() } diff --git a/pkg/telemetry/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent_config.go new file mode 100644 index 000000000..6175763d4 --- /dev/null +++ b/pkg/telemetry/cassandra_agent_config.go @@ -0,0 +1,19 @@ +package telemetry + +import ( + "context" + + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" + "gopkg.in/yaml.v2" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func ReconcileTelemetryAgentConfigMap(ctx context.Context, remoteClient client.Client, telemetrySpec telemetryapi.TelemetrySpec) error { + yamlData, err := yaml.Marshal(&telemetrySpec.Cassandra) + if err != nil { + return err + } + cm := corev1.ConfigMap{} + +} From fd9c12c94e765ef54c0e2c6f5d1f464fa4ce97a3 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 20 Jan 2023 16:08:10 +1100 Subject: [PATCH 02/36] Add reconciliation logic, tests. --- apis/telemetry/v1alpha1/telemetry_types.go | 4 +- .../cassandra_telemetry_reconciler.go | 11 +- .../cassandra_agent/cassandra_agent_config.go | 122 ++++++++++++++++++ .../cassandra_agent_config_test.go | 100 ++++++++++++++ pkg/telemetry/cassandra_agent_config.go | 19 --- pkg/telemetry/test_objects.go | 12 ++ 6 files changed, 245 insertions(+), 23 deletions(-) create mode 100644 pkg/telemetry/cassandra_agent/cassandra_agent_config.go create mode 100644 pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go delete mode 100644 pkg/telemetry/cassandra_agent_config.go create mode 100644 pkg/telemetry/test_objects.go diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index 7202ab8b1..1afc7fa9f 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -130,8 +130,8 @@ type McacTelemetrySpec struct { } type CassandraTelemetryAgentSpec struct { - Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` - Filters promapi.RelabelConfig `json:"filters,omitempty"` + Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` + Filters []promapi.RelabelConfig `json:"filters,omitempty"` } type TelemetryAgentEndpoint struct { diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler.go b/controllers/k8ssandra/cassandra_telemetry_reconciler.go index ab90ee8af..47615cd22 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler.go @@ -11,6 +11,7 @@ import ( k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/result" "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" + agent "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry/cassandra_agent" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -71,8 +72,14 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( return result.Error(err) } } - if err = telemetry.ReconcileTelemetryAgentConfigMap(ctx, remoteClient, *mergedSpec); err != nil { - + agentCfg := agent.Configurator{ + TelemetrySpec: *mergedSpec, + RemoteClient: remoteClient, + Ctx: ctx, + Kluster: kc, + } + if err = agentCfg.ReconcileTelemetryAgentConfig(actualDc); err != nil { + return result.Error(err) } return result.Continue() diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go new file mode 100644 index 000000000..81739f706 --- /dev/null +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -0,0 +1,122 @@ +package cassandra_agent + +import ( + "context" + "path/filepath" + + cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" + k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" + "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + "gopkg.in/yaml.v2" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +var ( + agentConfigLocation = "/config/metric-collector.yaml" +) + +type Configurator struct { + TelemetrySpec telemetryapi.TelemetrySpec + Kluster *k8ssandraapi.K8ssandraCluster + Ctx context.Context + RemoteClient client.Client +} + +func (c Configurator) GetTelemetryAgentConfigMap() (corev1.ConfigMap, error) { + yamlData, err := yaml.Marshal(&c.TelemetrySpec.Cassandra) + if err != nil { + return corev1.ConfigMap{}, err + } + cm := corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: c.Kluster.Namespace, + Name: c.Kluster.Name + "metrics-agent-config", + }, + Data: map[string]string{filepath.Base(agentConfigLocation): string(yamlData)}, + } + return cm, nil +} + +func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatacenter) error { + cm, err := c.GetTelemetryAgentConfigMap() + if err != nil { + return err + } + if err := c.RemoteClient.Create(c.Ctx, &cm); err != nil { + return err + } + c.AddStsVolumes(dc) + + return nil +} + +func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { + if dc.Spec.PodTemplateSpec == nil { + dc.Spec.PodTemplateSpec = &corev1.PodTemplateSpec{} + } + _, found := cassandra.FindVolume(dc.Spec.PodTemplateSpec, "metrics-agent-config") + if !found { + v := corev1.Volume{ + Name: "metrics-agent-config", + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ + Items: []corev1.KeyToPath{ + { + Key: filepath.Base(agentConfigLocation), + Path: filepath.Base(agentConfigLocation), + }, + }, + LocalObjectReference: corev1.LocalObjectReference{ + Name: c.Kluster.Name + "metrics-agent-config", + }, + }, + }, + } + // We don't check that the volume mount exists before appending because we assume that the existence of the volume + // is a sufficient signal that reconciliation has run. + dc.Spec.PodTemplateSpec.Spec.Volumes = append(dc.Spec.PodTemplateSpec.Spec.Volumes, v) + cassandra.UpdateCassandraContainer( + dc.Spec.PodTemplateSpec, + func(c *corev1.Container) { + vm := corev1.VolumeMount{ + Name: "metrics-agent-config", + MountPath: filepath.Base(filepath.Dir(agentConfigLocation)), + } + c.VolumeMounts = append(c.VolumeMounts, vm) + }) + + } + return nil +} + +// Do we need this? If the agent is always enabled I guess we must always want to create the ConfigMap? +func (c Configurator) RemoveStsVolumes(dc *cassdcapi.CassandraDatacenter) error { + volumeIdx, found := cassandra.FindVolume(dc.Spec.PodTemplateSpec, "metrics-agent-config") + if found { + dc.Spec.PodTemplateSpec.Spec.Volumes = append( + dc.Spec.PodTemplateSpec.Spec.Volumes[:volumeIdx], + dc.Spec.PodTemplateSpec.Spec.Volumes[(volumeIdx+1):]..., + ) + } + cassandraContainerIdx, found := cassandra.FindContainer(dc.Spec.PodTemplateSpec, "cassandra") + if found { + mountIdx := -1 + found := false + for i, mount := range dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts { + if mount.Name == "metrics-agent-config" { + mountIdx = i + found = true + } + if found { + dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts = append( + dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts[:mountIdx], + dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts[(mountIdx+1):]...) + } + } + } + return nil + +} diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go new file mode 100644 index 000000000..8da05b096 --- /dev/null +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -0,0 +1,100 @@ +package cassandra_agent + +import ( + "context" + "path/filepath" + "testing" + + k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + telemetry "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" + testutils "github.com/k8ssandra/k8ssandra-operator/pkg/test" + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" +) + +var ( + testCluster k8ssandraapi.K8ssandraCluster = testutils.NewK8ssandraCluster("test-cluster", "test-namespace") + Cfg Configurator = Configurator{ + TelemetrySpec: telemetry.NewTelemetrySpec(), + Kluster: &testCluster, + Ctx: context.Background(), + RemoteClient: testutils.NewFakeClientWRestMapper(), + } + expectedYaml string = `endpoint: + address: 127.0.0.1 + port: "10000" +filters: +- source_labels: + - tag1 + - tag2 + separator: ; + targetlabel: "" + regex: (.*);(b.*) + modulus: 0 + replacement: "" + action: drop` +) + +// func Test_GetTelemetryAgentConfigMap(t *testing.T) { +// tspec := &Cfg.TelemetrySpec +// tspec.Cassandra.Filters = []promapi.RelabelConfig{ +// { +// SourceLabels: []string{"tag1", "tag2"}, +// Separator: ";", +// Regex: "(.*);(b.*)", +// Action: "drop", +// }, +// } + +// tspec.Cassandra.Endpoint.Address = "127.0.0.1" +// tspec.Cassandra.Endpoint.Port = "10000" +// expectedCm := corev1.ConfigMap{ +// ObjectMeta: metav1.ObjectMeta{ +// Namespace: Cfg.Kluster.Namespace, +// Name: Cfg.Kluster.Name + "metrics-agent-config", +// }, +// Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, +// } +// cm, err := Cfg.GetTelemetryAgentConfigMap() +// assert.NoError(t, err) +// assert.Equal(t, expectedCm.Data, cm.Data) +// assert.Equal(t, expectedCm.Name, cm.Name) +// assert.Equal(t, expectedCm.Namespace, cm.Namespace) +// } + +func Test_AddStsVolumes(t *testing.T) { + dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.AddStsVolumes(&dc) + expectedVol := corev1.Volume{ + Name: "metrics-agent-config", + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ + Items: []corev1.KeyToPath{ + { + Key: filepath.Base(agentConfigLocation), + Path: filepath.Base(agentConfigLocation), + }, + }, + LocalObjectReference: corev1.LocalObjectReference{ + Name: Cfg.Kluster.Name + "metrics-agent-config", + }, + }, + }, + } + assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Volumes, expectedVol) + cassContainer, found := cassandra.FindContainer(dc.Spec.PodTemplateSpec, "cassandra") + if !found { + assert.Fail(t, "no cassandra container found") + } + expectedVm := corev1.VolumeMount{ + Name: "metrics-agent-config", + MountPath: filepath.Base(filepath.Dir(agentConfigLocation)), + } + assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Containers[cassContainer].VolumeMounts, expectedVm) +} + +// Not sure if required +// func Test_RemoveStsVolumes(t *testing.T) { + +// } diff --git a/pkg/telemetry/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent_config.go deleted file mode 100644 index 6175763d4..000000000 --- a/pkg/telemetry/cassandra_agent_config.go +++ /dev/null @@ -1,19 +0,0 @@ -package telemetry - -import ( - "context" - - telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" - "gopkg.in/yaml.v2" - corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func ReconcileTelemetryAgentConfigMap(ctx context.Context, remoteClient client.Client, telemetrySpec telemetryapi.TelemetrySpec) error { - yamlData, err := yaml.Marshal(&telemetrySpec.Cassandra) - if err != nil { - return err - } - cm := corev1.ConfigMap{} - -} diff --git a/pkg/telemetry/test_objects.go b/pkg/telemetry/test_objects.go new file mode 100644 index 000000000..012f7ddcb --- /dev/null +++ b/pkg/telemetry/test_objects.go @@ -0,0 +1,12 @@ +package telemetry + +import ( + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" +) + +func NewTelemetrySpec() telemetryapi.TelemetrySpec { + return telemetryapi.TelemetrySpec{ + Cassandra: &telemetryapi.CassandraTelemetryAgentSpec{}, + } + +} From def67721fbcd1f7c5ed8c66ef4dec1b51d9dc861 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 20 Jan 2023 16:19:42 +1100 Subject: [PATCH 03/36] CRD upgrades, codegen upgrades. --- .../v1alpha1/zz_generated.deepcopy.go | 44 +++ .../bases/k8ssandra.io_k8ssandraclusters.yaml | 357 ++++++++++++++++++ .../bases/reaper.k8ssandra.io_reapers.yaml | 54 +++ .../stargate.k8ssandra.io_stargates.yaml | 111 ++++++ 4 files changed, 566 insertions(+) diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index f7379e686..40cf7cc80 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -22,10 +22,34 @@ limitations under the License. package v1alpha1 import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgentSpec) { + *out = *in + out.Endpoint = in.Endpoint + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make([]monitoringv1.RelabelConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CassandraTelemetryAgentSpec. +func (in *CassandraTelemetryAgentSpec) DeepCopy() *CassandraTelemetryAgentSpec { + if in == nil { + return nil + } + out := new(CassandraTelemetryAgentSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *McacTelemetrySpec) DeepCopyInto(out *McacTelemetrySpec) { *out = *in @@ -82,6 +106,21 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryAgentEndpoint) DeepCopyInto(out *TelemetryAgentEndpoint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryAgentEndpoint. +func (in *TelemetryAgentEndpoint) DeepCopy() *TelemetryAgentEndpoint { + if in == nil { + return nil + } + out := new(TelemetryAgentEndpoint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = *in @@ -100,6 +139,11 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = new(VectorSpec) (*in).DeepCopyInto(*out) } + if in.Cassandra != nil { + in, out := &in.Cassandra, &out.Cassandra + *out = new(CassandraTelemetryAgentSpec) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetrySpec. diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index 194ba82d8..d0845b2ee 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -10801,6 +10801,72 @@ spec: pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic + rewriting of the label set, being + applied to samples before ingestion. + It defines ``-section + of Prometheus configuration. More + info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based + on regex matching. Default is + 'replace' + type: string + modulus: + description: Modulus to take of + the hash of the source label values. + format: int64 + type: integer + regex: + description: Regular expression + against which the extracted value + is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against + which a regex replace is performed + if the regular expression matches. + Regex capture groups are available. + Default is '$1' + type: string + separator: + description: Separator placed between + concatenated source label values. + default is ';'. + type: string + sourceLabels: + description: The source labels select + values from existing labels. Their + content is concatenated using + the configured separator and matched + against the configured regular + expression for the replace, keep, + and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the + resulting value is written in + a replace action. It is mandatory + for replace actions. Regex capture + groups are available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -11254,6 +11320,68 @@ spec: for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic + rewriting of the label set, being applied + to samples before ingestion. It defines + ``-section of Prometheus + configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on + regex matching. Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash + of the source label values. + format: int64 + type: integer + regex: + description: Regular expression against + which the extracted value is matched. + Default is '(.*)' + type: string + replacement: + description: Replacement value against + which a regex replace is performed if + the regular expression matches. Regex + capture groups are available. Default + is '$1' + type: string + separator: + description: Separator placed between + concatenated source label values. default + is ';'. + type: string + sourceLabels: + description: The source labels select + values from existing labels. Their content + is concatenated using the configured + separator and matched against the configured + regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting + value is written in a replace action. + It is mandatory for replace actions. + Regex capture groups are available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -11908,6 +12036,64 @@ spec: with a user-provided monitoring solution (at present, only support for Prometheus is available). properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex + matching. Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of + the source label values. + format: int64 + type: integer + regex: + description: Regular expression against which + the extracted value is matched. Default + is '(.*)' + type: string + replacement: + description: Replacement value against which + a regex replace is performed if the regular + expression matches. Regex capture groups + are available. Default is '$1' + type: string + separator: + description: Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values + from existing labels. Their content is concatenated + using the configured separator and matched + against the configured regular expression + for the replace, keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting + value is written in a replace action. It + is mandatory for replace actions. Regex + capture groups are available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -16167,6 +16353,63 @@ spec: a user-provided monitoring solution (at present, only support for Prometheus is available). properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the + source label values. + format: int64 + type: integer + regex: + description: Regular expression against which the + extracted value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a regex + replace is performed if the regular expression + matches. Regex capture groups are available. Default + is '$1' + type: string + separator: + description: Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from + existing labels. Their content is concatenated + using the configured separator and matched against + the configured regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value + is written in a replace action. It is mandatory + for replace actions. Regex capture groups are + available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -18787,6 +19030,63 @@ spec: to deploy targeting the Reaper pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the + source label values. + format: int64 + type: integer + regex: + description: Regular expression against which the + extracted value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a regex + replace is performed if the regular expression + matches. Regex capture groups are available. Default + is '$1' + type: string + separator: + description: Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from + existing labels. Their content is concatenated + using the configured separator and matched against + the configured regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value + is written in a replace action. It is mandatory + for replace actions. Regex capture groups are + available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -20399,6 +20699,63 @@ spec: to deploy targeting the Stargate pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the + source label values. + format: int64 + type: integer + regex: + description: Regular expression against which the + extracted value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a regex + replace is performed if the regular expression + matches. Regex capture groups are available. Default + is '$1' + type: string + separator: + description: Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from + existing labels. Their content is concatenated + using the configured separator and matched against + the configured regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value + is written in a replace action. It is mandatory + for replace actions. Regex capture groups are + available. + type: string + type: object + type: array + type: object mcac: properties: enabled: diff --git a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml index 1fec57ce4..ffb8c9e5b 100644 --- a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml +++ b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml @@ -2078,6 +2078,60 @@ spec: to deploy targeting the Reaper pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting of + the label set, being applied to samples before ingestion. + It defines ``-section of Prometheus + configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the source + label values. + format: int64 + type: integer + regex: + description: Regular expression against which the extracted + value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a regex + replace is performed if the regular expression matches. + Regex capture groups are available. Default is '$1' + type: string + separator: + description: Separator placed between concatenated source + label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from existing + labels. Their content is concatenated using the configured + separator and matched against the configured regular + expression for the replace, keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value is written + in a replace action. It is mandatory for replace actions. + Regex capture groups are available. + type: string + type: object + type: array + type: object mcac: properties: enabled: diff --git a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml index eeb8b4530..e630a422e 100644 --- a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml +++ b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml @@ -2766,6 +2766,63 @@ spec: to deploy targeting the Stargate pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex + matching. Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the + source label values. + format: int64 + type: integer + regex: + description: Regular expression against which + the extracted value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a + regex replace is performed if the regular expression + matches. Regex capture groups are available. + Default is '$1' + type: string + separator: + description: Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from + existing labels. Their content is concatenated + using the configured separator and matched against + the configured regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value + is written in a replace action. It is mandatory + for replace actions. Regex capture groups are + available. + type: string + type: object + type: array + type: object mcac: properties: enabled: @@ -3176,6 +3233,60 @@ spec: to deploy targeting the Stargate pods for all DCs in this cluster (unless overriden by DC specific settings) properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: 'RelabelConfig allows dynamic rewriting of + the label set, being applied to samples before ingestion. + It defines ``-section of Prometheus + configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + properties: + action: + description: Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: Modulus to take of the hash of the source + label values. + format: int64 + type: integer + regex: + description: Regular expression against which the extracted + value is matched. Default is '(.*)' + type: string + replacement: + description: Replacement value against which a regex + replace is performed if the regular expression matches. + Regex capture groups are available. Default is '$1' + type: string + separator: + description: Separator placed between concatenated source + label values. default is ';'. + type: string + sourceLabels: + description: The source labels select values from existing + labels. Their content is concatenated using the configured + separator and matched against the configured regular + expression for the replace, keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: Label to which the resulting value is written + in a replace action. It is mandatory for replace actions. + Regex capture groups are available. + type: string + type: object + type: array + type: object mcac: properties: enabled: From bc8917f09818a5dedbba16b51ced1a38e24fb528 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 23 Jan 2023 12:48:36 +1100 Subject: [PATCH 04/36] Remove RemoveSts functions, reinstate tests. --- .../cassandra_agent/cassandra_agent_config.go | 29 --------- .../cassandra_agent_config_test.go | 59 +++++++++---------- 2 files changed, 28 insertions(+), 60 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 81739f706..173a69683 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -91,32 +91,3 @@ func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { } return nil } - -// Do we need this? If the agent is always enabled I guess we must always want to create the ConfigMap? -func (c Configurator) RemoveStsVolumes(dc *cassdcapi.CassandraDatacenter) error { - volumeIdx, found := cassandra.FindVolume(dc.Spec.PodTemplateSpec, "metrics-agent-config") - if found { - dc.Spec.PodTemplateSpec.Spec.Volumes = append( - dc.Spec.PodTemplateSpec.Spec.Volumes[:volumeIdx], - dc.Spec.PodTemplateSpec.Spec.Volumes[(volumeIdx+1):]..., - ) - } - cassandraContainerIdx, found := cassandra.FindContainer(dc.Spec.PodTemplateSpec, "cassandra") - if found { - mountIdx := -1 - found := false - for i, mount := range dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts { - if mount.Name == "metrics-agent-config" { - mountIdx = i - found = true - } - if found { - dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts = append( - dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts[:mountIdx], - dc.Spec.PodTemplateSpec.Spec.Containers[cassandraContainerIdx].VolumeMounts[(mountIdx+1):]...) - } - } - } - return nil - -} diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 8da05b096..e8a56f338 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -9,8 +9,10 @@ import ( "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" telemetry "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" testutils "github.com/k8ssandra/k8ssandra-operator/pkg/test" + promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var ( @@ -25,7 +27,7 @@ var ( address: 127.0.0.1 port: "10000" filters: -- source_labels: +- sourceLabels: - tag1 - tag2 separator: ; @@ -36,32 +38,32 @@ filters: action: drop` ) -// func Test_GetTelemetryAgentConfigMap(t *testing.T) { -// tspec := &Cfg.TelemetrySpec -// tspec.Cassandra.Filters = []promapi.RelabelConfig{ -// { -// SourceLabels: []string{"tag1", "tag2"}, -// Separator: ";", -// Regex: "(.*);(b.*)", -// Action: "drop", -// }, -// } +func Test_GetTelemetryAgentConfigMap(t *testing.T) { + tspec := &Cfg.TelemetrySpec + tspec.Cassandra.Filters = []promapi.RelabelConfig{ + { + SourceLabels: []string{"tag1", "tag2"}, + Separator: ";", + Regex: "(.*);(b.*)", + Action: "drop", + }, + } -// tspec.Cassandra.Endpoint.Address = "127.0.0.1" -// tspec.Cassandra.Endpoint.Port = "10000" -// expectedCm := corev1.ConfigMap{ -// ObjectMeta: metav1.ObjectMeta{ -// Namespace: Cfg.Kluster.Namespace, -// Name: Cfg.Kluster.Name + "metrics-agent-config", -// }, -// Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, -// } -// cm, err := Cfg.GetTelemetryAgentConfigMap() -// assert.NoError(t, err) -// assert.Equal(t, expectedCm.Data, cm.Data) -// assert.Equal(t, expectedCm.Name, cm.Name) -// assert.Equal(t, expectedCm.Namespace, cm.Namespace) -// } + tspec.Cassandra.Endpoint.Address = "127.0.0.1" + tspec.Cassandra.Endpoint.Port = "10000" + expectedCm := corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: Cfg.Kluster.Namespace, + Name: Cfg.Kluster.Name + "metrics-agent-config", + }, + Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, + } + cm, err := Cfg.GetTelemetryAgentConfigMap() + assert.NoError(t, err) + assert.Equal(t, expectedCm.Data, cm.Data) + assert.Equal(t, expectedCm.Name, cm.Name) + assert.Equal(t, expectedCm.Namespace, cm.Namespace) +} func Test_AddStsVolumes(t *testing.T) { dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") @@ -93,8 +95,3 @@ func Test_AddStsVolumes(t *testing.T) { } assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Containers[cassContainer].VolumeMounts, expectedVm) } - -// Not sure if required -// func Test_RemoveStsVolumes(t *testing.T) { - -// } From dc0e0a8a997a60e80f4acd6a1f872098f534c393 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 23 Jan 2023 13:54:52 +1100 Subject: [PATCH 05/36] Make type names more concise. --- apis/telemetry/v1alpha1/telemetry_types.go | 14 +++++++------- .../v1alpha1/zz_generated.deepcopy.go | 18 +++++++++--------- .../cassandra_agent_config_test.go | 7 ++++--- pkg/telemetry/test_objects.go | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index 1afc7fa9f..a935ec012 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -9,10 +9,10 @@ import ( ) type TelemetrySpec struct { - Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` - Mcac *McacTelemetrySpec `json:"mcac,omitempty"` - Vector *VectorSpec `json:"vector,omitempty"` - Cassandra *CassandraTelemetryAgentSpec `json:"cassandra,omitempty"` + Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` + Mcac *McacTelemetrySpec `json:"mcac,omitempty"` + Vector *VectorSpec `json:"vector,omitempty"` + Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` } type PrometheusTelemetrySpec struct { @@ -129,12 +129,12 @@ type McacTelemetrySpec struct { Enabled *bool `json:"enabled,omitempty"` } -type CassandraTelemetryAgentSpec struct { - Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` +type CassandraAgentSpec struct { + Endpoint Endpoint `json:"endpoint,omitempty"` Filters []promapi.RelabelConfig `json:"filters,omitempty"` } -type TelemetryAgentEndpoint struct { +type Endpoint struct { Address string `json:"address,omitempty"` Port string `json:"port,omitempty"` } diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index 40cf7cc80..ce7852343 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -28,7 +28,7 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgentSpec) { +func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { *out = *in out.Endpoint = in.Endpoint if in.Filters != nil { @@ -40,12 +40,12 @@ func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgent } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CassandraTelemetryAgentSpec. -func (in *CassandraTelemetryAgentSpec) DeepCopy() *CassandraTelemetryAgentSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CassandraAgentSpec. +func (in *CassandraAgentSpec) DeepCopy() *CassandraAgentSpec { if in == nil { return nil } - out := new(CassandraTelemetryAgentSpec) + out := new(CassandraAgentSpec) in.DeepCopyInto(out) return out } @@ -107,16 +107,16 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TelemetryAgentEndpoint) DeepCopyInto(out *TelemetryAgentEndpoint) { +func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryAgentEndpoint. -func (in *TelemetryAgentEndpoint) DeepCopy() *TelemetryAgentEndpoint { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. +func (in *Endpoint) DeepCopy() *Endpoint { if in == nil { return nil } - out := new(TelemetryAgentEndpoint) + out := new(Endpoint) in.DeepCopyInto(out) return out } @@ -141,7 +141,7 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { } if in.Cassandra != nil { in, out := &in.Cassandra, &out.Cassandra - *out = new(CassandraTelemetryAgentSpec) + *out = new(CassandraAgentSpec) (*in).DeepCopyInto(*out) } } diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index e8a56f338..3dad9dc2a 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -27,7 +27,7 @@ var ( address: 127.0.0.1 port: "10000" filters: -- sourceLabels: +- sourcelabels: - tag1 - tag2 separator: ; @@ -35,7 +35,8 @@ filters: regex: (.*);(b.*) modulus: 0 replacement: "" - action: drop` + action: drop +` ) func Test_GetTelemetryAgentConfigMap(t *testing.T) { @@ -60,7 +61,7 @@ func Test_GetTelemetryAgentConfigMap(t *testing.T) { } cm, err := Cfg.GetTelemetryAgentConfigMap() assert.NoError(t, err) - assert.Equal(t, expectedCm.Data, cm.Data) + assert.Equal(t, expectedCm.Data["metric-collector.yaml"], cm.Data["metric-collector.yaml"]) assert.Equal(t, expectedCm.Name, cm.Name) assert.Equal(t, expectedCm.Namespace, cm.Namespace) } diff --git a/pkg/telemetry/test_objects.go b/pkg/telemetry/test_objects.go index 012f7ddcb..0ddb1083c 100644 --- a/pkg/telemetry/test_objects.go +++ b/pkg/telemetry/test_objects.go @@ -6,7 +6,7 @@ import ( func NewTelemetrySpec() telemetryapi.TelemetrySpec { return telemetryapi.TelemetrySpec{ - Cassandra: &telemetryapi.CassandraTelemetryAgentSpec{}, + Cassandra: &telemetryapi.CassandraAgentSpec{}, } } From ff5c2af35f7f037e64551a85d55c0d65aebbcf72 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 23 Jan 2023 17:28:08 +1100 Subject: [PATCH 06/36] Fix npe, update codegen. --- .../v1alpha1/zz_generated.deepcopy.go | 30 +++++++++---------- .../cassandra_telemetry_reconciler.go | 4 +++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index ce7852343..54da6841b 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -50,6 +50,21 @@ func (in *CassandraAgentSpec) DeepCopy() *CassandraAgentSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Endpoint) DeepCopyInto(out *Endpoint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. +func (in *Endpoint) DeepCopy() *Endpoint { + if in == nil { + return nil + } + out := new(Endpoint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *McacTelemetrySpec) DeepCopyInto(out *McacTelemetrySpec) { *out = *in @@ -106,21 +121,6 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Endpoint) DeepCopyInto(out *Endpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. -func (in *Endpoint) DeepCopy() *Endpoint { - if in == nil { - return nil - } - out := new(Endpoint) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = *in diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler.go b/controllers/k8ssandra/cassandra_telemetry_reconciler.go index 47615cd22..6e782354e 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler.go @@ -9,6 +9,7 @@ import ( "github.com/go-logr/logr" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/result" "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" agent "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry/cassandra_agent" @@ -72,6 +73,9 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( return result.Error(err) } } + if mergedSpec == nil { + mergedSpec = &telemetryapi.TelemetrySpec{} + } agentCfg := agent.Configurator{ TelemetrySpec: *mergedSpec, RemoteClient: remoteClient, From dc075652f979126cffac18d5f1e3f104d1d7404c Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 13:37:57 +1100 Subject: [PATCH 07/36] Switch yaml library to `sigs.k8s.io/yaml` to take advantage of better use of json tags. --- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 2 +- pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 173a69683..9eb6a0e2d 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -8,10 +8,10 @@ import ( k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" - "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/yaml" ) var ( diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 3dad9dc2a..a3d221119 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -27,7 +27,7 @@ var ( address: 127.0.0.1 port: "10000" filters: -- sourcelabels: +- sourceLabels: - tag1 - tag2 separator: ; From 32cebed44d80475bb6538b11a5891dd85a3c112f Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 14:37:58 +1100 Subject: [PATCH 08/36] Fix unit tests to account for new yaml library. --- .../cassandra_agent/cassandra_agent_config_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index a3d221119..0ac0a335a 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -27,15 +27,12 @@ var ( address: 127.0.0.1 port: "10000" filters: -- sourceLabels: +- action: drop + regex: (.*);(b.*) + separator: ; + sourceLabels: - tag1 - tag2 - separator: ; - targetlabel: "" - regex: (.*);(b.*) - modulus: 0 - replacement: "" - action: drop ` ) From 184e0f761b981751ffef11431784a9617adb13d2 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 14:59:13 +1100 Subject: [PATCH 09/36] Move the reconciliation of the telemetry agent's resources into the Cassandra reconciliation stage (remove an sts restart). --- .../k8ssandra/cassandra_telemetry_reconciler.go | 14 -------------- controllers/k8ssandra/datacenters.go | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler.go b/controllers/k8ssandra/cassandra_telemetry_reconciler.go index 6e782354e..76096305d 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler.go @@ -9,10 +9,8 @@ import ( "github.com/go-logr/logr" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" - telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/result" "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" - agent "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry/cassandra_agent" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -73,18 +71,6 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( return result.Error(err) } } - if mergedSpec == nil { - mergedSpec = &telemetryapi.TelemetrySpec{} - } - agentCfg := agent.Configurator{ - TelemetrySpec: *mergedSpec, - RemoteClient: remoteClient, - Ctx: ctx, - Kluster: kc, - } - if err = agentCfg.ReconcileTelemetryAgentConfig(actualDc); err != nil { - return result.Error(err) - } return result.Continue() } diff --git a/controllers/k8ssandra/datacenters.go b/controllers/k8ssandra/datacenters.go index ea36703e5..9a217f4d1 100644 --- a/controllers/k8ssandra/datacenters.go +++ b/controllers/k8ssandra/datacenters.go @@ -11,10 +11,12 @@ import ( cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" cassctlapi "github.com/k8ssandra/cass-operator/apis/control/v1alpha1" api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/annotations" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" "github.com/k8ssandra/k8ssandra-operator/pkg/result" "github.com/k8ssandra/k8ssandra-operator/pkg/secret" + agent "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry/cassandra_agent" "github.com/k8ssandra/k8ssandra-operator/pkg/utils" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -97,6 +99,20 @@ func (r *K8ssandraClusterReconciler) reconcileDatacenters(ctx context.Context, k desiredDc.Annotations[cassdcapi.SkipUserCreationAnnotation] = "true" } + mergedTelemetrySpec := kc.Spec.Cassandra.Datacenters[idx].Telemetry.MergeWith(kc.Spec.Cassandra.Telemetry) + if mergedTelemetrySpec == nil { + mergedTelemetrySpec = &telemetryapi.TelemetrySpec{} + } + agentCfg := agent.Configurator{ + TelemetrySpec: *mergedTelemetrySpec, + RemoteClient: remoteClient, + Ctx: ctx, + Kluster: kc, + } + if err = agentCfg.ReconcileTelemetryAgentConfig(desiredDc); err != nil { + return result.Error(err), actualDcs + } + // Note: desiredDc should not be modified from now on annotations.AddHashAnnotation(desiredDc) From a3554e746cc83186419cc8425bf452f0798ae585 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 15:48:40 +1100 Subject: [PATCH 10/36] Ensure we cater to configmap updates, not just creations. --- .../cassandra_agent/cassandra_agent_config.go | 50 +++++++++++++++---- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 9eb6a0e2d..19f1c2698 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -3,13 +3,18 @@ package cassandra_agent import ( "context" "path/filepath" + "time" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" + "github.com/k8ssandra/k8ssandra-operator/pkg/annotations" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + "github.com/k8ssandra/k8ssandra-operator/pkg/result" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) @@ -23,12 +28,13 @@ type Configurator struct { Kluster *k8ssandraapi.K8ssandraCluster Ctx context.Context RemoteClient client.Client + RequeueDelay time.Duration } -func (c Configurator) GetTelemetryAgentConfigMap() (corev1.ConfigMap, error) { +func (c Configurator) GetTelemetryAgentConfigMap() (*corev1.ConfigMap, error) { yamlData, err := yaml.Marshal(&c.TelemetrySpec.Cassandra) if err != nil { - return corev1.ConfigMap{}, err + return &corev1.ConfigMap{}, err } cm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -37,20 +43,46 @@ func (c Configurator) GetTelemetryAgentConfigMap() (corev1.ConfigMap, error) { }, Data: map[string]string{filepath.Base(agentConfigLocation): string(yamlData)}, } - return cm, nil + return &cm, nil } -func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatacenter) error { - cm, err := c.GetTelemetryAgentConfigMap() +func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatacenter) result.ReconcileResult { + //Reconcile the agent's ConfigMap + desiredCm, err := c.GetTelemetryAgentConfigMap() if err != nil { - return err + return result.Error(err) } - if err := c.RemoteClient.Create(c.Ctx, &cm); err != nil { - return err + annotations.AddHashAnnotation(desiredCm) + currentCm := &corev1.ConfigMap{} + + err = c.RemoteClient.Get(c.Ctx, + types.NamespacedName{Name: c.Kluster.Name + "metrics-agent-config", + Namespace: c.Kluster.Namespace}, currentCm) + + if err != nil { + if errors.IsNotFound(err) { + if err := c.RemoteClient.Create(c.Ctx, desiredCm); err != nil { + return result.Error(err) + } + return result.RequeueSoon(c.RequeueDelay) + } else { + return result.Error(err) + } } + + if !annotations.CompareHashAnnotations(currentCm, desiredCm) { + resourceVersion := currentCm.GetResourceVersion() + desiredCm.DeepCopyInto(currentCm) + currentCm.SetResourceVersion(resourceVersion) + if err := c.RemoteClient.Update(c.Ctx, currentCm); err != nil { + return result.Error(err) + } + return result.Continue() + } + c.AddStsVolumes(dc) - return nil + return result.Done() } func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { From f77face8dc5e53d9e603f13c526123fbb0b961a1 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 16:07:56 +1100 Subject: [PATCH 11/36] Massage results so that they integrate a bit better. --- controllers/k8ssandra/datacenters.go | 9 +++-- pkg/result/result_helper.go | 54 +++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/controllers/k8ssandra/datacenters.go b/controllers/k8ssandra/datacenters.go index 9a217f4d1..377d247a8 100644 --- a/controllers/k8ssandra/datacenters.go +++ b/controllers/k8ssandra/datacenters.go @@ -109,8 +109,13 @@ func (r *K8ssandraClusterReconciler) reconcileDatacenters(ctx context.Context, k Ctx: ctx, Kluster: kc, } - if err = agentCfg.ReconcileTelemetryAgentConfig(desiredDc); err != nil { - return result.Error(err), actualDcs + agentRes := agentCfg.ReconcileTelemetryAgentConfig(desiredDc) + if agentRes.IsRequeue() { + return result.RequeueSoon(r.DefaultDelay), actualDcs + } + + if agentRes.IsError() { + return agentRes, actualDcs } // Note: desiredDc should not be modified from now on diff --git a/pkg/result/result_helper.go b/pkg/result/result_helper.go index b7b1d1802..93e460aa3 100644 --- a/pkg/result/result_helper.go +++ b/pkg/result/result_helper.go @@ -1,8 +1,9 @@ package result import ( - ctrl "sigs.k8s.io/controller-runtime" "time" + + ctrl "sigs.k8s.io/controller-runtime" ) // Copyright DataStax, Inc. @@ -11,6 +12,9 @@ import ( type ReconcileResult interface { Completed() bool Output() (ctrl.Result, error) + IsError() bool + IsRequeue() bool + IsDone() bool } type continueReconcile struct{} @@ -22,6 +26,18 @@ func (c continueReconcile) Output() (ctrl.Result, error) { panic("there was no Result to return") } +func (continueReconcile) IsDone() bool { + return false +} + +func (continueReconcile) IsError() bool { + return false +} + +func (continueReconcile) IsRequeue() bool { + return false +} + type done struct{} func (d done) Completed() bool { @@ -31,6 +47,18 @@ func (d done) Output() (ctrl.Result, error) { return ctrl.Result{}, nil } +func (done) IsDone() bool { + return true +} + +func (done) IsError() bool { + return false +} + +func (done) IsRequeue() bool { + return false +} + type callBackSoon struct { after time.Duration } @@ -42,6 +70,18 @@ func (c callBackSoon) Output() (ctrl.Result, error) { return ctrl.Result{Requeue: true, RequeueAfter: c.after}, nil } +func (callBackSoon) IsDone() bool { + return false +} + +func (callBackSoon) IsError() bool { + return false +} + +func (callBackSoon) IsRequeue() bool { + return true +} + type errorOut struct { err error } @@ -53,6 +93,18 @@ func (e errorOut) Output() (ctrl.Result, error) { return ctrl.Result{}, e.err } +func (errorOut) IsDone() bool { + return false +} + +func (errorOut) IsError() bool { + return true +} + +func (errorOut) IsRequeue() bool { + return false +} + func Continue() ReconcileResult { return continueReconcile{} } From 357e3ee9ac21db2c8f0ace156dcb2e232240f3ae Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 16:09:39 +1100 Subject: [PATCH 12/36] Make sure agent reconciliation funcs have access to requeue delay. --- controllers/k8ssandra/datacenters.go | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/k8ssandra/datacenters.go b/controllers/k8ssandra/datacenters.go index 377d247a8..57d53eb2b 100644 --- a/controllers/k8ssandra/datacenters.go +++ b/controllers/k8ssandra/datacenters.go @@ -108,6 +108,7 @@ func (r *K8ssandraClusterReconciler) reconcileDatacenters(ctx context.Context, k RemoteClient: remoteClient, Ctx: ctx, Kluster: kc, + RequeueDelay: r.DefaultDelay, } agentRes := agentCfg.ReconcileTelemetryAgentConfig(desiredDc) if agentRes.IsRequeue() { From 911f93655d8aeee28932bd3975d8460829db3af9 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 17:51:22 +1100 Subject: [PATCH 13/36] Create new CreateFailingFakeClient to assist tests. --- pkg/test/fakeclient.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkg/test/fakeclient.go b/pkg/test/fakeclient.go index 8bf3af29b..e2805d5b3 100644 --- a/pkg/test/fakeclient.go +++ b/pkg/test/fakeclient.go @@ -1,6 +1,9 @@ package test import ( + "context" + "errors" + cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" reaperapi "github.com/k8ssandra/k8ssandra-operator/apis/reaper/v1alpha1" @@ -11,6 +14,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/scheme" @@ -60,3 +64,26 @@ func NewFakeClientWRestMapper() client.Client { fakeClient, _ := NewFakeClient() return composedClient{fakeClient} } + +// CreateFailingFakeClient is a fake client. Calls to .Create on this client will fail after `createFailsAfter` invocations. +type CreateFailingFakeClient struct { + client.Client + createFailsAfter int + invocations *int +} + +func (c CreateFailingFakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { + succeedingClient := NewFakeClientWRestMapper() + if *c.invocations > c.createFailsAfter { + return errors.New("artificial failure on create function") + } else { + succeedingClient.Create(ctx, obj, opts...) + } + c.invocations = pointer.Int(*c.invocations + 1) + return nil +} + +func NewCreateFailingFakeClient(createFailsAfter int) client.Client { + fakeClient, _ := NewFakeClient() + return CreateFailingFakeClient{fakeClient, createFailsAfter, pointer.Int(0)} +} From 0078b01cb06ccc06b1010bf6c184adfd98e16314 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 17:52:41 +1100 Subject: [PATCH 14/36] Work around conflict between struct embedding and inability to modify struct field from method. --- pkg/test/fakeclient.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pkg/test/fakeclient.go b/pkg/test/fakeclient.go index e2805d5b3..44d15fe52 100644 --- a/pkg/test/fakeclient.go +++ b/pkg/test/fakeclient.go @@ -14,7 +14,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/scheme" @@ -68,22 +67,13 @@ func NewFakeClientWRestMapper() client.Client { // CreateFailingFakeClient is a fake client. Calls to .Create on this client will fail after `createFailsAfter` invocations. type CreateFailingFakeClient struct { client.Client - createFailsAfter int - invocations *int } func (c CreateFailingFakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { - succeedingClient := NewFakeClientWRestMapper() - if *c.invocations > c.createFailsAfter { - return errors.New("artificial failure on create function") - } else { - succeedingClient.Create(ctx, obj, opts...) - } - c.invocations = pointer.Int(*c.invocations + 1) - return nil + return errors.New("artificial failure on create function") } -func NewCreateFailingFakeClient(createFailsAfter int) client.Client { +func NewCreateFailingFakeClient() client.Client { fakeClient, _ := NewFakeClient() - return CreateFailingFakeClient{fakeClient, createFailsAfter, pointer.Int(0)} + return CreateFailingFakeClient{fakeClient} } From c6304bf6897cc6cdee844dcbb5f07674de27420e Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 18:38:09 +1100 Subject: [PATCH 15/36] Add more tests to the reconciliation logic. --- .../cassandra_agent/cassandra_agent_config.go | 2 +- .../cassandra_agent_config_test.go | 95 +++++++++++++++++-- 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 19f1c2698..d75cca166 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -77,7 +77,7 @@ func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatac if err := c.RemoteClient.Update(c.Ctx, currentCm); err != nil { return result.Error(err) } - return result.Continue() + return result.RequeueSoon(c.RequeueDelay) } c.AddStsVolumes(dc) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 0ac0a335a..812ad5103 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -4,8 +4,10 @@ import ( "context" "path/filepath" "testing" + "time" k8ssandraapi "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" telemetry "github.com/k8ssandra/k8ssandra-operator/pkg/telemetry" testutils "github.com/k8ssandra/k8ssandra-operator/pkg/test" @@ -13,6 +15,7 @@ import ( "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) var ( @@ -22,6 +25,7 @@ var ( Kluster: &testCluster, Ctx: context.Background(), RemoteClient: testutils.NewFakeClientWRestMapper(), + RequeueDelay: time.Second * 1, } expectedYaml string = `endpoint: address: 127.0.0.1 @@ -36,7 +40,18 @@ filters: ` ) -func Test_GetTelemetryAgentConfigMap(t *testing.T) { +func getExpectedConfigMap() corev1.ConfigMap { + expectedCm := corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: Cfg.Kluster.Namespace, + Name: Cfg.Kluster.Name + "metrics-agent-config", + }, + Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, + } + return expectedCm +} + +func getExampleTelemetrySpec() telemetryapi.TelemetrySpec { tspec := &Cfg.TelemetrySpec tspec.Cassandra.Filters = []promapi.RelabelConfig{ { @@ -46,16 +61,14 @@ func Test_GetTelemetryAgentConfigMap(t *testing.T) { Action: "drop", }, } - tspec.Cassandra.Endpoint.Address = "127.0.0.1" tspec.Cassandra.Endpoint.Port = "10000" - expectedCm := corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: Cfg.Kluster.Namespace, - Name: Cfg.Kluster.Name + "metrics-agent-config", - }, - Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, - } + return *tspec +} + +func Test_GetTelemetryAgentConfigMap(t *testing.T) { + expectedCm := getExpectedConfigMap() + Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client cm, err := Cfg.GetTelemetryAgentConfigMap() assert.NoError(t, err) assert.Equal(t, expectedCm.Data["metric-collector.yaml"], cm.Data["metric-collector.yaml"]) @@ -65,6 +78,7 @@ func Test_GetTelemetryAgentConfigMap(t *testing.T) { func Test_AddStsVolumes(t *testing.T) { dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client Cfg.AddStsVolumes(&dc) expectedVol := corev1.Volume{ Name: "metrics-agent-config", @@ -93,3 +107,66 @@ func Test_AddStsVolumes(t *testing.T) { } assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Containers[cassContainer].VolumeMounts, expectedVm) } + +func Test_ReconcileTelemetryAgentConfig_CMCreateSuccess(t *testing.T) { + dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client + recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) + assert.True(t, recRes.IsRequeue()) + actualCm := &corev1.ConfigMap{} + err := Cfg.RemoteClient.Get(Cfg.Ctx, types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, actualCm) + assert.NoError(t, err) +} +func Test_ReconcileTelemetryAgentConfig_CMCreateFailed(t *testing.T) { + dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.RemoteClient = testutils.NewCreateFailingFakeClient() // Reset the Client + recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) + assert.True(t, recRes.IsError()) +} + +func Test_ReconcileTelemetryAgentConfig_CMUpdateSuccess(t *testing.T) { + dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client + // Create an initial ConfigMap with the same name. + initialCm, err := Cfg.GetTelemetryAgentConfigMap() + if err != nil { + assert.Fail(t, "couldn't create ConfigMap") + } + initialCm.Annotations[k8ssandraapi.ResourceHashAnnotation] = "gobbledegook" + initialCm.Data = map[string]string{"gobbledegook": "gobbledegook"} + if err := Cfg.RemoteClient.Create(Cfg.Ctx, initialCm); err != nil { + assert.Fail(t, "could not create initial ConfigMap") + } + // Launch reconciliation. + recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) + assert.True(t, recRes.IsRequeue()) + // After the update we should see the expected ConfigMap + afterUpdateCM := &corev1.ConfigMap{} + err = Cfg.RemoteClient.Get(Cfg.Ctx, + types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + afterUpdateCM) + assert.NoError(t, err) + + expectedCm := getExpectedConfigMap() + assert.NoError(t, err) + assert.Equal(t, expectedCm.Data["metric-collector.yaml"], afterUpdateCM.Data["metric-collector.yaml"]) + assert.Equal(t, expectedCm.Name, afterUpdateCM.Name) + assert.Equal(t, expectedCm.Namespace, afterUpdateCM.Namespace) +} + +func Test_ReconcileTelemetryAgentConfig_CMUpdateDone(t *testing.T) { + dc := testutils.NewCassandraDatacenter("test-dc", "test-namespace") + Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client + // Launch reconciliation. + recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) + assert.True(t, recRes.IsRequeue()) + // After the update we should see the expected ConfigMap + afterUpdateCM := &corev1.ConfigMap{} + err := Cfg.RemoteClient.Get(Cfg.Ctx, + types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + afterUpdateCM) + assert.NoError(t, err) + // If we reconcile again, we should move into the Done state. + recRes = Cfg.ReconcileTelemetryAgentConfig(&dc) + assert.True(t, recRes.IsDone()) +} From 9b21ce153eb0d9fd5f6a45c1b6008c2dcca08bf7 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 25 Jan 2023 18:56:22 +1100 Subject: [PATCH 16/36] Fixes for unit tests. --- pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 812ad5103..1fd028878 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -69,6 +69,7 @@ func getExampleTelemetrySpec() telemetryapi.TelemetrySpec { func Test_GetTelemetryAgentConfigMap(t *testing.T) { expectedCm := getExpectedConfigMap() Cfg.RemoteClient = testutils.NewFakeClientWRestMapper() // Reset the Client + Cfg.TelemetrySpec = getExampleTelemetrySpec() cm, err := Cfg.GetTelemetryAgentConfigMap() assert.NoError(t, err) assert.Equal(t, expectedCm.Data["metric-collector.yaml"], cm.Data["metric-collector.yaml"]) @@ -132,12 +133,14 @@ func Test_ReconcileTelemetryAgentConfig_CMUpdateSuccess(t *testing.T) { if err != nil { assert.Fail(t, "couldn't create ConfigMap") } + initialCm.Annotations = make(map[string]string) initialCm.Annotations[k8ssandraapi.ResourceHashAnnotation] = "gobbledegook" initialCm.Data = map[string]string{"gobbledegook": "gobbledegook"} if err := Cfg.RemoteClient.Create(Cfg.Ctx, initialCm); err != nil { assert.Fail(t, "could not create initial ConfigMap") } // Launch reconciliation. + Cfg.TelemetrySpec = getExampleTelemetrySpec() recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) assert.True(t, recRes.IsRequeue()) // After the update we should see the expected ConfigMap From fd421a5821c50f834ac7de00da0571f3c7c57fa0 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 13:29:53 +1100 Subject: [PATCH 17/36] Make sure we're settings managed by labels. --- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index d75cca166..e8d5e8782 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -10,6 +10,7 @@ import ( telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/annotations" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + "github.com/k8ssandra/k8ssandra-operator/pkg/labels" "github.com/k8ssandra/k8ssandra-operator/pkg/result" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -52,12 +53,13 @@ func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatac if err != nil { return result.Error(err) } + cmObjectKey := types.NamespacedName{Name: c.Kluster.Name + "metrics-agent-config", + Namespace: c.Kluster.Namespace} annotations.AddHashAnnotation(desiredCm) + labels.SetManagedBy(desiredCm, cmObjectKey) currentCm := &corev1.ConfigMap{} - err = c.RemoteClient.Get(c.Ctx, - types.NamespacedName{Name: c.Kluster.Name + "metrics-agent-config", - Namespace: c.Kluster.Namespace}, currentCm) + err = c.RemoteClient.Get(c.Ctx, cmObjectKey, currentCm) if err != nil { if errors.IsNotFound(err) { From 76391ea87e9538def190cf518b9f41cef6227444 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 13:46:47 +1100 Subject: [PATCH 18/36] Add envtests and kuttl tests. --- .../k8ssandra/cassandra_metrics_agent_test.go | 107 ++++++++++++++++++ .../k8ssandracluster_controller_test.go | 1 + .../kuttl/test-servicemonitors/04-assert.yaml | 6 + 3 files changed, 114 insertions(+) create mode 100644 controllers/k8ssandra/cassandra_metrics_agent_test.go create mode 100644 test/kuttl/test-servicemonitors/04-assert.yaml diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go new file mode 100644 index 000000000..fa798d339 --- /dev/null +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -0,0 +1,107 @@ +package k8ssandra + +import ( + "context" + "testing" + + cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" + api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" + "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + "github.com/k8ssandra/k8ssandra-operator/test/framework" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// createSingleDcCluster verifies that the CassandraDatacenter is created and that the +// expected status updates happen on the K8ssandraCluster. +func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f *framework.Framework, namespace string) { + require := require.New(t) + + kc := &api.K8ssandraCluster{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + Name: "test", + }, + Spec: api.K8ssandraClusterSpec{ + Cassandra: &api.CassandraClusterTemplate{ + Datacenters: []api.CassandraDatacenterTemplate{ + { + Meta: api.EmbeddedObjectMeta{ + Name: "dc1", + }, + K8sContext: f.DataPlaneContexts[0], + Size: 1, + DatacenterOptions: api.DatacenterOptions{ + ServerVersion: "4.0.4", + StorageConfig: &cassdcapi.StorageConfig{ + CassandraDataVolumeClaimSpec: &corev1.PersistentVolumeClaimSpec{ + StorageClassName: &defaultStorageClass, + }, + }, + PodSecurityContext: &corev1.PodSecurityContext{ + RunAsUser: pointer.Int64(999), + }, + ManagementApiAuth: &cassdcapi.ManagementApiAuthConfig{ + Insecure: &cassdcapi.ManagementApiAuthInsecureConfig{}, + }, + }, + }, + }, + }, + }, + } + + err := f.Client.Create(ctx, kc) + require.NoError(err, "failed to create K8ssandraCluster") + + verifyFinalizerAdded(ctx, t, f, client.ObjectKey{Namespace: kc.Namespace, Name: kc.Name}) + + verifySuperuserSecretCreated(ctx, t, f, kc) + + verifyReplicatedSecretReconciled(ctx, t, f, kc) + + verifySystemReplicationAnnotationSet(ctx, t, f, kc) + + t.Log("check that the datacenter was created") + dcKey := framework.ClusterKey{NamespacedName: types.NamespacedName{Namespace: namespace, Name: "dc1"}, K8sContext: f.DataPlaneContexts[0]} + require.Eventually(f.DatacenterExists(ctx, dcKey), timeout, interval) + + // Check that we have the right volumes and volume mounts. + sts := &appsv1.StatefulSet{} + if err := f.Client.Get(ctx, types.NamespacedName{Name: "test-dc1-default-sts", Namespace: namespace}, sts); err != nil { + assert.Fail(t, "could not find sts") + } + _, found := cassandra.FindVolume(&sts.Spec.Template, "metrics-agent-config") + if !found { + assert.Fail(t, "could not find expected metrics-agent-config volume") + } + cassContainerIdx, _ := cassandra.FindContainer(&sts.Spec.Template, "cassandra") + volMount := cassandra.FindVolumeMount(&sts.Spec.Template.Spec.Containers[cassContainerIdx], "metrics-agent-config") + if volMount == nil { + assert.Fail(t, "could not find expected metrics-agent-config volumeMount") + } + + // check that we have the right ConfigMap + agentCmKey := types.NamespacedName{Name: "test" + "metrics-agent-config", Namespace: namespace} + agentCm := corev1.ConfigMap{} + if err := f.Client.Get(ctx, agentCmKey, &agentCm); err != nil { + assert.Fail(t, "could not find expected metrics-agent-config configmap") + } + + // Test cluster deletion + t.Log("deleting K8ssandraCluster") + err = f.DeleteK8ssandraCluster(ctx, client.ObjectKey{Namespace: namespace, Name: kc.Name}, timeout, interval) + require.NoError(err, "failed to delete K8ssandraCluster") + f.AssertObjectDoesNotExist(ctx, t, dcKey, &cassdcapi.CassandraDatacenter{}, timeout, interval) + f.AssertObjectDoesNotExist(ctx, t, + framework.ClusterKey{K8sContext: f.DataPlaneContexts[1], NamespacedName: agentCmKey}, + &corev1.ConfigMap{}, + timeout, + interval) +} diff --git a/controllers/k8ssandra/k8ssandracluster_controller_test.go b/controllers/k8ssandra/k8ssandracluster_controller_test.go index 0549a58c4..65f153416 100644 --- a/controllers/k8ssandra/k8ssandracluster_controller_test.go +++ b/controllers/k8ssandra/k8ssandracluster_controller_test.go @@ -115,6 +115,7 @@ func TestK8ssandraCluster(t *testing.T) { t.Run("CreateMultiDcDseCluster", testEnv.ControllerTest(ctx, createMultiDcDseCluster)) t.Run("PerNodeConfiguration", testEnv.ControllerTest(ctx, perNodeConfiguration)) t.Run("CreateSingleDcClusterWithVector", testEnv.ControllerTest(ctx, createSingleDcClusterWithVector)) + t.Run("createSingleDcClusterWithMetricsAgent", testEnv.ControllerTest(ctx, createSingleDcClusterWithMetricsAgent)) } // createSingleDcCluster verifies that the CassandraDatacenter is created and that the diff --git a/test/kuttl/test-servicemonitors/04-assert.yaml b/test/kuttl/test-servicemonitors/04-assert.yaml new file mode 100644 index 000000000..806439084 --- /dev/null +++ b/test/kuttl/test-servicemonitors/04-assert.yaml @@ -0,0 +1,6 @@ +# Test for presence of expected config for cassandra metrics agent +apiVersion: v1 +kind: ConfigMap +metadata: + name: test-metrics-agent-config + namespace: k8ssandra-operator From 3af601c4c550d310711b3134eac9793adc6e131e Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 15:42:34 +1100 Subject: [PATCH 19/36] Changelog. --- CHANGELOG/CHANGELOG-1.5.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG/CHANGELOG-1.5.md b/CHANGELOG/CHANGELOG-1.5.md index bf73e76b9..717d097ac 100644 --- a/CHANGELOG/CHANGELOG-1.5.md +++ b/CHANGELOG/CHANGELOG-1.5.md @@ -15,6 +15,7 @@ When cutting a new release, update the `unreleased` heading to the tag being gen ## unreleased * [FEATURE] [#783](https://github.com/k8ssandra/k8ssandra-operator/issues/783) Allow disabling MCAC +* [FEATURE] [#739815](https://github.com/k8ssandra/k8ssandra-operator/issues/815) Add configuration block to CRDs for new Cassandra metrics agent. * [FEATURE] [#739](https://github.com/k8ssandra/k8ssandra-operator/issues/739) Add API for cluster-level tasks * [FEATURE] [#775](https://github.com/k8ssandra/k8ssandra-operator/issues/775) Add the ability to inject and configure a Vector agent sidecar in the Cassandra pods * [FEATURE] [#600](https://github.com/k8ssandra/k8ssandra-operator/issues/600) Disable secrets management and replication with the external secrets provider From 6c76caba4dbe412b7b3d3ff5e5e4199b75f49527 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 16:50:43 +1100 Subject: [PATCH 20/36] Fix configmap name. --- controllers/k8ssandra/cassandra_metrics_agent_test.go | 4 ++-- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 6 +++--- .../cassandra_agent/cassandra_agent_config_test.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index fa798d339..2c27c0353 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -88,13 +88,13 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f } // check that we have the right ConfigMap - agentCmKey := types.NamespacedName{Name: "test" + "metrics-agent-config", Namespace: namespace} + agentCmKey := types.NamespacedName{Name: "test" + "-metrics-agent-config", Namespace: namespace} agentCm := corev1.ConfigMap{} if err := f.Client.Get(ctx, agentCmKey, &agentCm); err != nil { assert.Fail(t, "could not find expected metrics-agent-config configmap") } - // Test cluster deletion + // Test cluster deletion, ensuring configmap deleted too. t.Log("deleting K8ssandraCluster") err = f.DeleteK8ssandraCluster(ctx, client.ObjectKey{Namespace: namespace, Name: kc.Name}, timeout, interval) require.NoError(err, "failed to delete K8ssandraCluster") diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index e8d5e8782..fbc29981d 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -40,7 +40,7 @@ func (c Configurator) GetTelemetryAgentConfigMap() (*corev1.ConfigMap, error) { cm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Namespace: c.Kluster.Namespace, - Name: c.Kluster.Name + "metrics-agent-config", + Name: c.Kluster.Name + "-metrics-agent-config", }, Data: map[string]string{filepath.Base(agentConfigLocation): string(yamlData)}, } @@ -53,7 +53,7 @@ func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatac if err != nil { return result.Error(err) } - cmObjectKey := types.NamespacedName{Name: c.Kluster.Name + "metrics-agent-config", + cmObjectKey := types.NamespacedName{Name: c.Kluster.Name + "-metrics-agent-config", Namespace: c.Kluster.Namespace} annotations.AddHashAnnotation(desiredCm) labels.SetManagedBy(desiredCm, cmObjectKey) @@ -104,7 +104,7 @@ func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { }, }, LocalObjectReference: corev1.LocalObjectReference{ - Name: c.Kluster.Name + "metrics-agent-config", + Name: c.Kluster.Name + "-metrics-agent-config", }, }, }, diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 1fd028878..cd232e256 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -44,7 +44,7 @@ func getExpectedConfigMap() corev1.ConfigMap { expectedCm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Namespace: Cfg.Kluster.Namespace, - Name: Cfg.Kluster.Name + "metrics-agent-config", + Name: Cfg.Kluster.Name + "-metrics-agent-config", }, Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, } @@ -115,7 +115,7 @@ func Test_ReconcileTelemetryAgentConfig_CMCreateSuccess(t *testing.T) { recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) assert.True(t, recRes.IsRequeue()) actualCm := &corev1.ConfigMap{} - err := Cfg.RemoteClient.Get(Cfg.Ctx, types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, actualCm) + err := Cfg.RemoteClient.Get(Cfg.Ctx, types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, actualCm) assert.NoError(t, err) } func Test_ReconcileTelemetryAgentConfig_CMCreateFailed(t *testing.T) { @@ -146,7 +146,7 @@ func Test_ReconcileTelemetryAgentConfig_CMUpdateSuccess(t *testing.T) { // After the update we should see the expected ConfigMap afterUpdateCM := &corev1.ConfigMap{} err = Cfg.RemoteClient.Get(Cfg.Ctx, - types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, afterUpdateCM) assert.NoError(t, err) @@ -166,7 +166,7 @@ func Test_ReconcileTelemetryAgentConfig_CMUpdateDone(t *testing.T) { // After the update we should see the expected ConfigMap afterUpdateCM := &corev1.ConfigMap{} err := Cfg.RemoteClient.Get(Cfg.Ctx, - types.NamespacedName{Name: Cfg.Kluster.Name + "metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, afterUpdateCM) assert.NoError(t, err) // If we reconcile again, we should move into the Done state. From ee5b7f955fed829dd39605a9161e64b69843550e Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 18:08:48 +1100 Subject: [PATCH 21/36] Add a default for when the Cassandra agent spec is not defined. --- .../cassandra_agent/cassandra_agent_config.go | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index fbc29981d..ceaf81f09 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -12,6 +12,7 @@ import ( "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" "github.com/k8ssandra/k8ssandra-operator/pkg/labels" "github.com/k8ssandra/k8ssandra-operator/pkg/result" + promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -22,6 +23,26 @@ import ( var ( agentConfigLocation = "/config/metric-collector.yaml" + defaultAgentConfig = telemetryapi.CassandraAgentSpec{ + Endpoint: telemetryapi.Endpoint{ + Port: "9001", + Address: "127.0.0.1", + }, + Filters: []promapi.RelabelConfig{ + { + SourceLabels: []string{"__tag1__", "__tag2__"}, + Separator: ";", + Regex: "(.*);(b.*)", + Action: "drop", + }, + { + SourceLabels: []string{"__tag1__", "__tag2__"}, + Separator: ",", + Regex: "^(a|b|c),.*", + Action: "drop", + }, + }, + } ) type Configurator struct { @@ -33,10 +54,20 @@ type Configurator struct { } func (c Configurator) GetTelemetryAgentConfigMap() (*corev1.ConfigMap, error) { - yamlData, err := yaml.Marshal(&c.TelemetrySpec.Cassandra) - if err != nil { - return &corev1.ConfigMap{}, err + var yamlData []byte + var err error + if c.TelemetrySpec.Cassandra != nil { + yamlData, err = yaml.Marshal(&c.TelemetrySpec.Cassandra) + if err != nil { + return &corev1.ConfigMap{}, err + } + } else { + yamlData, err = yaml.Marshal(&defaultAgentConfig) + if err != nil { + return &corev1.ConfigMap{}, err + } } + cm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Namespace: c.Kluster.Namespace, From 10c3053ea9a7b9b39c2e362bdd2440e436a5ab89 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 19:09:34 +1100 Subject: [PATCH 22/36] More work on getting envtests passing. --- .../k8ssandra/cassandra_metrics_agent_test.go | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index 2c27c0353..a7a9b0375 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -2,15 +2,15 @@ package k8ssandra import ( "context" + "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + "github.com/stretchr/testify/assert" "testing" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" - "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/test/framework" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -30,6 +30,13 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f }, Spec: api.K8ssandraClusterSpec{ Cassandra: &api.CassandraClusterTemplate{ + DatacenterOptions: api.DatacenterOptions{ + Telemetry: &telemetryapi.TelemetrySpec{ + Vector: &telemetryapi.VectorSpec{ + Enabled: pointer.Bool(true), + }, + }, + }, Datacenters: []api.CassandraDatacenterTemplate{ { Meta: api.EmbeddedObjectMeta{ @@ -38,7 +45,7 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f K8sContext: f.DataPlaneContexts[0], Size: 1, DatacenterOptions: api.DatacenterOptions{ - ServerVersion: "4.0.4", + ServerVersion: "3.11.10", StorageConfig: &cassdcapi.StorageConfig{ CassandraDataVolumeClaimSpec: &corev1.PersistentVolumeClaimSpec{ StorageClassName: &defaultStorageClass, @@ -71,26 +78,26 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f t.Log("check that the datacenter was created") dcKey := framework.ClusterKey{NamespacedName: types.NamespacedName{Namespace: namespace, Name: "dc1"}, K8sContext: f.DataPlaneContexts[0]} require.Eventually(f.DatacenterExists(ctx, dcKey), timeout, interval) - // Check that we have the right volumes and volume mounts. - sts := &appsv1.StatefulSet{} - if err := f.Client.Get(ctx, types.NamespacedName{Name: "test-dc1-default-sts", Namespace: namespace}, sts); err != nil { - assert.Fail(t, "could not find sts") + dc := &cassdcapi.CassandraDatacenter{} + f.Get(ctx, dcKey, dc) + if err := f.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: "dc1"}, dc); err != nil { + require.Fail("could not find dc") } - _, found := cassandra.FindVolume(&sts.Spec.Template, "metrics-agent-config") + _, found := cassandra.FindVolume(dc.Spec.PodTemplateSpec, "metrics-agent-config") if !found { - assert.Fail(t, "could not find expected metrics-agent-config volume") + require.Fail("could not find expected metrics-agent-config volume") } - cassContainerIdx, _ := cassandra.FindContainer(&sts.Spec.Template, "cassandra") - volMount := cassandra.FindVolumeMount(&sts.Spec.Template.Spec.Containers[cassContainerIdx], "metrics-agent-config") + cassContainerIdx, _ := cassandra.FindContainer(dc.Spec.PodTemplateSpec, "cassandra") + volMount := cassandra.FindVolumeMount(&dc.Spec.PodTemplateSpec.Spec.Containers[cassContainerIdx], "metrics-agent-config") if volMount == nil { - assert.Fail(t, "could not find expected metrics-agent-config volumeMount") + require.Fail("could not find expected metrics-agent-config volumeMount") } // check that we have the right ConfigMap - agentCmKey := types.NamespacedName{Name: "test" + "-metrics-agent-config", Namespace: namespace} + agentCmKey := framework.ClusterKey{NamespacedName: types.NamespacedName{Name: "test" + "-metrics-agent-config", Namespace: namespace}, K8sContext: f.DataPlaneContexts[0]} agentCm := corev1.ConfigMap{} - if err := f.Client.Get(ctx, agentCmKey, &agentCm); err != nil { + if err := f.Get(ctx, agentCmKey, &agentCm); err != nil { assert.Fail(t, "could not find expected metrics-agent-config configmap") } @@ -100,7 +107,7 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f require.NoError(err, "failed to delete K8ssandraCluster") f.AssertObjectDoesNotExist(ctx, t, dcKey, &cassdcapi.CassandraDatacenter{}, timeout, interval) f.AssertObjectDoesNotExist(ctx, t, - framework.ClusterKey{K8sContext: f.DataPlaneContexts[1], NamespacedName: agentCmKey}, + agentCmKey, &corev1.ConfigMap{}, timeout, interval) From f21d553be1fe66b500089cc36e458bacab4172f9 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 30 Jan 2023 11:16:29 +1100 Subject: [PATCH 23/36] Ensure that all labels are set to clean up configmap when cluster deleted. Fix test. --- controllers/k8ssandra/cassandra_metrics_agent_test.go | 2 +- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index a7a9b0375..c59b0629d 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -81,7 +81,7 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f // Check that we have the right volumes and volume mounts. dc := &cassdcapi.CassandraDatacenter{} f.Get(ctx, dcKey, dc) - if err := f.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: "dc1"}, dc); err != nil { + if err := f.Get(ctx, dcKey, dc); err != nil { require.Fail("could not find dc") } _, found := cassandra.FindVolume(dc.Spec.PodTemplateSpec, "metrics-agent-config") diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index ceaf81f09..09ad6651a 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -86,8 +86,12 @@ func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatac } cmObjectKey := types.NamespacedName{Name: c.Kluster.Name + "-metrics-agent-config", Namespace: c.Kluster.Namespace} - annotations.AddHashAnnotation(desiredCm) labels.SetManagedBy(desiredCm, cmObjectKey) + KlKey := types.NamespacedName{Name: c.Kluster.Name, Namespace: c.Kluster.Namespace} + partOfLabels := labels.PartOfLabels(KlKey) + desiredCm.SetLabels(partOfLabels) + annotations.AddHashAnnotation(desiredCm) + currentCm := &corev1.ConfigMap{} err = c.RemoteClient.Get(c.Ctx, cmObjectKey, currentCm) From f67024b95aa50da2cfdf7e3bbb57dcf3cbaf7b9e Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 30 Jan 2023 11:29:33 +1100 Subject: [PATCH 24/36] Ensure correct defaults for the agent. --- .../cassandra_agent/cassandra_agent_config.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 09ad6651a..e30ddb250 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -12,7 +12,6 @@ import ( "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" "github.com/k8ssandra/k8ssandra-operator/pkg/labels" "github.com/k8ssandra/k8ssandra-operator/pkg/result" - promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,23 +24,9 @@ var ( agentConfigLocation = "/config/metric-collector.yaml" defaultAgentConfig = telemetryapi.CassandraAgentSpec{ Endpoint: telemetryapi.Endpoint{ - Port: "9001", + Port: "9000", Address: "127.0.0.1", }, - Filters: []promapi.RelabelConfig{ - { - SourceLabels: []string{"__tag1__", "__tag2__"}, - Separator: ";", - Regex: "(.*);(b.*)", - Action: "drop", - }, - { - SourceLabels: []string{"__tag1__", "__tag2__"}, - Separator: ",", - Regex: "^(a|b|c),.*", - Action: "drop", - }, - }, } ) From 3078679fc2c44ce362166ce159e0fbb8439a3f8c Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 30 Jan 2023 11:52:14 +1100 Subject: [PATCH 25/36] Fix another unit test. --- pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index cd232e256..43fcec3d9 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -92,7 +92,7 @@ func Test_AddStsVolumes(t *testing.T) { }, }, LocalObjectReference: corev1.LocalObjectReference{ - Name: Cfg.Kluster.Name + "metrics-agent-config", + Name: Cfg.Kluster.Name + "-metrics-agent-config", }, }, }, From e163ffb69bcb4e1e113c9ceaf6cad3bae5b0bc2b Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 30 Jan 2023 11:57:54 +1100 Subject: [PATCH 26/36] From recollection, the metrics agent config belongs in the same folder as MAAC. --- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index e30ddb250..e3580203d 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -21,7 +21,7 @@ import ( ) var ( - agentConfigLocation = "/config/metric-collector.yaml" + agentConfigLocation = "/opt/management-api/metric-collector.yaml" defaultAgentConfig = telemetryapi.CassandraAgentSpec{ Endpoint: telemetryapi.Endpoint{ Port: "9000", From 6a48cb2cb4849d782a5ba683bf1ea87f40225ccf Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 30 Jan 2023 16:15:44 +1100 Subject: [PATCH 27/36] Fix mount path for config file. --- controllers/k8ssandra/cassandra_metrics_agent_test.go | 3 ++- pkg/telemetry/cassandra_agent/cassandra_agent_config.go | 3 ++- pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index c59b0629d..aa6dd7e8e 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -2,9 +2,10 @@ package k8ssandra import ( "context" + "testing" + "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" "github.com/stretchr/testify/assert" - "testing" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1" diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index e3580203d..230fafdc9 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -137,7 +137,8 @@ func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { func(c *corev1.Container) { vm := corev1.VolumeMount{ Name: "metrics-agent-config", - MountPath: filepath.Base(filepath.Dir(agentConfigLocation)), + MountPath: agentConfigLocation, + SubPath: filepath.Base(agentConfigLocation), } c.VolumeMounts = append(c.VolumeMounts, vm) }) diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 43fcec3d9..be861eb63 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -104,7 +104,8 @@ func Test_AddStsVolumes(t *testing.T) { } expectedVm := corev1.VolumeMount{ Name: "metrics-agent-config", - MountPath: filepath.Base(filepath.Dir(agentConfigLocation)), + MountPath: agentConfigLocation, + SubPath: filepath.Base(agentConfigLocation), } assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Containers[cassContainer].VolumeMounts, expectedVm) } From 44450877a5edf739ce41e8ba16b494c53268abec Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Tue, 31 Jan 2023 21:55:28 +1100 Subject: [PATCH 28/36] Fix configmap namespacing issues. --- .../k8ssandra/cassandra_metrics_agent_test.go | 2 +- controllers/k8ssandra/datacenters.go | 2 ++ .../cassandra_agent/cassandra_agent_config.go | 19 +++++++++++++------ .../cassandra_agent_config_test.go | 19 +++++++++++++------ pkg/test/test_objects.go | 8 ++++++++ 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index aa6dd7e8e..605b4263d 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -96,7 +96,7 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f } // check that we have the right ConfigMap - agentCmKey := framework.ClusterKey{NamespacedName: types.NamespacedName{Name: "test" + "-metrics-agent-config", Namespace: namespace}, K8sContext: f.DataPlaneContexts[0]} + agentCmKey := framework.ClusterKey{NamespacedName: types.NamespacedName{Name: "test-dc1" + "-metrics-agent-config", Namespace: namespace}, K8sContext: f.DataPlaneContexts[0]} agentCm := corev1.ConfigMap{} if err := f.Get(ctx, agentCmKey, &agentCm); err != nil { assert.Fail(t, "could not find expected metrics-agent-config configmap") diff --git a/controllers/k8ssandra/datacenters.go b/controllers/k8ssandra/datacenters.go index 57d53eb2b..d9acdbe5a 100644 --- a/controllers/k8ssandra/datacenters.go +++ b/controllers/k8ssandra/datacenters.go @@ -109,6 +109,8 @@ func (r *K8ssandraClusterReconciler) reconcileDatacenters(ctx context.Context, k Ctx: ctx, Kluster: kc, RequeueDelay: r.DefaultDelay, + DcNamespace: desiredDc.Namespace, + DcName: desiredDc.Name, } agentRes := agentCfg.ReconcileTelemetryAgentConfig(desiredDc) if agentRes.IsRequeue() { diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index 230fafdc9..f2d2f37f8 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -36,6 +36,8 @@ type Configurator struct { Ctx context.Context RemoteClient client.Client RequeueDelay time.Duration + DcNamespace string + DcName string } func (c Configurator) GetTelemetryAgentConfigMap() (*corev1.ConfigMap, error) { @@ -55,8 +57,8 @@ func (c Configurator) GetTelemetryAgentConfigMap() (*corev1.ConfigMap, error) { cm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ - Namespace: c.Kluster.Namespace, - Name: c.Kluster.Name + "-metrics-agent-config", + Namespace: c.DcNamespace, + Name: c.Kluster.Name + "-" + c.DcName + "-metrics-agent-config", }, Data: map[string]string{filepath.Base(agentConfigLocation): string(yamlData)}, } @@ -69,10 +71,15 @@ func (c Configurator) ReconcileTelemetryAgentConfig(dc *cassdcapi.CassandraDatac if err != nil { return result.Error(err) } - cmObjectKey := types.NamespacedName{Name: c.Kluster.Name + "-metrics-agent-config", - Namespace: c.Kluster.Namespace} + cmObjectKey := types.NamespacedName{ + Name: c.Kluster.Name + "-" + c.DcName + "-metrics-agent-config", + Namespace: c.DcNamespace, + } labels.SetManagedBy(desiredCm, cmObjectKey) - KlKey := types.NamespacedName{Name: c.Kluster.Name, Namespace: c.Kluster.Namespace} + KlKey := types.NamespacedName{ + Name: c.Kluster.Name, + Namespace: c.Kluster.Namespace, + } partOfLabels := labels.PartOfLabels(KlKey) desiredCm.SetLabels(partOfLabels) annotations.AddHashAnnotation(desiredCm) @@ -124,7 +131,7 @@ func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error { }, }, LocalObjectReference: corev1.LocalObjectReference{ - Name: c.Kluster.Name + "-metrics-agent-config", + Name: c.Kluster.Name + "-" + c.DcName + "-metrics-agent-config", }, }, }, diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index be861eb63..9ceb33f3a 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -26,6 +26,8 @@ var ( Ctx: context.Background(), RemoteClient: testutils.NewFakeClientWRestMapper(), RequeueDelay: time.Second * 1, + DcNamespace: testCluster.Spec.Cassandra.Datacenters[0].Meta.Namespace, + DcName: testCluster.Spec.Cassandra.Datacenters[0].Meta.Name, } expectedYaml string = `endpoint: address: 127.0.0.1 @@ -43,8 +45,8 @@ filters: func getExpectedConfigMap() corev1.ConfigMap { expectedCm := corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ - Namespace: Cfg.Kluster.Namespace, - Name: Cfg.Kluster.Name + "-metrics-agent-config", + Namespace: Cfg.DcNamespace, + Name: Cfg.Kluster.Name + "-" + Cfg.DcName + "-metrics-agent-config", }, Data: map[string]string{filepath.Base(agentConfigLocation): expectedYaml}, } @@ -92,7 +94,7 @@ func Test_AddStsVolumes(t *testing.T) { }, }, LocalObjectReference: corev1.LocalObjectReference{ - Name: Cfg.Kluster.Name + "-metrics-agent-config", + Name: Cfg.Kluster.Name + "-" + Cfg.DcName + "-metrics-agent-config", }, }, }, @@ -116,7 +118,7 @@ func Test_ReconcileTelemetryAgentConfig_CMCreateSuccess(t *testing.T) { recRes := Cfg.ReconcileTelemetryAgentConfig(&dc) assert.True(t, recRes.IsRequeue()) actualCm := &corev1.ConfigMap{} - err := Cfg.RemoteClient.Get(Cfg.Ctx, types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, actualCm) + err := Cfg.RemoteClient.Get(Cfg.Ctx, types.NamespacedName{Name: Cfg.Kluster.Name + "-" + Cfg.DcName + "-metrics-agent-config", Namespace: Cfg.DcNamespace}, actualCm) assert.NoError(t, err) } func Test_ReconcileTelemetryAgentConfig_CMCreateFailed(t *testing.T) { @@ -147,7 +149,9 @@ func Test_ReconcileTelemetryAgentConfig_CMUpdateSuccess(t *testing.T) { // After the update we should see the expected ConfigMap afterUpdateCM := &corev1.ConfigMap{} err = Cfg.RemoteClient.Get(Cfg.Ctx, - types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + types.NamespacedName{ + Name: Cfg.Kluster.Name + "-" + Cfg.DcName + "-metrics-agent-config", + Namespace: Cfg.DcNamespace}, afterUpdateCM) assert.NoError(t, err) @@ -167,7 +171,10 @@ func Test_ReconcileTelemetryAgentConfig_CMUpdateDone(t *testing.T) { // After the update we should see the expected ConfigMap afterUpdateCM := &corev1.ConfigMap{} err := Cfg.RemoteClient.Get(Cfg.Ctx, - types.NamespacedName{Name: Cfg.Kluster.Name + "-metrics-agent-config", Namespace: Cfg.Kluster.Namespace}, + types.NamespacedName{ + Name: Cfg.Kluster.Name + "-" + Cfg.DcName + "-metrics-agent-config", + Namespace: Cfg.DcNamespace, + }, afterUpdateCM) assert.NoError(t, err) // If we reconcile again, we should move into the Done state. diff --git a/pkg/test/test_objects.go b/pkg/test/test_objects.go index 93211f1b3..8ddbe5e26 100644 --- a/pkg/test/test_objects.go +++ b/pkg/test/test_objects.go @@ -40,6 +40,14 @@ func NewK8ssandraCluster(name string, namespace string) k8ssandraapi.K8ssandraCl }, }, }, + Datacenters: []k8ssandraapi.CassandraDatacenterTemplate{ + { + Meta: k8ssandraapi.EmbeddedObjectMeta{ + Name: "dc1", + Namespace: "dc-namespace", + }, + }, + }, }, }, } From 51dc62c6c07c7c3da8137056b37e3f7e0aae982c Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 1 Feb 2023 13:14:11 +1100 Subject: [PATCH 29/36] Fix kuttl tests to account for new CM name. --- test/kuttl/test-servicemonitors/04-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kuttl/test-servicemonitors/04-assert.yaml b/test/kuttl/test-servicemonitors/04-assert.yaml index 806439084..c443afb72 100644 --- a/test/kuttl/test-servicemonitors/04-assert.yaml +++ b/test/kuttl/test-servicemonitors/04-assert.yaml @@ -2,5 +2,5 @@ apiVersion: v1 kind: ConfigMap metadata: - name: test-metrics-agent-config + name: test-dc1-metrics-agent-config namespace: k8ssandra-operator From 2b6af11b8c5953cca60239c154744b29db62e295 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Tue, 17 Jan 2023 17:56:27 +1100 Subject: [PATCH 30/36] Start stubbing out methods for agent config. --- apis/telemetry/v1alpha1/telemetry_types.go | 18 ++++++++++++++---- pkg/telemetry/cassandra_agent_config.go | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 pkg/telemetry/cassandra_agent_config.go diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index a935ec012..54a4a5833 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -9,10 +9,10 @@ import ( ) type TelemetrySpec struct { - Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` - Mcac *McacTelemetrySpec `json:"mcac,omitempty"` - Vector *VectorSpec `json:"vector,omitempty"` - Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` + Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` + Mcac *McacTelemetrySpec `json:"mcac,omitempty"` + Vector *VectorSpec `json:"vector,omitempty"` + Cassandra *CassandraTelemetryAgentSpec `json:"cassandra,omitempty"` } type PrometheusTelemetrySpec struct { @@ -138,3 +138,13 @@ type Endpoint struct { Address string `json:"address,omitempty"` Port string `json:"port,omitempty"` } + +type CassandraTelemetryAgentSpec struct { + Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` + Filters promapi.RelabelConfig `json:"filters,omitempty"` +} + +type TelemetryAgentEndpoint struct { + Address string `json:"address,omitempty"` + Port string `json:"port,omitempty"` +} diff --git a/pkg/telemetry/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent_config.go new file mode 100644 index 000000000..6175763d4 --- /dev/null +++ b/pkg/telemetry/cassandra_agent_config.go @@ -0,0 +1,19 @@ +package telemetry + +import ( + "context" + + telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" + "gopkg.in/yaml.v2" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func ReconcileTelemetryAgentConfigMap(ctx context.Context, remoteClient client.Client, telemetrySpec telemetryapi.TelemetrySpec) error { + yamlData, err := yaml.Marshal(&telemetrySpec.Cassandra) + if err != nil { + return err + } + cm := corev1.ConfigMap{} + +} From a9a6264a759213f00be458f58a18ae66d7b13bb9 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 20 Jan 2023 16:19:42 +1100 Subject: [PATCH 31/36] CRD upgrades, codegen upgrades. --- .../v1alpha1/zz_generated.deepcopy.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index 54da6841b..7f54566f9 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -28,7 +28,11 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +<<<<<<< HEAD func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { +======= +func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgentSpec) { +>>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) *out = *in out.Endpoint = in.Endpoint if in.Filters != nil { @@ -121,6 +125,21 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryAgentEndpoint) DeepCopyInto(out *TelemetryAgentEndpoint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryAgentEndpoint. +func (in *TelemetryAgentEndpoint) DeepCopy() *TelemetryAgentEndpoint { + if in == nil { + return nil + } + out := new(TelemetryAgentEndpoint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = *in @@ -141,7 +160,11 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { } if in.Cassandra != nil { in, out := &in.Cassandra, &out.Cassandra +<<<<<<< HEAD *out = new(CassandraAgentSpec) +======= + *out = new(CassandraTelemetryAgentSpec) +>>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) (*in).DeepCopyInto(*out) } } From 9af9e72ea2b6a03b5db6929bb850c678d6a540fa Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Mon, 23 Jan 2023 13:54:52 +1100 Subject: [PATCH 32/36] Make type names more concise. --- apis/telemetry/v1alpha1/telemetry_types.go | 18 ++++-------------- .../v1alpha1/zz_generated.deepcopy.go | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index 54a4a5833..a935ec012 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -9,10 +9,10 @@ import ( ) type TelemetrySpec struct { - Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` - Mcac *McacTelemetrySpec `json:"mcac,omitempty"` - Vector *VectorSpec `json:"vector,omitempty"` - Cassandra *CassandraTelemetryAgentSpec `json:"cassandra,omitempty"` + Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` + Mcac *McacTelemetrySpec `json:"mcac,omitempty"` + Vector *VectorSpec `json:"vector,omitempty"` + Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` } type PrometheusTelemetrySpec struct { @@ -138,13 +138,3 @@ type Endpoint struct { Address string `json:"address,omitempty"` Port string `json:"port,omitempty"` } - -type CassandraTelemetryAgentSpec struct { - Endpoint TelemetryAgentEndpoint `json:"endpoint,omitempty"` - Filters promapi.RelabelConfig `json:"filters,omitempty"` -} - -type TelemetryAgentEndpoint struct { - Address string `json:"address,omitempty"` - Port string `json:"port,omitempty"` -} diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index 7f54566f9..4f230998c 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -29,10 +29,14 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. <<<<<<< HEAD +<<<<<<< HEAD func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { ======= func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgentSpec) { >>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) +======= +func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { +>>>>>>> bf063e5 (Make type names more concise.) *out = *in out.Endpoint = in.Endpoint if in.Filters != nil { @@ -50,6 +54,7 @@ func (in *CassandraAgentSpec) DeepCopy() *CassandraAgentSpec { return nil } out := new(CassandraAgentSpec) +<<<<<<< HEAD in.DeepCopyInto(out) return out } @@ -65,6 +70,8 @@ func (in *Endpoint) DeepCopy() *Endpoint { return nil } out := new(Endpoint) +======= +>>>>>>> bf063e5 (Make type names more concise.) in.DeepCopyInto(out) return out } @@ -126,16 +133,16 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TelemetryAgentEndpoint) DeepCopyInto(out *TelemetryAgentEndpoint) { +func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryAgentEndpoint. -func (in *TelemetryAgentEndpoint) DeepCopy() *TelemetryAgentEndpoint { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. +func (in *Endpoint) DeepCopy() *Endpoint { if in == nil { return nil } - out := new(TelemetryAgentEndpoint) + out := new(Endpoint) in.DeepCopyInto(out) return out } @@ -160,11 +167,15 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { } if in.Cassandra != nil { in, out := &in.Cassandra, &out.Cassandra +<<<<<<< HEAD <<<<<<< HEAD *out = new(CassandraAgentSpec) ======= *out = new(CassandraTelemetryAgentSpec) >>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) +======= + *out = new(CassandraAgentSpec) +>>>>>>> bf063e5 (Make type names more concise.) (*in).DeepCopyInto(*out) } } From e4d60f4e130fd496492cafbd11ad1b8c43c56cd5 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Fri, 27 Jan 2023 15:42:34 +1100 Subject: [PATCH 33/36] Changelog. --- .DS_Store | Bin 0 -> 8196 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..aaeec1834402690b0b75037a1882a79bbf632152 GIT binary patch literal 8196 zcmeHMU2GIp6u#fIw0EW;)7nCDvvi?guoPO`3RXb3KY+-8f9Mb3GTRwoWI9uKW_N+w zq%Rr+L=z1fe_k=72@fV39(?d8F+S*nq!RVP#Gr}B#1|iY@WpfI&Jvf>N5q7=$-U>E zbI-YV&YADb?3rbZp*L?n%vd91j8hj>uc6^KO{|MPuPKqFk|@ZYF*95Ar?QThou?ZM z;t0eMh$9e3AdWyBf&WJY=$$PZU*NqjSK~2`KpcU4G6LfHkfJVVI-;|ZhK~*!!V-X} zC;`GobE*SEn^Z*85uKGZG^IUd^?=9}QHcR*PU|V5PBb0SSxKcigEVJ|PDWIrAUvJy zQlUCSTGDuoBM?Vmegs7NEMi%fXEt-n>i4VJDaZDM_V(*gDk>LMRr6|I!;cQ0^ooOl z5#;?|BX?MEL!RekOLHT8$hL|Zy}r+L1H*Q$TxejM7O5N=v0c+E_Ii2O^h4W0xxiJf zX7tAC>8{RAt*Nf=%`>g3>F$npns4fwnNfK|bK91I%qeHm_0CBr5IqRkl3ScQU+$6P z7y9HEiHfR{N8gn^Qni}Ip%HCt)SmF%LHn$g(UHi?srrZfh)LJD z*E7Y2X1J1QO04Dlu#orVEE=U)TbF22b%PK26nagj!WTI?Qvdok@`IuPgF-;N*mv=ptNR0a@jhwZ=NLbUak#j=6kL2OKq!qExcGC{LT(me4F6y>h zunEX?FC?Bh=gsML@}`7ARdw-JTESMcF1D2&U}MZ=MRtK*WUsMH>_?J zj(y91U^m!r>`(SLDp7@MaMYp>^=QCqtVb(0pc}pD!*=YzZVX`7wd_l;=!uiMbEX-oPh zY9!7|(E2xILzI?bJ49)CV{e6*%pEN`Ofa@iFO))hwE!%i6WUEFEvYXepi6emT4JjR zo#H;Wwm5`dTAq(5c8n9 zATTep57<@q3HyqG`6EH{SN0be0dg^xVI@*%#u}`}Mzo^?o#?_gJb|7Nn0v4f2XGJr zI83n2;1~>orGrVhC=xiQLvX%;7jX{faRC?cI^MvWcq@eIdlF_hVYjOsc6h%Wc7?&5 z>v--7l9qs4ZV+>KJOUN+gho;SZ(sQP{~f=M_<%S9aRlyO1W?&O*xyU%FZ3i9wRVd7 zG3ufTy;(^^6B@#DoM>2%6TSI|A Date: Wed, 1 Feb 2023 14:11:47 +1100 Subject: [PATCH 34/36] Refactor telemetry types --- .../v1alpha1/k8ssandracluster_types.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 2 +- apis/telemetry/v1alpha1/telemetry_methods.go | 5 + apis/telemetry/v1alpha1/telemetry_types.go | 8 +- .../v1alpha1/zz_generated.deepcopy.go | 8 +- .../bases/k8ssandra.io_k8ssandraclusters.yaml | 169 + .../bases/reaper.k8ssandra.io_reapers.yaml | 4843 +++++------ .../stargate.k8ssandra.io_stargates.yaml | 7142 +++++++++-------- .../cassandra_telemetry_reconciler.go | 9 +- .../cassandra_telemetry_reconciler_test.go | 10 +- .../k8ssandracluster_controller_test.go | 8 +- controllers/k8ssandra/vector.go | 2 +- controllers/k8ssandra/vector_test.go | 16 +- .../cassandra_agent/cassandra_agent_config.go | 2 +- .../cassandra_agent_config_test.go | 2 +- pkg/telemetry/cassandra_metrics_filters.go | 2 +- .../cassandra_metrics_filters_test.go | 23 +- pkg/telemetry/test_objects.go | 7 +- pkg/telemetry/validation.go | 3 +- pkg/telemetry/vector.go | 4 +- pkg/telemetry/vector_test.go | 2 +- 21 files changed, 6599 insertions(+), 5670 deletions(-) diff --git a/apis/k8ssandra/v1alpha1/k8ssandracluster_types.go b/apis/k8ssandra/v1alpha1/k8ssandracluster_types.go index 3552585d4..20eb0399d 100644 --- a/apis/k8ssandra/v1alpha1/k8ssandracluster_types.go +++ b/apis/k8ssandra/v1alpha1/k8ssandracluster_types.go @@ -364,7 +364,7 @@ type DatacenterOptions struct { // If telemetry configurations are defined, telemetry resources will be deployed to integrate with // a user-provided monitoring solution (at present, only support for Prometheus is available). // +optional - Telemetry *telemetryapi.TelemetrySpec `json:"telemetry,omitempty"` + Telemetry *telemetryapi.CassandraTelemetrySpec `json:"telemetry,omitempty"` // CDC defines the desired state for CDC integrations. It can be used to feed mutation events from Cassandra into an Apache Pulsar cluster, // from where they can be expored to external systems. diff --git a/apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go b/apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go index 9199b4826..ee788d749 100644 --- a/apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go +++ b/apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go @@ -248,7 +248,7 @@ func (in *DatacenterOptions) DeepCopyInto(out *DatacenterOptions) { } if in.Telemetry != nil { in, out := &in.Telemetry, &out.Telemetry - *out = new(telemetryv1alpha1.TelemetrySpec) + *out = new(telemetryv1alpha1.CassandraTelemetrySpec) (*in).DeepCopyInto(*out) } if in.CDC != nil { diff --git a/apis/telemetry/v1alpha1/telemetry_methods.go b/apis/telemetry/v1alpha1/telemetry_methods.go index e11202a4f..7773a450d 100644 --- a/apis/telemetry/v1alpha1/telemetry_methods.go +++ b/apis/telemetry/v1alpha1/telemetry_methods.go @@ -7,6 +7,11 @@ func (in *TelemetrySpec) MergeWith(clusterTemplate *TelemetrySpec) *TelemetrySpe return goalesceutils.MergeCRs(clusterTemplate, in) } +// MergeWith merges the given cluster-level template into this (DC-level) template. +func (in *CassandraTelemetrySpec) MergeWith(clusterTemplate *CassandraTelemetrySpec) *CassandraTelemetrySpec { + return goalesceutils.MergeCRs(clusterTemplate, in) +} + func (in *TelemetrySpec) IsPrometheusEnabled() bool { return in != nil && in.Prometheus != nil && in.Prometheus.Enabled != nil && *in.Prometheus.Enabled } diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index a935ec012..f706f0ee4 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -10,9 +10,13 @@ import ( type TelemetrySpec struct { Prometheus *PrometheusTelemetrySpec `json:"prometheus,omitempty"` - Mcac *McacTelemetrySpec `json:"mcac,omitempty"` Vector *VectorSpec `json:"vector,omitempty"` - Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` +} + +type CassandraTelemetrySpec struct { + *TelemetrySpec `json:"inline"` + Mcac *McacTelemetrySpec `json:"mcac,omitempty"` + Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` } type PrometheusTelemetrySpec struct { diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index 4f230998c..a3580af63 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -155,16 +155,12 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = new(PrometheusTelemetrySpec) (*in).DeepCopyInto(*out) } - if in.Mcac != nil { - in, out := &in.Mcac, &out.Mcac - *out = new(McacTelemetrySpec) - (*in).DeepCopyInto(*out) - } if in.Vector != nil { in, out := &in.Vector, &out.Vector *out = new(VectorSpec) (*in).DeepCopyInto(*out) } +<<<<<<< HEAD if in.Cassandra != nil { in, out := &in.Cassandra, &out.Cassandra <<<<<<< HEAD @@ -178,6 +174,8 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { >>>>>>> bf063e5 (Make type names more concise.) (*in).DeepCopyInto(*out) } +======= +>>>>>>> a42670a (Refactor telemetry types) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetrySpec. diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index d0845b2ee..bf12e3b6a 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -12094,6 +12094,93 @@ spec: type: object type: array type: object + inline: + properties: + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: CommonLabels are applied to all + serviceMonitors created. + type: object + enabled: + description: Enable the creation of Prometheus + serviceMonitors for this resource (Cassandra + or Stargate). + type: boolean + type: object + vector: + properties: + config: + description: Config is the name of the configmap + containing custom sinks and transformers for + the Vector agent. The configmap must be in + the same namespace as the CassandraDatacenter + and contain a vector.toml entry with the Vector + configuration in toml format. The agent is + already configured with a "cassandra_metrics" + source that needs to be used as input for + the sinks. If not set, the default console + sink will be used. + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + enabled: + description: Enabled enables the Vector agent + for this resource (Cassandra, Reaper or Stargate). + Enabling the vector agent will inject a sidecar + container into the pod. + type: boolean + image: + description: Image is the name of the Vector + image to use. If not set, the default image + will be used. kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: Resources is the resource requirements + for the Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum + amount of compute resources allowed. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. + If Requests is omitted for a container, + it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + scrapeInterval: + description: ScrapeInterval is the interval + at which the Vector agent will scrape the + metrics endpoint. Use values like 30s, 1m, + 5m. kube:default=30s + type: string + type: object + type: object mcac: properties: enabled: @@ -16410,6 +16497,88 @@ spec: type: object type: array type: object + inline: + properties: + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + config: + description: Config is the name of the configmap containing + custom sinks and transformers for the Vector agent. + The configmap must be in the same namespace as the + CassandraDatacenter and contain a vector.toml entry + with the Vector configuration in toml format. The + agent is already configured with a "cassandra_metrics" + source that needs to be used as input for the sinks. + If not set, the default console sink will be used. + properties: + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + type: object + x-kubernetes-map-type: atomic + enabled: + description: Enabled enables the Vector agent for + this resource (Cassandra, Reaper or Stargate). Enabling + the vector agent will inject a sidecar container + into the pod. + type: boolean + image: + description: Image is the name of the Vector image + to use. If not set, the default image will be used. + kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: Resources is the resource requirements + for the Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + scrapeInterval: + description: ScrapeInterval is the interval at which + the Vector agent will scrape the metrics endpoint. + Use values like 30s, 1m, 5m. kube:default=30s + type: string + type: object + type: object mcac: properties: enabled: diff --git a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml index ffb8c9e5b..76126e07a 100644 --- a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml +++ b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml @@ -15,2367 +15,2658 @@ spec: singular: reaper scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.datacenterRef.name - name: DC - type: string - - jsonPath: .status.progress - name: Status - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Reaper is the Schema for the reapers API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ReaperSpec defines the desired state of Reaper - properties: - ServiceAccountName: - default: default - type: string - affinity: - description: Affinity applied to the Reaper pods. - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the - pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node matches - the corresponding matchExpressions; the node(s) with the - highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a no-op). - A null preferred scheduling term matches no objects (i.e. - is also a no-op). - properties: - preference: - description: A node selector term, associated with the - corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + - additionalPrinterColumns: + - jsonPath: .spec.datacenterRef.name + name: DC + type: string + - jsonPath: .status.progress + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Reaper is the Schema for the reapers API + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: ReaperSpec defines the desired state of Reaper + properties: + ServiceAccountName: + default: default + type: string + affinity: + description: Affinity applied to the Reaper pods. + properties: + nodeAffinity: + description: + Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: + An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: + A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the corresponding - nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to an update), the system may or may not try to - eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: A null or empty node selector term matches - no objects. The requirements of them are ANDed. The - TopologySelectorTerm type implements a subset of the - NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate - this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: + Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: + Required. A list of node selector terms. + The terms are ORed. + items: + description: + A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer + type: array + type: object + x-kubernetes-map-type: atomic + type: array required: - - podAffinityTerm - - weight + - nodeSelectorTerms type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to a pod label update), the system may or may - not try to eventually evict the pod from its node. When - there are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all terms - must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: + Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. - avoid putting this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the anti-affinity expressions specified - by this field, but it may choose a node that violates one - or more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + required: + - topologyKey + type: object + weight: + description: + weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: type: string - required: + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: - topologyKey - type: object - weight: - description: weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by - this field are not met at scheduling time, the pod will - not be scheduled onto the node. If the anti-affinity requirements - specified by this field cease to be met at some point during - pod execution (e.g. due to a pod label update), the system - may or may not try to eventually evict the pod from its - node. When there are multiple elements, the lists of nodes - corresponding to each podAffinityTerm are intersected, i.e. - all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + type: object + type: array + type: object + podAntiAffinity: + description: + Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: + required: + - topologyKey + type: object + weight: + description: + weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - autoScheduling: - description: Auto scheduling properties. When you enable the auto-schedule - feature, Reaper dynamically schedules repairs for all non-system - keyspaces in a cluster. A cluster's keyspaces are monitored and - any modifications (additions or removals) are detected. When a new - keyspace is created, a new repair schedule is created automatically - for that keyspace. Conversely, when a keyspace is removed, the corresponding - repair schedule is deleted. - properties: - enabled: - default: false - type: boolean - excludedClusters: - description: ExcludedClusters are the clusters that are to be - excluded from the repair schedule. - items: - type: string - type: array - excludedKeyspaces: - description: ExcludedKeyspaces are the keyspaces that are to be - excluded from the repair schedule. - items: - type: string - type: array - initialDelayPeriod: - default: PT15S - description: InitialDelay is the amount of delay time before the - schedule period starts. Must be a valid ISO-8601 duration string. - The default is "PT15S" (15 seconds). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - percentUnrepairedThreshold: - default: 10 - description: PercentUnrepairedThreshold is the percentage of unrepaired - data over which an incremental repair should be started. Only - relevant when using repair type INCREMENTAL. - maximum: 100 - minimum: 0 - type: integer - periodBetweenPolls: - default: PT10M - description: PeriodBetweenPolls is the interval time to wait before - checking whether to start a repair task. Must be a valid ISO-8601 - duration string. The default is "PT10M" (10 minutes). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - repairType: - default: AUTO - description: 'RepairType is the type of repair to create: - REGULAR - creates a regular repair (non-adaptive and non-incremental); - - ADAPTIVE creates an adaptive repair; adaptive repairs are - most suited for Cassandra 3. - INCREMENTAL creates an incremental - repair; incremental repairs should only be used with Cassandra - 4+. - AUTO chooses between ADAPTIVE and INCREMENTAL depending - on the Cassandra server version; ADAPTIVE for Cassandra 3 and - INCREMENTAL for Cassandra 4+.' - enum: - - REGULAR - - ADAPTIVE - - INCREMENTAL - - AUTO - type: string - scheduleSpreadPeriod: - default: PT6H - description: ScheduleSpreadPeriod is the time spacing between - each of the repair schedules that is to be carried out. Must - be a valid ISO-8601 duration string. The default is "PT6H" (6 - hours). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - timeBeforeFirstSchedule: - default: PT5M - description: TimeBeforeFirstSchedule is the grace period before - the first repair in the schedule is started. Must be a valid - ISO-8601 duration string. The default is "PT5M" (5 minutes). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - type: object - cassandraUserSecretRef: - description: 'Defines the username and password that Reaper will use - to authenticate CQL connections to Cassandra clusters. These credentials - will be automatically turned into CQL roles by cass-operator when - bootstrapping the datacenter, then passed to the Reaper instance, - so that it can authenticate against nodes in the datacenter using - CQL. If CQL authentication is not required, leave this field empty. - The secret must be in the same namespace as Reaper itself and must - contain two keys: "username" and "password".' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - clientEncryptionStores: - description: Client encryption stores which are used by Cassandra - and Reaper. - properties: - keystorePasswordSecretRef: - description: ref to the secret that contains the keystore password - if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: ref to the secret that contains the keystore and - optionally its password (which can also be specified through - the keystorePasswordSecretRef field) if keys are not specified, - "keystore" entry and a "keystore-password" entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: ref to the secret that contains the truststore password - if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" entry - will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: ref to the secret that contains the truststore and - optionally its password (which can also be specified through - the truststorePasswordSecretRef field) if keys are not specified - explicitly, "keystore" entry and a "keystore-password" entry - will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - containerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.2.1 - description: The image to use for the Reaper pod main container. The - default is "thelastpickle/cassandra-reaper:3.2.1". - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: 'The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - datacenterAvailability: - default: ALL - description: DatacenterAvailability indicates to Reaper its deployment - in relation to the target datacenter's network. For single-DC clusters, - the default (ALL) is fine. For multi-DC clusters, it is recommended - to use EACH, provided that there is one Reaper instance managing - each DC in the cluster; otherwise, if one single Reaper instance - is going to manage more than one DC in the cluster, use ALL. See - https://cassandra-reaper.io/docs/usage/multi_dc/. - enum: - - LOCAL - - ALL - - EACH - type: string - datacenterRef: - description: DatacenterRef is the reference of a CassandraDatacenter - resource that this Reaper instance should manage. It will also be - used as the backend for persisting Reaper's state. Reaper must be - able to access the JMX port (7199 by default) and the CQL port (9042 - by default) on this DC. - properties: - name: - description: The datacenter name. - type: string - namespace: - description: The datacenter namespace. If empty, the datacenter - will be assumed to reside in the same namespace as the Reaper - instance. - type: string - required: - - name - type: object - heapSize: - anyOf: - - type: integer - - type: string - default: 2Gi - description: HeapSize sets the JVM heap size to use for Reaper. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.2.1 - description: The image to use for the Reaper pod init container (that - performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.2.1". - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: 'The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - initContainerResources: - description: Init Container resources. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - initContainerSecurityContext: - description: InitContainerSecurityContext is the SecurityContext applied - to the Reaper init container, used to perform schema migrations. - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process - can gain more privileges than its parent process. This bool - directly controls if the no_new_privs flag will be set on the - container process. AllowPrivilegeEscalation is true always when - the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows.' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container - runtime. Note that this field cannot be set when spec.os.name - is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged - containers are essentially equivalent to root on the host. Defaults - to false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for - the containers. The default is DefaultProcMount which uses the - container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. - Default is false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence. Note that this field cannot be set when spec.os.name - is windows. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies to - the container. - type: string - role: - description: Role is a SELinux role label that applies to - the container. - type: string - type: - description: Type is a SELinux type label that applies to - the container. - type: string - user: - description: User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If - seccomp options are provided at both the pod & container level, - the container options override the pod options. Note that this - field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will - be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA - credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. - type: string - type: object - type: object - jmxUserSecretRef: - description: 'Deprecated: JMX security is now based on CQL roles. - Reaper will use cassandraUsefSecretRef for authentication, this - field is ignored.' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - keyspace: - default: reaper_db - description: The keyspace to use to store Reaper's state. Will default - to "reaper_db" if unspecified. Will be created if it does not exist, - and if this Reaper resource is managed by K8ssandra. - type: string - livenessProbe: - description: LivenessProbe sets the Reaper liveness probe. Leave nil - to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults - to HTTP. + required: + - topologyKey + type: object + type: array + type: object + type: object + autoScheduling: + description: + Auto scheduling properties. When you enable the auto-schedule + feature, Reaper dynamically schedules repairs for all non-system + keyspaces in a cluster. A cluster's keyspaces are monitored and + any modifications (additions or removals) are detected. When a new + keyspace is created, a new repair schedule is created automatically + for that keyspace. Conversely, when a keyspace is removed, the corresponding + repair schedule is deleted. + properties: + enabled: + default: false + type: boolean + excludedClusters: + description: + ExcludedClusters are the clusters that are to be + excluded from the repair schedule. + items: type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' + type: array + excludedKeyspaces: + description: + ExcludedKeyspaces are the keyspaces that are to be + excluded from the repair schedule. + items: type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - metadata: - description: labels and annotations for Reaper resources - properties: - annotations: - additionalProperties: + type: array + initialDelayPeriod: + default: PT15S + description: + InitialDelay is the amount of delay time before the + schedule period starts. Must be a valid ISO-8601 duration string. + The default is "PT15S" (15 seconds). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? type: string - type: object - commonLabels: - additionalProperties: + percentUnrepairedThreshold: + default: 10 + description: + PercentUnrepairedThreshold is the percentage of unrepaired + data over which an incremental repair should be started. Only + relevant when using repair type INCREMENTAL. + maximum: 100 + minimum: 0 + type: integer + periodBetweenPolls: + default: PT10M + description: + PeriodBetweenPolls is the interval time to wait before + checking whether to start a repair task. Must be a valid ISO-8601 + duration string. The default is "PT10M" (10 minutes). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? type: string - description: labels/annotations that will be applied to all components - created by the CRD - type: object - labels: - additionalProperties: + repairType: + default: AUTO + description: + "RepairType is the type of repair to create: - REGULAR + creates a regular repair (non-adaptive and non-incremental); + - ADAPTIVE creates an adaptive repair; adaptive repairs are + most suited for Cassandra 3. - INCREMENTAL creates an incremental + repair; incremental repairs should only be used with Cassandra + 4+. - AUTO chooses between ADAPTIVE and INCREMENTAL depending + on the Cassandra server version; ADAPTIVE for Cassandra 3 and + INCREMENTAL for Cassandra 4+." + enum: + - REGULAR + - ADAPTIVE + - INCREMENTAL + - AUTO type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: + scheduleSpreadPeriod: + default: PT6H + description: + ScheduleSpreadPeriod is the time spacing between + each of the repair schedules that is to be carried out. Must + be a valid ISO-8601 duration string. The default is "PT6H" (6 + hours). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + timeBeforeFirstSchedule: + default: PT5M + description: + TimeBeforeFirstSchedule is the grace period before + the first repair in the schedule is started. Must be a valid + ISO-8601 duration string. The default is "PT5M" (5 minutes). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + type: object + cassandraUserSecretRef: + description: + 'Defines the username and password that Reaper will use + to authenticate CQL connections to Cassandra clusters. These credentials + will be automatically turned into CQL roles by cass-operator when + bootstrapping the datacenter, then passed to the Reaper instance, + so that it can authenticate against nodes in the datacenter using + CQL. If CQL authentication is not required, leave this field empty. + The secret must be in the same namespace as Reaper itself and must + contain two keys: "username" and "password".' + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + clientEncryptionStores: + description: + Client encryption stores which are used by Cassandra + and Reaper. + properties: + keystorePasswordSecretRef: + description: + ref to the secret that contains the keystore password + if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. type: string - type: object - labels: - additionalProperties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - type: object - type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: + type: object + x-kubernetes-map-type: atomic + keystoreSecretRef: + description: + ref to the secret that contains the keystore and + optionally its password (which can also be specified through + the keystorePasswordSecretRef field) if keys are not specified, + "keystore" entry and a "keystore-password" entry will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. type: string - type: object - labels: - additionalProperties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - type: object - type: object - type: object - podSecurityContext: - description: PodSecurityContext contains a pod-level SecurityContext - to apply to Reaper pods. - properties: - fsGroup: - description: "A special supplemental group that applies to all - containers in a pod. Some volume types allow the Kubelet to - change the ownership of that volume to be owned by the pod: - \n 1. The owning GID will be the FSGroup 2. The setgid bit is - set (new files created in the volume will be owned by FSGroup) - 3. The permission bits are OR'd with rw-rw---- \n If unset, - the Kubelet will not modify the ownership and permissions of - any volume. Note that this field cannot be set when spec.os.name - is windows." - format: int64 - type: integer - fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of changing - ownership and permission of the volume before being exposed - inside Pod. This field will only apply to volume types which - support fsGroup based ownership(and permissions). It will have - no effect on ephemeral volume types such as: secret, configmaps - and emptydir. Valid values are "OnRootMismatch" and "Always". - If not specified, "Always" is used. Note that this field cannot - be set when spec.os.name is windows.' - type: string - runAsGroup: - description: The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in SecurityContext. If set - in both SecurityContext and PodSecurityContext, the value specified - in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in SecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this field cannot - be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to all containers. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies to - the container. - type: string - role: - description: Role is a SELinux role label that applies to - the container. - type: string - type: - description: Type is a SELinux type label that applies to - the container. - type: string - user: - description: User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by the containers in this - pod. Note that this field cannot be set when spec.os.name is - windows. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." - type: string - required: - - type - type: object - supplementalGroups: - description: A list of groups applied to the first process run - in each container, in addition to the container's primary GID. If - unspecified, no groups will be added to any container. Note - that this field cannot be set when spec.os.name is windows. - items: + type: object + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: + ref to the secret that contains the truststore password + if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" entry + will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: + ref to the secret that contains the truststore and + optionally its password (which can also be specified through + the truststorePasswordSecretRef field) if keys are not specified + explicitly, "keystore" entry and a "keystore-password" entry + will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef + type: object + containerImage: + default: + name: cassandra-reaper + repository: thelastpickle + tag: 3.2.1 + description: + The image to use for the Reaper pod main container. The + default is "thelastpickle/cassandra-reaper:3.2.1". + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: + The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: + "The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: + The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + datacenterAvailability: + default: ALL + description: + DatacenterAvailability indicates to Reaper its deployment + in relation to the target datacenter's network. For single-DC clusters, + the default (ALL) is fine. For multi-DC clusters, it is recommended + to use EACH, provided that there is one Reaper instance managing + each DC in the cluster; otherwise, if one single Reaper instance + is going to manage more than one DC in the cluster, use ALL. See + https://cassandra-reaper.io/docs/usage/multi_dc/. + enum: + - LOCAL + - ALL + - EACH + type: string + datacenterRef: + description: + DatacenterRef is the reference of a CassandraDatacenter + resource that this Reaper instance should manage. It will also be + used as the backend for persisting Reaper's state. Reaper must be + able to access the JMX port (7199 by default) and the CQL port (9042 + by default) on this DC. + properties: + name: + description: The datacenter name. + type: string + namespace: + description: + The datacenter namespace. If empty, the datacenter + will be assumed to reside in the same namespace as the Reaper + instance. + type: string + required: + - name + type: object + heapSize: + anyOf: + - type: integer + - type: string + default: 2Gi + description: HeapSize sets the JVM heap size to use for Reaper. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + initContainerImage: + default: + name: cassandra-reaper + repository: thelastpickle + tag: 3.2.1 + description: + The image to use for the Reaper pod init container (that + performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.2.1". + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: + The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: + "The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: + The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + initContainerResources: + description: Init Container resources. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + type: object + initContainerSecurityContext: + description: + InitContainerSecurityContext is the SecurityContext applied + to the Reaper init container, used to perform schema migrations. + properties: + allowPrivilegeEscalation: + description: + "AllowPrivilegeEscalation controls whether a process + can gain more privileges than its parent process. This bool + directly controls if the no_new_privs flag will be set on the + container process. AllowPrivilegeEscalation is true always when + the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when spec.os.name is windows." + type: boolean + capabilities: + description: + The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by the container + runtime. Note that this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities type + type: string + type: array + type: object + privileged: + description: + Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. Defaults + to false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: + procMount denotes the type of proc mount to use for + the containers. The default is DefaultProcMount which uses the + container runtime defaults for readonly paths and masked paths. + This requires the ProcMountType feature flag to be enabled. + Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: + Whether this container has a read-only root filesystem. + Default is false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + runAsGroup: + description: + The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. format: int64 type: integer - type: array - sysctls: - description: Sysctls hold a list of namespaced sysctls used for - the pod. Pods with unsupported sysctls (by the container runtime) - might fail to launch. Note that this field cannot be set when - spec.os.name is windows. - items: - description: Sysctl defines a kernel parameter to be set + runAsNonRoot: + description: + Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: + The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when spec.os.name + is windows. + format: int64 + type: integer + seLinuxOptions: + description: + The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. properties: - name: - description: Name of a property to set + level: + description: + Level is SELinux level label that applies to + the container. type: string - value: - description: Value of a property to set + role: + description: + Role is a SELinux role label that applies to + the container. + type: string + type: + description: + Type is a SELinux type label that applies to + the container. + type: string + user: + description: + User is a SELinux user label that applies to + the container. + type: string + type: object + seccompProfile: + description: + The seccomp options to use by this container. If + seccomp options are provided at both the pod & container level, + the container options override the pod options. Note that this + field cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: + localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". + type: string + type: + description: + "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." type: string required: - - name - - value + - type type: object - type: array - windowsOptions: - description: The Windows specific settings applied to all containers. - If unspecified, the options within a container's SecurityContext - will be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. + windowsOptions: + description: + The Windows specific settings applied to all containers. + If unspecified, the options from the PodSecurityContext will + be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: + GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: + GMSACredentialSpecName is the name of the GMSA + credential spec to use. + type: string + hostProcess: + description: + HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: + The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: string + type: object + type: object + jmxUserSecretRef: + description: + "Deprecated: JMX security is now based on CQL roles. + Reaper will use cassandraUsefSecretRef for authentication, this + field is ignored." + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + keyspace: + default: reaper_db + description: + The keyspace to use to store Reaper's state. Will default + to "reaper_db" if unspecified. Will be created if it does not exist, + and if this Reaper resource is managed by K8ssandra. + type: string + livenessProbe: + description: + LivenessProbe sets the Reaper liveness probe. Leave nil + to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: + Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: + "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: + Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: + HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + metadata: + description: labels and annotations for Reaper resources + properties: + annotations: + additionalProperties: type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA - credential spec to use. + type: object + commonLabels: + additionalProperties: type: string - hostProcess: - description: HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. + description: + labels/annotations that will be applied to all components + created by the CRD + type: object + labels: + additionalProperties: type: string - type: object - type: object - readinessProbe: - description: ReadinessProbe sets the Reaper readiness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + type: object + podSecurityContext: + description: + PodSecurityContext contains a pod-level SecurityContext + to apply to Reaper pods. + properties: + fsGroup: + description: + "A special supplemental group that applies to all + containers in a pod. Some volume types allow the Kubelet to + change the ownership of that volume to be owned by the pod: + \n 1. The owning GID will be the FSGroup 2. The setgid bit is + set (new files created in the volume will be owned by FSGroup) + 3. The permission bits are OR'd with rw-rw---- \n If unset, + the Kubelet will not modify the ownership and permissions of + any volume. Note that this field cannot be set when spec.os.name + is windows." + format: int64 + type: integer + fsGroupChangePolicy: + description: + 'fsGroupChangePolicy defines behavior of changing + ownership and permission of the volume before being exposed + inside Pod. This field will only apply to volume types which + support fsGroup based ownership(and permissions). It will have + no effect on ephemeral volume types such as: secret, configmaps + and emptydir. Valid values are "OnRootMismatch" and "Always". + If not specified, "Always" is used. Note that this field cannot + be set when spec.os.name is windows.' + type: string + runAsGroup: + description: + The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: + Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: boolean + runAsUser: + description: + The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. Note that this field cannot + be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: + The SELinux context to be applied to all containers. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. + properties: + level: + description: + Level is SELinux level label that applies to + the container. type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 + role: + description: + Role is a SELinux role label that applies to + the container. + type: string + type: + description: + Type is a SELinux type label that applies to + the container. + type: string + user: + description: + User is a SELinux user label that applies to + the container. + type: string + type: object + seccompProfile: + description: + The seccomp options to use by the containers in this + pod. Note that this field cannot be set when spec.os.name is + windows. + properties: + localhostProfile: + description: + localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". + type: string + type: + description: + "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." + type: string + required: + - type + type: object + supplementalGroups: + description: + A list of groups applied to the first process run + in each container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. Note + that this field cannot be set when spec.os.name is windows. + items: + format: int64 type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: + type: array + sysctls: + description: + Sysctls hold a list of namespaced sysctls used for + the pod. Pods with unsupported sysctls (by the container runtime) + might fail to launch. Note that this field cannot be set when + spec.os.name is windows. + items: + description: Sysctl defines a kernel parameter to be set + properties: + name: + description: Name of a property to set + type: string + value: + description: Value of a property to set + type: string + required: - name - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: + type: object + type: array + windowsOptions: + description: + The Windows specific settings applied to all containers. + If unspecified, the options within a container's SecurityContext + will be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: + GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: + GMSACredentialSpecName is the name of the GMSA + credential spec to use. + type: string + hostProcess: + description: + HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: + The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: string + type: object + type: object + readinessProbe: + description: + ReadinessProbe sets the Reaper readiness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: + Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: + "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: + Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: + HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + resources: + description: Main Container resources. + properties: + limits: + additionalProperties: anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults - to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' - type: string - port: + description: + "Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + requests: + additionalProperties: anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: Main Container resources. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - secretsProvider: - default: internal - description: SecretsProvider defines whether the secrets used for - credentials and certs will be backed by an external secret backend. - This moves the responsibility of generating and storing secrets - from the operators to the user and will rely on a mutating webhook - to inject the secrets into the necessary resources - enum: - - internal - - external - type: string - securityContext: - description: SecurityContext applied to the Reaper main container. - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process - can gain more privileges than its parent process. This bool - directly controls if the no_new_privs flag will be set on the - container process. AllowPrivilegeEscalation is true always when - the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows.' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container - runtime. Note that this field cannot be set when spec.os.name - is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: Run container in privileged mode. Processes in privileged - containers are essentially equivalent to root on the host. Defaults - to false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for - the containers. The default is DefaultProcMount which uses the - container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. - Default is false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence. Note that this field cannot be set when spec.os.name - is windows. - format: int64 - type: integer - seLinuxOptions: - description: The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies to - the container. - type: string - role: - description: Role is a SELinux role label that applies to - the container. - type: string - type: - description: Type is a SELinux type label that applies to - the container. - type: string - user: - description: User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: The seccomp options to use by this container. If - seccomp options are provided at both the pod & container level, - the container options override the pod options. Note that this - field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will - be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA - credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. - type: string - type: object - type: object - skipSchemaMigration: - default: false - description: Whether to skip schema migration. Schema migration is - done in an init container on every Reaper deployment and can slow - down Reaper's startup time. Besides, schema migration requires reading - data at QUORUM. It can be skipped if you know that the schema is - already up-to-date, or if you know upfront that QUORUM cannot be - achieved (for example, because a DC is down). - type: boolean - telemetry: - description: Telemetry defines the desired telemetry integrations - to deploy targeting the Reaper pods for all DCs in this cluster - (unless overriden by DC specific settings) - properties: - cassandra: - properties: - endpoint: - properties: - address: + description: + "Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + type: object + secretsProvider: + default: internal + description: + SecretsProvider defines whether the secrets used for + credentials and certs will be backed by an external secret backend. + This moves the responsibility of generating and storing secrets + from the operators to the user and will rely on a mutating webhook + to inject the secrets into the necessary resources + enum: + - internal + - external + type: string + securityContext: + description: SecurityContext applied to the Reaper main container. + properties: + allowPrivilegeEscalation: + description: + "AllowPrivilegeEscalation controls whether a process + can gain more privileges than its parent process. This bool + directly controls if the no_new_privs flag will be set on the + container process. AllowPrivilegeEscalation is true always when + the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when spec.os.name is windows." + type: boolean + capabilities: + description: + The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by the container + runtime. Note that this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities type type: string - port: + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities type type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic rewriting of - the label set, being applied to samples before ingestion. - It defines ``-section of Prometheus - configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' + type: array + type: object + privileged: + description: + Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. Defaults + to false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: + procMount denotes the type of proc mount to use for + the containers. The default is DefaultProcMount which uses the + container runtime defaults for readonly paths and masked paths. + This requires the ProcMountType feature flag to be enabled. + Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: + Whether this container has a read-only root filesystem. + Default is false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + runAsGroup: + description: + The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: + Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: + The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when spec.os.name + is windows. + format: int64 + type: integer + seLinuxOptions: + description: + The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. + properties: + level: + description: + Level is SELinux level label that applies to + the container. + type: string + role: + description: + Role is a SELinux role label that applies to + the container. + type: string + type: + description: + Type is a SELinux type label that applies to + the container. + type: string + user: + description: + User is a SELinux user label that applies to + the container. + type: string + type: object + seccompProfile: + description: + The seccomp options to use by this container. If + seccomp options are provided at both the pod & container level, + the container options override the pod options. Note that this + field cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: + localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". + type: string + type: + description: + "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." + type: string + required: + - type + type: object + windowsOptions: + description: + The Windows specific settings applied to all containers. + If unspecified, the options from the PodSecurityContext will + be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: + GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: + GMSACredentialSpecName is the name of the GMSA + credential spec to use. + type: string + hostProcess: + description: + HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: + The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: string + type: object + type: object + skipSchemaMigration: + default: false + description: + Whether to skip schema migration. Schema migration is + done in an init container on every Reaper deployment and can slow + down Reaper's startup time. Besides, schema migration requires reading + data at QUORUM. It can be skipped if you know that the schema is + already up-to-date, or if you know upfront that QUORUM cannot be + achieved (for example, because a DC is down). + type: boolean + telemetry: + description: + Telemetry defines the desired telemetry integrations + to deploy targeting the Reaper pods for all DCs in this cluster + (unless overriden by DC specific settings) + properties: + cassandra: + properties: + endpoint: properties: - action: - description: Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: Modulus to take of the hash of the source - label values. - format: int64 - type: integer - regex: - description: Regular expression against which the extracted - value is matched. Default is '(.*)' - type: string - replacement: - description: Replacement value against which a regex - replace is performed if the regular expression matches. - Regex capture groups are available. Default is '$1' + address: type: string - separator: - description: Separator placed between concatenated source - label values. default is ';'. + port: type: string - sourceLabels: - description: The source labels select values from existing - labels. Their content is concatenated using the configured - separator and matched against the configured regular - expression for the replace, keep, and drop actions. - items: + type: object + filters: + items: + description: + "RelabelConfig allows dynamic rewriting of + the label set, being applied to samples before ingestion. + It defines ``-section of Prometheus + configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" + properties: + action: + description: + Action to perform based on regex matching. + Default is 'replace' type: string + modulus: + description: + Modulus to take of the hash of the source + label values. + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. Default is '(.*)' + type: string + replacement: + description: + Replacement value against which a regex + replace is performed if the regular expression matches. + Regex capture groups are available. Default is '$1' + type: string + separator: + description: + Separator placed between concatenated source + label values. default is ';'. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + separator and matched against the configured regular + expression for the replace, keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: + Label to which the resulting value is written + in a replace action. It is mandatory for replace actions. + Regex capture groups are available. + type: string + type: object + type: array + type: object + mcac: + properties: + enabled: + description: + enabled sets whether MCAC (legacy metrics endpoint) + is enabled. This is considered true by default. + type: boolean + metricFilters: + description: + 'MetricFilters allows passing filters to MCAC + in order to reduce the amount of extracted metrics. Not + setting this field will result in the default filters being + used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" + - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" + - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" + - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" + - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" + - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" + - "allow:org.apache.cassandra.metrics.Table.Compaction" + - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" + - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" + - "allow:org.apache.cassandra.metrics.table.dropped_mutations" + Setting it to an empty list will result in all metrics being + extracted.' + items: + type: string + type: array + type: object + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: + CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: + Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: + properties: + sinks: + description: + Sinks is the list of sinks to use for the + Vector agent. + items: + properties: + config: + description: + Config is the configuration for the + sink. + type: string + inputs: + description: + Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: + Sources is the list of sources to use for + the Vector agent. + items: + properties: + config: + description: + Config is the configuration for the + source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: + Transforms is the list of transforms to use + for the Vector agent. + items: + properties: + config: + description: + Config is the configuration for the + transform. + type: string + inputs: + description: + Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object type: array - targetLabel: - description: Label to which the resulting value is written - in a replace action. It is mandatory for replace actions. - Regex capture groups are available. - type: string type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy metrics endpoint) - is enabled. This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters to MCAC - in order to reduce the amount of extracted metrics. Not - setting this field will result in the default filters being - used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics being - extracted.' - items: + enabled: + description: + Enabled enables the Vector agent for this resource + (Cassandra, Reaper or Stargate). Enabling the vector agent + will inject a sidecar container into the pod. + type: boolean + image: + description: + Image is the name of the Vector image to use. + If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" type: string - type: array - type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: Sinks is the list of sinks to use for the - Vector agent. - items: - properties: - config: - description: Config is the configuration for the - sink. - type: string - inputs: - description: Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: Sources is the list of sources to use for - the Vector agent. - items: - properties: - config: - description: Config is the configuration for the - source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type + resources: + description: + Resources is the resource requirements for the + Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - type: array - transforms: - description: Transforms is the list of transforms to use - for the Vector agent. - items: - properties: - config: - description: Config is the configuration for the - transform. - type: string - inputs: - description: Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount of + compute resources required. If Requests is omitted for + a container, it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined value. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - type: array - type: object - enabled: - description: Enabled enables the Vector agent for this resource - (Cassandra, Reaper or Stargate). Enabling the vector agent - will inject a sidecar container into the pod. - type: boolean - image: - description: Image is the name of the Vector image to use. - If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + type: object + scrapeInterval: + description: + ScrapeInterval is the interval at which the Vector + agent will scrape the metrics endpoint. Use values like + 30s, 1m, 5m. kube:default=30s + type: string + type: object + type: object + tolerations: + description: Tolerations applied to the Reaper pods. + items: + description: + The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: + Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. type: string - resources: - description: Resources is the resource requirements for the - Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - scrapeInterval: - description: ScrapeInterval is the interval at which the Vector - agent will scrape the metrics endpoint. Use values like - 30s, 1m, 5m. kube:default=30s + key: + description: + Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. + type: string + operator: + description: + Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod + can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: + TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever (do not + evict). Zero and negative values will be treated as 0 (evict + immediately) by the system. + format: int64 + type: integer + value: + description: + Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. type: string type: object - type: object - tolerations: - description: Tolerations applied to the Reaper pods. - items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty - means match all taint effects. When specified, allowed values - are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies - to. Empty means match all taint keys. If the key is empty, - operator must be Exists; this combination means to match all - values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the - value. Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod - can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time - the toleration (which must be of effect NoExecute, otherwise - this field is ignored) tolerates the taint. By default, it - is not set, which means tolerate the taint forever (do not - evict). Zero and negative values will be treated as 0 (evict - immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. - type: string - type: object - type: array - uiUserSecretRef: - description: Defines the secret which contains the username and password - for the Reaper UI and REST API authentication. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - required: - - datacenterRef - type: object - status: - description: ReaperStatus defines the observed state of Reaper - properties: - conditions: - items: + type: array + uiUserSecretRef: + description: + Defines the secret which contains the username and password + for the Reaper UI and REST API authentication. properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transited from one status to another. - format: date-time - type: string - status: - type: string - type: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - required: - - status - - type type: object - type: array - progress: - description: Progress is the progress of this Reaper object. - enum: - - Pending - - Deploying - - Configuring - - Running - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} + x-kubernetes-map-type: atomic + required: + - datacenterRef + type: object + status: + description: ReaperStatus defines the observed state of Reaper + properties: + conditions: + items: + properties: + lastTransitionTime: + description: + LastTransitionTime is the last time the condition + transited from one status to another. + format: date-time + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + type: array + progress: + description: Progress is the progress of this Reaper object. + enum: + - Pending + - Deploying + - Configuring + - Running + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml index e630a422e..1c6f2e8bf 100644 --- a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml +++ b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml @@ -15,1802 +15,696 @@ spec: singular: stargate scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.datacenterRef.name - name: DC - type: string - - jsonPath: .status.progress - name: Status - type: string - - jsonPath: .status.readyReplicasRatio - name: Ready - type: string - - jsonPath: .status.updatedReplicas - name: Up-to-date - type: integer - - jsonPath: .status.availableReplicas - name: Available - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Stargate is the Schema for the stargates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Specification of the desired behavior of this Stargate resource. - properties: - affinity: - description: Affinity is the affinity to apply to all the Stargate - pods. Leave nil to let the controller reuse the same affinity rules - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the - pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node matches - the corresponding matchExpressions; the node(s) with the - highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a no-op). - A null preferred scheduling term matches no objects (i.e. - is also a no-op). - properties: - preference: - description: A node selector term, associated with the - corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + - additionalPrinterColumns: + - jsonPath: .spec.datacenterRef.name + name: DC + type: string + - jsonPath: .status.progress + name: Status + type: string + - jsonPath: .status.readyReplicasRatio + name: Ready + type: string + - jsonPath: .status.updatedReplicas + name: Up-to-date + type: integer + - jsonPath: .status.availableReplicas + name: Available + type: integer + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Stargate is the Schema for the stargates API + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of this Stargate resource. + properties: + affinity: + description: + Affinity is the affinity to apply to all the Stargate + pods. Leave nil to let the controller reuse the same affinity rules + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + properties: + nodeAffinity: + description: + Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: + An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: + A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the corresponding - nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to an update), the system may or may not try to - eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: A null or empty node selector term matches - no objects. The requirements of them are ANDed. The - TopologySelectorTerm type implements a subset of the - NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate - this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: + Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: + Required. A list of node selector terms. + The terms are ORed. + items: + description: + A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + The label key that the selector + applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: + An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer + type: array + type: object + x-kubernetes-map-type: atomic + type: array required: - - podAffinityTerm - - weight + - nodeSelectorTerms type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to a pod label update), the system may or may - not try to eventually evict the pod from its node. When - there are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all terms - must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: + Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - required: - - key - - operator + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object type: object - type: array - matchLabels: - additionalProperties: + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. - avoid putting this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to - nodes that satisfy the anti-affinity expressions specified - by this field, but it may choose a node that violates one - or more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + required: + - topologyKey + type: object + weight: + description: + weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. + type: string + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: + type: array + required: - key - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: type: string - required: + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: - topologyKey - type: object - weight: - description: weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by - this field are not met at scheduling time, the pod will - not be scheduled onto the node. If the anti-affinity requirements - specified by this field cease to be met at some point during - pod execution (e.g. due to a pod label update), the system - may or may not try to eventually evict the pod from its - node. When there are multiple elements, the lists of nodes - corresponding to each podAffinityTerm are intersected, i.e. - all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. + type: object + type: array + type: object + podAntiAffinity: + description: + Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. properties: - key: - description: key is the label key that the - selector applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - allowStargateOnDataNodes: - default: false - description: 'AllowStargateOnDataNodes allows Stargate pods to be - scheduled on a worker node already hosting data pods for this datacenter. - The default is false, which means that Stargate pods will be scheduled - on separate worker nodes. Note: if the datacenter pods have HostNetwork:true, - then the Stargate pods will inherit of it, in which case it is possible - that Stargate nodes won''t be allowed to sit on data nodes even - if this property is set to true, because of port conflicts on the - same IP address.' - type: boolean - auth: - default: true - description: Whether to enable authentication for Stargate. The default - is true; it is highly recommended to always leave authentication - turned on, not only on Stargate nodes, but also on data nodes as - well. Note that Stargate REST APIs are currently only accessible - if authentication is enabled, and if the authenticator in use in - the whole cluster is PasswordAuthenticator. The usage of any other - authenticator will cause the REST API to become inaccessible, see - https://github.com/stargate/stargate/issues/792 for more. Stargate - CQL API however remains accessible even if authentication is disabled - in the cluster, or when a custom authenticator is being used. - type: boolean - authOptions: - description: Authentication options. - properties: - apiAuthMethod: - default: Table - description: 'The method to use for authenticating requests to - the Stargate APIs. Stargate currently has two authentication - / authorization methods: - Table: table-based; - JWT: JSON web - token (JWT)-based. The methods are mutually exclusive. The default - method is Table.' - enum: - - Table - - JWT - type: string - providerUrl: - description: Required when using JWT authentication method, ignored - otherwise. - type: string - tokenTtlSeconds: - description: The time-to-live in seconds of an API authentication - token. Valid only for the Table authentication method. By default, - the token persists for 30 minutes with a sliding window. Each - use of the token to authenticate resets the 30-minute window. - A token created and used after 29 minutes will authenticate - a request, but if 31 minutes passes before use, the token will - no longer exist. Default is 1800 seconds (30 minutes). - minimum: 1 - type: integer - type: object - cassandraConfigMapRef: - description: CassandraConfigMapRef is a reference to a ConfigMap that - holds Cassandra configuration. The map should have a key named cassandra_yaml. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - cassandraEncryption: - description: CassandraEncryption groups together encryption stores - that are passed to the Stargate pods, so that they can be mounted - as volumes. - properties: - clientEncryptionStores: - description: Client encryption stores which are used by Cassandra - and Reaper. - properties: - keystorePasswordSecretRef: - description: ref to the secret that contains the keystore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: ref to the secret that contains the keystore - and optionally its password (which can also be specified - through the keystorePasswordSecretRef field) if keys are - not specified, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: ref to the secret that contains the truststore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: ref to the secret that contains the truststore - and optionally its password (which can also be specified - through the truststorePasswordSecretRef field) if keys are - not specified explicitly, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - serverEncryptionStores: - description: Internode encryption stores which are used by Cassandra - and Stargate. - properties: - keystorePasswordSecretRef: - description: ref to the secret that contains the keystore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: ref to the secret that contains the keystore - and optionally its password (which can also be specified - through the keystorePasswordSecretRef field) if keys are - not specified, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: ref to the secret that contains the truststore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: ref to the secret that contains the truststore - and optionally its password (which can also be specified - through the truststorePasswordSecretRef field) if keys are - not specified explicitly, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - type: object - containerImage: - default: - repository: stargateio - tag: v1.0.67 - description: ContainerImage is the image characteristics to use for - Stargate containers. Leave nil to use a default image. - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: 'The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - datacenterRef: - description: DatacenterRef is the namespace-local reference of a CassandraDatacenter - resource where Stargate should be deployed. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - heapSize: - anyOf: - - type: integer - - type: string - default: 256Mi - description: 'HeapSize sets the JVM heap size to use for Stargate. - If no Resources are specified, this value will also be used to set - a default memory request and limit for the Stargate pods: these - will be set to HeapSize x2 and x4, respectively.' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - livenessProbe: - description: LivenessProbe sets the Stargate liveness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults - to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - metadata: - description: labels and annotations for Stargate resources - properties: - annotations: - additionalProperties: - type: string - type: object - commonLabels: - additionalProperties: - type: string - description: labels/annotations that will be applied to all components - created by the CRD - type: object - labels: - additionalProperties: - type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector is an optional map of label keys and values - to restrict the scheduling of Stargate nodes to workers with matching - labels. Leave nil to let the controller reuse the same node selectors - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector - type: object - racks: - description: Racks allow customizing Stargate characteristics for - specific racks in the datacenter. - items: - description: StargateRackTemplate defines custom rules for Stargate - pods in a given rack. These rules will be merged with rules defined - at datacenter level in a StargateDatacenterTemplate; rack-level - rules have precedence over datacenter-level ones. - properties: - affinity: - description: Affinity is the affinity to apply to all the Stargate - pods. Leave nil to let the controller reuse the same affinity - rules used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for - the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods - to nodes that satisfy the affinity expressions specified - by this field, but it may choose a node that violates - one or more of the expressions. The node that is most - preferred is the one with the greatest sum of weights, - i.e. for each node that meets all of the scheduling - requirements (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum by iterating - through the elements of this field and adding "weight" - to the sum if the node matches the corresponding matchExpressions; - the node(s) with the highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a - no-op). A null preferred scheduling term matches - no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated - with the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: The label key that the - selector applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: The label key that the - selector applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the - corresponding nodeSelectorTerm, in the range - 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to an - update), the system may or may not try to eventually - evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: A null or empty node selector term - matches no objects. The requirements of them - are ANDed. The TopologySelectorTerm type implements - a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: The label key that the - selector applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: The label key that the - selector applies to. - type: string - operator: - description: Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods - to nodes that satisfy the affinity expressions specified - by this field, but it may choose a node that violates - one or more of the expressions. The node that is most - preferred is the one with the greatest sum of weights, - i.e. for each node that meets all of the scheduling - requirements (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum by iterating - through the elements of this field and adding "weight" - to the sum if the node has pods which matches the - corresponding podAffinityTerm; the node(s) with the - highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of - namespaces that the term applies to. The - term is applied to the union of the namespaces - selected by this field and the ones listed - in the namespaces field. null selector and - null or empty namespaces list means "this - pod's namespace". An empty selector ({}) - matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static - list of namespace names that the term applies - to. The term is applied to the union of - the namespaces listed in this field and - the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector - means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose value - of the label with key topologyKey matches - that of any node on which any of the selected - pods is running. Empty topologyKey is not - allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the - corresponding podAffinityTerm, in the range - 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a - pod label update), the system may or may not try to - eventually evict the pod from its node. When there - are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all - terms must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or - not co-located (anti-affinity) with, where co-located - is defined as running on a node whose value of the - label with key matches that of any - node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that + description: + key is the label key that the selector applies to. type: string operator: - description: operator represents a key's + description: + operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array of string + description: + values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, @@ -1821,53 +715,60 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} + description: + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces + description: + A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. + description: + matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. + description: + A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that + description: + key is the label key that the selector applies to. type: string operator: - description: operator represents a key's + description: + operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array of string + description: + values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, @@ -1878,1695 +779,3232 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} + description: + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces + description: + namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces listed in this field and the ones selected by - namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) + description: + This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified - namespaces, where co-located is defined as running - on a node whose value of the label with key - topologyKey matches that of any node on which - any of the selected pods is running. Empty topologyKey - is not allowed. + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string required: - - topologyKey + - topologyKey type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, etc. - as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods - to nodes that satisfy the anti-affinity expressions - specified by this field, but it may choose a node - that violates one or more of the expressions. The - node that is most preferred is the one with the greatest - sum of weights, i.e. for each node that meets all - of the scheduling requirements (resource request, - requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements - of this field and adding "weight" to the sum if the - node has pods which matches the corresponding podAffinityTerm; - the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) + weight: + description: + weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of - namespaces that the term applies to. The - term is applied to the union of the namespaces - selected by this field and the ones listed - in the namespaces field. null selector and - null or empty namespaces list means "this - pod's namespace". An empty selector ({}) - matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static - list of namespace names that the term applies - to. The term is applied to the union of - the namespaces listed in this field and - the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector - means "this pod's namespace". - items: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. type: string - type: array - topologyKey: - description: This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose value - of the label with key topologyKey matches - that of any node on which any of the selected - pods is running. Empty topologyKey is not - allowed. - type: string - required: - - topologyKey + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. type: object - weight: - description: weight associated with matching the - corresponding podAffinityTerm, in the range - 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the anti-affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a - pod label update), the system may or may not try to - eventually evict the pod from its node. When there - are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all - terms must be satisfied. - items: - description: Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or - not co-located (anti-affinity) with, where co-located - is defined as running on a node whose value of the - label with key matches that of any - node on which a pod of the set of pods is running + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + matchExpressions: + description: + matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: + A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: + key is the label key that the + selector applies to. type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + operator: + description: + operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". - items: - type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object type: array - topologyKey: - description: This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified - namespaces, where co-located is defined as running - on a node whose value of the label with key - topologyKey matches that of any node on which - any of the selected pods is running. Empty topologyKey - is not allowed. - type: string - required: - - topologyKey + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object type: object - type: array - type: object - type: object - allowStargateOnDataNodes: - default: false - description: 'AllowStargateOnDataNodes allows Stargate pods - to be scheduled on a worker node already hosting data pods - for this datacenter. The default is false, which means that - Stargate pods will be scheduled on separate worker nodes. - Note: if the datacenter pods have HostNetwork:true, then the - Stargate pods will inherit of it, in which case it is possible - that Stargate nodes won''t be allowed to sit on data nodes - even if this property is set to true, because of port conflicts - on the same IP address.' - type: boolean - authOptions: - description: Authentication options. - properties: - apiAuthMethod: - default: Table - description: 'The method to use for authenticating requests - to the Stargate APIs. Stargate currently has two authentication - / authorization methods: - Table: table-based; - JWT: - JSON web token (JWT)-based. The methods are mutually exclusive. - The default method is Table.' - enum: - - Table - - JWT - type: string - providerUrl: - description: Required when using JWT authentication method, - ignored otherwise. - type: string - tokenTtlSeconds: - description: The time-to-live in seconds of an API authentication - token. Valid only for the Table authentication method. - By default, the token persists for 30 minutes with a sliding - window. Each use of the token to authenticate resets the - 30-minute window. A token created and used after 29 minutes - will authenticate a request, but if 31 minutes passes - before use, the token will no longer exist. Default is - 1800 seconds (30 minutes). - minimum: 1 - type: integer - type: object - cassandraConfigMapRef: - description: CassandraConfigMapRef is a reference to a ConfigMap - that holds Cassandra configuration. The map should have a - key named cassandra_yaml. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array type: object - x-kubernetes-map-type: atomic - containerImage: - default: - repository: stargateio - tag: v1.0.67 - description: ContainerImage is the image characteristics to - use for Stargate containers. Leave nil to use a default image. + type: object + allowStargateOnDataNodes: + default: false + description: + "AllowStargateOnDataNodes allows Stargate pods to be + scheduled on a worker node already hosting data pods for this datacenter. + The default is false, which means that Stargate pods will be scheduled + on separate worker nodes. Note: if the datacenter pods have HostNetwork:true, + then the Stargate pods will inherit of it, in which case it is possible + that Stargate nodes won't be allowed to sit on data nodes even + if this property is set to true, because of port conflicts on the + same IP address." + type: boolean + auth: + default: true + description: + Whether to enable authentication for Stargate. The default + is true; it is highly recommended to always leave authentication + turned on, not only on Stargate nodes, but also on data nodes as + well. Note that Stargate REST APIs are currently only accessible + if authentication is enabled, and if the authenticator in use in + the whole cluster is PasswordAuthenticator. The usage of any other + authenticator will cause the REST API to become inaccessible, see + https://github.com/stargate/stargate/issues/792 for more. Stargate + CQL API however remains accessible even if authentication is disabled + in the cluster, or when a custom authenticator is being used. + type: boolean + authOptions: + description: Authentication options. + properties: + apiAuthMethod: + default: Table + description: + "The method to use for authenticating requests to + the Stargate APIs. Stargate currently has two authentication + / authorization methods: - Table: table-based; - JWT: JSON web + token (JWT)-based. The methods are mutually exclusive. The default + method is Table." + enum: + - Table + - JWT + type: string + providerUrl: + description: + Required when using JWT authentication method, ignored + otherwise. + type: string + tokenTtlSeconds: + description: + The time-to-live in seconds of an API authentication + token. Valid only for the Table authentication method. By default, + the token persists for 30 minutes with a sliding window. Each + use of the token to authenticate resets the 30-minute window. + A token created and used after 29 minutes will authenticate + a request, but if 31 minutes passes before use, the token will + no longer exist. Default is 1800 seconds (30 minutes). + minimum: 1 + type: integer + type: object + cassandraConfigMapRef: + description: + CassandraConfigMapRef is a reference to a ConfigMap that + holds Cassandra configuration. The map should have a key named cassandra_yaml. + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + cassandraEncryption: + description: + CassandraEncryption groups together encryption stores + that are passed to the Stargate pods, so that they can be mounted + as volumes. + properties: + clientEncryptionStores: + description: + Client encryption stores which are used by Cassandra + and Reaper. properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: 'The secret to use when pulling the image from - private repositories. If specified, this secret will be - passed to individual puller implementations for them to - use. For example, in the case of Docker, only DockerConfig - type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + keystorePasswordSecretRef: + description: + ref to the secret that contains the keystore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string type: object x-kubernetes-map-type: atomic - registry: - default: docker.io - description: The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string + keystoreSecretRef: + description: + ref to the secret that contains the keystore + and optionally its password (which can also be specified + through the keystorePasswordSecretRef field) if keys are + not specified, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: + ref to the secret that contains the truststore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" + entry will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: + ref to the secret that contains the truststore + and optionally its password (which can also be specified + through the truststorePasswordSecretRef field) if keys are + not specified explicitly, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef type: object - heapSize: - anyOf: - - type: integer - - type: string - default: 256Mi - description: 'HeapSize sets the JVM heap size to use for Stargate. - If no Resources are specified, this value will also be used - to set a default memory request and limit for the Stargate - pods: these will be set to HeapSize x2 and x4, respectively.' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - livenessProbe: - description: LivenessProbe sets the Stargate liveness probe. - Leave nil to use defaults. + serverEncryptionStores: + description: + Internode encryption stores which are used by Cassandra + and Stargate. properties: - exec: - description: Exec specifies the action to take. + keystorePasswordSecretRef: + description: + ref to the secret that contains the keystore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used properties: - command: - description: Command is the command line to execute - inside the container, the working directory for the - command is root ('/') in the container's filesystem. - The command is simply exec'd, it is not run inside - a shell, so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is treated - as live/healthy and non-zero is unhealthy. - items: - type: string - type: array + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string type: object - failureThreshold: - description: Minimum consecutive failures for the probe - to be considered failed after having succeeded. Defaults - to 3. Minimum value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. + x-kubernetes-map-type: atomic + keystoreSecretRef: + description: + ref to the secret that contains the keystore + and optionally its password (which can also be specified + through the keystorePasswordSecretRef field) if keys are + not specified, "keystore" entry and a "keystore-password" + entry will be used properties: - port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to - place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - required: - - port type: object - httpGet: - description: HTTPGet specifies the http request to perform. + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: + ref to the secret that contains the truststore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" + entry will be used properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header - to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - required: - - port type: object - initialDelaySeconds: - description: 'Number of seconds after the container has - started before liveness probes are initiated. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe - to be considered successful after having failed. Defaults - to 1. Must be 1 for liveness and startup. Minimum value - is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP - port. + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: + ref to the secret that contains the truststore + and optionally its password (which can also be specified + through the truststorePasswordSecretRef field) if keys are + not specified explicitly, "keystore" entry and a "keystore-password" + entry will be used properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' + key: + description: + The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs - to terminate gracefully upon probe failure. The grace - period is the duration in seconds after the processes - running in the pod are sent a termination signal and the - time when the processes are forcibly halted with a kill - signal. Set this value longer than the expected cleanup - time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, - this value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. Minimum value - is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef + type: object + type: object + containerImage: + default: + repository: stargateio + tag: v1.0.67 + description: + ContainerImage is the image characteristics to use for + Stargate containers. Leave nil to use a default image. + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: + The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: + "The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: + The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + datacenterRef: + description: + DatacenterRef is the namespace-local reference of a CassandraDatacenter + resource where Stargate should be deployed. + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + heapSize: + anyOf: + - type: integer + - type: string + default: 256Mi + description: + "HeapSize sets the JVM heap size to use for Stargate. + If no Resources are specified, this value will also be used to set + a default memory request and limit for the Stargate pods: these + will be set to HeapSize x2 and x4, respectively." + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + livenessProbe: + description: + LivenessProbe sets the Stargate liveness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: + Port number of the gRPC service. Number must + be in the range 1 to 65535. format: int32 type: integer + service: + description: + "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port type: object - metadata: - description: labels and annotations for Stargate resources + httpGet: + description: HTTPGet specifies the http request to perform. properties: - annotations: - additionalProperties: - type: string - type: object - commonLabels: - additionalProperties: - type: string - description: labels/annotations that will be applied to - all components created by the CRD - type: object - labels: - additionalProperties: - type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: + host: + description: + Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: + HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name type: string - type: object - labels: - additionalProperties: + value: + description: The header field value type: string - type: object + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + metadata: + description: labels and annotations for Stargate resources + properties: + annotations: + additionalProperties: + type: string + type: object + commonLabels: + additionalProperties: + type: string + description: + labels/annotations that will be applied to all components + created by the CRD + type: object + labels: + additionalProperties: + type: string + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: + type: string type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: + labels: + additionalProperties: + type: string + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: + NodeSelector is an optional map of label keys and values + to restrict the scheduling of Stargate nodes to workers with matching + labels. Leave nil to let the controller reuse the same node selectors + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + type: object + racks: + description: + Racks allow customizing Stargate characteristics for + specific racks in the datacenter. + items: + description: + StargateRackTemplate defines custom rules for Stargate + pods in a given rack. These rules will be merged with rules defined + at datacenter level in a StargateDatacenterTemplate; rack-level + rules have precedence over datacenter-level ones. + properties: + affinity: + description: + Affinity is the affinity to apply to all the Stargate + pods. Leave nil to let the controller reuse the same affinity + rules used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + properties: + nodeAffinity: + description: + Describes node affinity scheduling rules for + the pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node matches the corresponding matchExpressions; + the node(s) with the highest sum are the most preferred. + items: + description: + An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a + no-op). A null preferred scheduling term matches + no objects (i.e. is also a no-op). + properties: + preference: + description: + A node selector term, associated + with the corresponding weight. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + The label key that the + selector applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: + An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + The label key that the + selector applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: + An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: + Weight associated with matching the + corresponding nodeSelectorTerm, in the range + 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to an + update), the system may or may not try to eventually + evict the pod from its node. + properties: + nodeSelectorTerms: + description: + Required. A list of node selector terms. + The terms are ORed. + items: + description: + A null or empty node selector term + matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements + a subset of the NodeSelectorTerm. + properties: + matchExpressions: + description: + A list of node selector requirements + by node's labels. + items: + description: + A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + The label key that the + selector applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: + An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: + A list of node selector requirements + by node's fields. + items: + description: + A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + The label key that the + selector applies to. + type: string + operator: + description: + Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: + An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: + Describes pod affinity scheduling rules (e.g. + co-locate this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node has pods which matches the + corresponding podAffinityTerm; the node(s) with the + highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: + key is the label key + that the selector applies to. + type: string + operator: + description: + operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of + namespaces that the term applies to. The + term is applied to the union of the namespaces + selected by this field and the ones listed + in the namespaces field. null selector and + null or empty namespaces list means "this + pod's namespace". An empty selector ({}) + matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: + key is the label key + that the selector applies to. + type: string + operator: + description: + operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static + list of namespace names that the term applies + to. The term is applied to the union of + the namespaces listed in this field and + the ones selected by namespaceSelector. + null or empty namespaces list and null namespaceSelector + means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose value + of the label with key topologyKey matches + that of any node on which any of the selected + pods is running. Empty topologyKey is not + allowed. + type: string + required: + - topologyKey + type: object + weight: + description: + weight associated with matching the + corresponding podAffinityTerm, in the range + 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to a + pod label update), the system may or may not try to + eventually evict the pod from its node. When there + are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: + Describes pod anti-affinity scheduling rules + (e.g. avoid putting this pod in the same node, zone, etc. + as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: + The scheduler will prefer to schedule pods + to nodes that satisfy the anti-affinity expressions + specified by this field, but it may choose a node + that violates one or more of the expressions. The + node that is most preferred is the one with the greatest + sum of weights, i.e. for each node that meets all + of the scheduling requirements (resource request, + requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if the + node has pods which matches the corresponding podAffinityTerm; + the node(s) with the highest sum are the most preferred. + items: + description: + The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: + Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: + key is the label key + that the selector applies to. + type: string + operator: + description: + operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of + namespaces that the term applies to. The + term is applied to the union of the namespaces + selected by this field and the ones listed + in the namespaces field. null selector and + null or empty namespaces list means "this + pod's namespace". An empty selector ({}) + matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: + key is the label key + that the selector applies to. + type: string + operator: + description: + operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: + values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static + list of namespace names that the term applies + to. The term is applied to the union of + the namespaces listed in this field and + the ones selected by namespaceSelector. + null or empty namespaces list and null namespaceSelector + means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose value + of the label with key topologyKey matches + that of any node on which any of the selected + pods is running. Empty topologyKey is not + allowed. + type: string + required: + - topologyKey + type: object + weight: + description: + weight associated with matching the + corresponding podAffinityTerm, in the range + 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: + If the anti-affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the anti-affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to a + pod label update), the system may or may not try to + eventually evict the pod from its node. When there + are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: + Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running + properties: + labelSelector: + description: + A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: + matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: + A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. + properties: + matchExpressions: + description: + matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: + A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: + key is the label key that + the selector applies to. + type: string + operator: + description: + operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: + values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: + namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". + items: + type: string + type: array + topologyKey: + description: + This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + allowStargateOnDataNodes: + default: false + description: + "AllowStargateOnDataNodes allows Stargate pods + to be scheduled on a worker node already hosting data pods + for this datacenter. The default is false, which means that + Stargate pods will be scheduled on separate worker nodes. + Note: if the datacenter pods have HostNetwork:true, then the + Stargate pods will inherit of it, in which case it is possible + that Stargate nodes won't be allowed to sit on data nodes + even if this property is set to true, because of port conflicts + on the same IP address." + type: boolean + authOptions: + description: Authentication options. + properties: + apiAuthMethod: + default: Table + description: + "The method to use for authenticating requests + to the Stargate APIs. Stargate currently has two authentication + / authorization methods: - Table: table-based; - JWT: + JSON web token (JWT)-based. The methods are mutually exclusive. + The default method is Table." + enum: + - Table + - JWT + type: string + providerUrl: + description: + Required when using JWT authentication method, + ignored otherwise. + type: string + tokenTtlSeconds: + description: + The time-to-live in seconds of an API authentication + token. Valid only for the Table authentication method. + By default, the token persists for 30 minutes with a sliding + window. Each use of the token to authenticate resets the + 30-minute window. A token created and used after 29 minutes + will authenticate a request, but if 31 minutes passes + before use, the token will no longer exist. Default is + 1800 seconds (30 minutes). + minimum: 1 + type: integer + type: object + cassandraConfigMapRef: + description: + CassandraConfigMapRef is a reference to a ConfigMap + that holds Cassandra configuration. The map should have a + key named cassandra_yaml. + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + type: object + x-kubernetes-map-type: atomic + containerImage: + default: + repository: stargateio + tag: v1.0.67 + description: + ContainerImage is the image characteristics to + use for Stargate containers. Leave nil to use a default image. + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: + The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: + "The secret to use when pulling the image from + private repositories. If specified, this secret will be + passed to individual puller implementations for them to + use. For example, in the case of Docker, only DockerConfig + type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" + properties: + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" type: string - type: object - labels: - additionalProperties: + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: + The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + heapSize: + anyOf: + - type: integer + - type: string + default: 256Mi + description: + "HeapSize sets the JVM heap size to use for Stargate. + If no Resources are specified, this value will also be used + to set a default memory request and limit for the Stargate + pods: these will be set to HeapSize x2 and x4, respectively." + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + livenessProbe: + description: + LivenessProbe sets the Stargate liveness probe. + Leave nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: + Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: + "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." type: string - type: object + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: + Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: + HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: + TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + metadata: + description: labels and annotations for Stargate resources + properties: + annotations: + additionalProperties: + type: string + type: object + commonLabels: + additionalProperties: + type: string + description: + labels/annotations that will be applied to + all components created by the CRD + type: object + labels: + additionalProperties: + type: string + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + type: object + name: + description: + Name is the rack name. It must correspond to an + existing rack name in the CassandraDatacenter resource where + Stargate is being deployed, otherwise it will be ignored. + minLength: 2 + type: string + nodeSelector: + additionalProperties: + type: string + description: + NodeSelector is an optional map of label keys and + values to restrict the scheduling of Stargate nodes to workers + with matching labels. Leave nil to let the controller reuse + the same node selectors used for data pods in this datacenter, + if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + type: object + readinessProbe: + description: + ReadinessProbe sets the Stargate readiness probe. + Leave nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: + Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: + "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: + Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: + HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: + TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + resources: + description: + Resources is the Kubernetes resource requests and + limits to apply, per Stargate pod. Leave nil to use defaults. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + type: object + secretsProvider: + default: internal + description: + SecretsProvider defines whether the secrets used + for credentials and certs will be backed by an external secret + backend. This moves the responsibility of generating and storing + secrets from the operators to the user and will rely on a + mutating webhook to inject the secrets into the necessary + resources + enum: + - internal + - external + type: string + serviceAccount: + default: default + description: + ServiceAccount is the service account name to use + for Stargate pods. + type: string + telemetry: + description: + Telemetry defines the desired telemetry integrations + to deploy targeting the Stargate pods for all DCs in this + cluster (unless overriden by DC specific settings) + properties: + cassandra: + properties: + endpoint: + properties: + address: + type: string + port: + type: string + type: object + filters: + items: + description: + "RelabelConfig allows dynamic rewriting + of the label set, being applied to samples before + ingestion. It defines ``-section + of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" + properties: + action: + description: + Action to perform based on regex + matching. Default is 'replace' + type: string + modulus: + description: + Modulus to take of the hash of the + source label values. + format: int64 + type: integer + regex: + description: + Regular expression against which + the extracted value is matched. Default is '(.*)' + type: string + replacement: + description: + Replacement value against which a + regex replace is performed if the regular expression + matches. Regex capture groups are available. + Default is '$1' + type: string + separator: + description: + Separator placed between concatenated + source label values. default is ';'. + type: string + sourceLabels: + description: + The source labels select values from + existing labels. Their content is concatenated + using the configured separator and matched against + the configured regular expression for the replace, + keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: + Label to which the resulting value + is written in a replace action. It is mandatory + for replace actions. Regex capture groups are + available. + type: string + type: object + type: array + type: object + mcac: + properties: + enabled: + description: + enabled sets whether MCAC (legacy metrics + endpoint) is enabled. This is considered true by default. + type: boolean + metricFilters: + description: + 'MetricFilters allows passing filters to + MCAC in order to reduce the amount of extracted metrics. + Not setting this field will result in the default + filters being used: - "deny:org.apache.cassandra.metrics.Table" + - "deny:org.apache.cassandra.metrics.table" - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" + - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" + - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" + - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" + - "allow:org.apache.cassandra.metrics.Table.Pending" + - "allow:org.apache.cassandra.metrics.Table.Memtable" + - "allow:org.apache.cassandra.metrics.Table.Compaction" + - "allow:org.apache.cassandra.metrics.table.read" + - "allow:org.apache.cassandra.metrics.table.write" + - "allow:org.apache.cassandra.metrics.table.range" + - "allow:org.apache.cassandra.metrics.table.coordinator" + - "allow:org.apache.cassandra.metrics.table.dropped_mutations" + Setting it to an empty list will result in all metrics + being extracted.' + items: + type: string + type: array + type: object + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: + CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: + Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: + properties: + sinks: + description: + Sinks is the list of sinks to use for + the Vector agent. + items: + properties: + config: + description: + Config is the configuration for + the sink. + type: string + inputs: + description: + Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: + Sources is the list of sources to use + for the Vector agent. + items: + properties: + config: + description: + Config is the configuration for + the source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: + Transforms is the list of transforms + to use for the Vector agent. + items: + properties: + config: + description: + Config is the configuration for + the transform. + type: string + inputs: + description: + Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object + type: array + type: object + enabled: + description: + Enabled enables the Vector agent for this + resource (Cassandra, Reaper or Stargate). Enabling + the vector agent will inject a sidecar container into + the pod. + type: boolean + image: + description: + Image is the name of the Vector image to + use. If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: + Resources is the resource requirements + for the Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: object + type: object + scrapeInterval: + description: + ScrapeInterval is the interval at which + the Vector agent will scrape the metrics endpoint. + Use values like 30s, 1m, 5m. kube:default=30s + type: string + type: object + type: object + tolerations: + description: + Tolerations are tolerations to apply to the Stargate + pods. Leave nil to let the controller reuse the same tolerations + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + description: + The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: + Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, + allowed values are NoSchedule, PreferNoSchedule and + NoExecute. + type: string + key: + description: + Key is the taint key that the toleration + applies to. Empty means match all taint keys. If the + key is empty, operator must be Exists; this combination + means to match all values and all keys. + type: string + operator: + description: + Operator represents a key's relationship + to the value. Valid operators are Exists and Equal. + Defaults to Equal. Exists is equivalent to wildcard + for value, so that a pod can tolerate all taints of + a particular category. + type: string + tolerationSeconds: + description: + TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the + taint forever (do not evict). Zero and negative values + will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: + Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string type: object + type: array + required: + - name + type: object + type: array + readinessProbe: + description: + ReadinessProbe sets the Stargate readiness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: + Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: + Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: + GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: + Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: + "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: + Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: + Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: + HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: + Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: + Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: + "Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + periodSeconds: + description: + How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: + Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: + "Optional: Host name to connect to, defaults + to the pod IP." + type: string + port: + anyOf: + - type: integer + - type: string + description: + Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: + Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: + "Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + format: int32 + type: integer + type: object + resources: + description: + Resources is the Kubernetes resource requests and limits + to apply, per Stargate pod. Leave nil to use defaults. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - name: - description: Name is the rack name. It must correspond to an - existing rack name in the CassandraDatacenter resource where - Stargate is being deployed, otherwise it will be ignored. - minLength: 2 - type: string - nodeSelector: + requests: additionalProperties: - type: string - description: NodeSelector is an optional map of label keys and - values to restrict the scheduling of Stargate nodes to workers - with matching labels. Leave nil to let the controller reuse - the same node selectors used for data pods in this datacenter, - if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - readinessProbe: - description: ReadinessProbe sets the Stargate readiness probe. - Leave nil to use defaults. + type: object + secretsProvider: + default: internal + description: + SecretsProvider defines whether the secrets used for + credentials and certs will be backed by an external secret backend. + This moves the responsibility of generating and storing secrets + from the operators to the user and will rely on a mutating webhook + to inject the secrets into the necessary resources + enum: + - internal + - external + type: string + serviceAccount: + default: default + description: + ServiceAccount is the service account name to use for + Stargate pods. + type: string + size: + default: 1 + description: + Size is the number of Stargate instances to deploy in + each datacenter. They will be spread evenly across racks. + format: int32 + minimum: 1 + type: integer + telemetry: + description: + Telemetry defines the desired telemetry integrations + to deploy targeting the Stargate pods for all DCs in this cluster + (unless overriden by DC specific settings) + properties: + cassandra: properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute - inside the container, the working directory for the - command is root ('/') in the container's filesystem. - The command is simply exec'd, it is not run inside - a shell, so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is treated - as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe - to be considered failed after having succeeded. Defaults - to 3. Minimum value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. + endpoint: properties: + address: + type: string port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to - place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." type: string - required: - - port type: object - httpGet: - description: HTTPGet specifies the http request to perform. + filters: + items: + description: + "RelabelConfig allows dynamic rewriting of + the label set, being applied to samples before ingestion. + It defines ``-section of Prometheus + configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" + properties: + action: + description: + Action to perform based on regex matching. + Default is 'replace' + type: string + modulus: + description: + Modulus to take of the hash of the source + label values. + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. Default is '(.*)' + type: string + replacement: + description: + Replacement value against which a regex + replace is performed if the regular expression matches. + Regex capture groups are available. Default is '$1' + type: string + separator: + description: + Separator placed between concatenated source + label values. default is ';'. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + separator and matched against the configured regular + expression for the replace, keep, and drop actions. + items: + type: string + type: array + targetLabel: + description: + Label to which the resulting value is written + in a replace action. It is mandatory for replace actions. + Regex capture groups are available. + type: string + type: object + type: array + type: object + mcac: + properties: + enabled: + description: + enabled sets whether MCAC (legacy metrics endpoint) + is enabled. This is considered true by default. + type: boolean + metricFilters: + description: + 'MetricFilters allows passing filters to MCAC + in order to reduce the amount of extracted metrics. Not + setting this field will result in the default filters being + used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" + - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" + - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" + - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" + - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" + - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" + - "allow:org.apache.cassandra.metrics.Table.Compaction" + - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" + - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" + - "allow:org.apache.cassandra.metrics.table.dropped_mutations" + Setting it to an empty list will result in all metrics being + extracted.' + items: + type: string + type: array + type: object + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: + CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: + Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + sinks: + description: + Sinks is the list of sinks to use for the + Vector agent. items: - description: HTTPHeader describes a custom header - to be used in HTTP probes properties: + config: + description: + Config is the configuration for the + sink. + type: string + inputs: + description: + Inputs is the list of inputs for the + transform. + items: + type: string + type: array name: - description: The header field name + description: Name is the name of the sink. type: string - value: - description: The header field value + type: + description: Type is the type of the sink. type: string required: - - name - - value + - name + - type type: object type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: 'Number of seconds after the container has - started before liveness probes are initiated. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe - to be considered successful after having failed. Defaults - to 1. Must be 1 for liveness and startup. Minimum value - is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP - port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs - to terminate gracefully upon probe failure. The grace - period is the duration in seconds after the processes - running in the pod are sent a termination signal and the - time when the processes are forcibly halted with a kill - signal. Set this value longer than the expected cleanup - time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, - this value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. Minimum value - is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: Resources is the Kubernetes resource requests and - limits to apply, per Stargate pod. Leave nil to use defaults. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - secretsProvider: - default: internal - description: SecretsProvider defines whether the secrets used - for credentials and certs will be backed by an external secret - backend. This moves the responsibility of generating and storing - secrets from the operators to the user and will rely on a - mutating webhook to inject the secrets into the necessary - resources - enum: - - internal - - external - type: string - serviceAccount: - default: default - description: ServiceAccount is the service account name to use - for Stargate pods. - type: string - telemetry: - description: Telemetry defines the desired telemetry integrations - to deploy targeting the Stargate pods for all DCs in this - cluster (unless overriden by DC specific settings) - properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: + sources: + description: + Sources is the list of sources to use for + the Vector agent. items: - description: 'RelabelConfig allows dynamic rewriting - of the label set, being applied to samples before - ingestion. It defines ``-section - of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' properties: - action: - description: Action to perform based on regex - matching. Default is 'replace' + config: + description: + Config is the configuration for the + source. type: string - modulus: - description: Modulus to take of the hash of the - source label values. - format: int64 - type: integer - regex: - description: Regular expression against which - the extracted value is matched. Default is '(.*)' + name: + description: Name is the name of the source. type: string - replacement: - description: Replacement value against which a - regex replace is performed if the regular expression - matches. Regex capture groups are available. - Default is '$1' + type: + description: Type is the type of the source. type: string - separator: - description: Separator placed between concatenated - source label values. default is ';'. + required: + - name + - type + type: object + type: array + transforms: + description: + Transforms is the list of transforms to use + for the Vector agent. + items: + properties: + config: + description: + Config is the configuration for the + transform. type: string - sourceLabels: - description: The source labels select values from - existing labels. Their content is concatenated - using the configured separator and matched against - the configured regular expression for the replace, - keep, and drop actions. + inputs: + description: + Inputs is the list of inputs for the + transform. items: type: string type: array - targetLabel: - description: Label to which the resulting value - is written in a replace action. It is mandatory - for replace actions. Regex capture groups are - available. + name: + description: Name is the name of the transform. type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type type: object type: array type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy metrics - endpoint) is enabled. This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters to - MCAC in order to reduce the amount of extracted metrics. - Not setting this field will result in the default - filters being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics - being extracted.' - items: - type: string - type: array - type: object - prometheus: + enabled: + description: + Enabled enables the Vector agent for this resource + (Cassandra, Reaper or Stargate). Enabling the vector agent + will inject a sidecar container into the pod. + type: boolean + image: + description: + Image is the name of the Vector image to use. + If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: + Resources is the resource requirements for the + Vector agent. properties: - commonLabels: + limits: additionalProperties: - type: string - description: CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: Sinks is the list of sinks to use for - the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the sink. - type: string - inputs: - description: Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: Sources is the list of sources to use - for the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object - type: array - transforms: - description: Transforms is the list of transforms - to use for the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the transform. - type: string - inputs: - description: Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object - type: array + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - enabled: - description: Enabled enables the Vector agent for this - resource (Cassandra, Reaper or Stargate). Enabling - the vector agent will inject a sidecar container into - the pod. - type: boolean - image: - description: Image is the name of the Vector image to - use. If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: Resources is the resource requirements - for the Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is - omitted for a container, it defaults to Limits - if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: + "Requests describes the minimum amount of + compute resources required. If Requests is omitted for + a container, it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined value. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - scrapeInterval: - description: ScrapeInterval is the interval at which - the Vector agent will scrape the metrics endpoint. - Use values like 30s, 1m, 5m. kube:default=30s - type: string type: object + scrapeInterval: + description: + ScrapeInterval is the interval at which the Vector + agent will scrape the metrics endpoint. Use values like + 30s, 1m, 5m. kube:default=30s + type: string type: object - tolerations: - description: Tolerations are tolerations to apply to the Stargate - pods. Leave nil to let the controller reuse the same tolerations - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . - properties: - effect: - description: Effect indicates the taint effect to match. - Empty means match all taint effects. When specified, - allowed values are NoSchedule, PreferNoSchedule and - NoExecute. - type: string - key: - description: Key is the taint key that the toleration - applies to. Empty means match all taint keys. If the - key is empty, operator must be Exists; this combination - means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship - to the value. Valid operators are Exists and Equal. - Defaults to Equal. Exists is equivalent to wildcard - for value, so that a pod can tolerate all taints of - a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of - time the toleration (which must be of effect NoExecute, - otherwise this field is ignored) tolerates the taint. - By default, it is not set, which means tolerate the - taint forever (do not evict). Zero and negative values - will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. - type: string - type: object - type: array - required: - - name type: object - type: array - readinessProbe: - description: ReadinessProbe sets the Stargate readiness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. + tolerations: + description: + Tolerations are tolerations to apply to the Stargate + pods. Leave nil to let the controller reuse the same tolerations + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + description: + The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." + effect: + description: + Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. + key: + description: + Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. + operator: + description: + Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod + can tolerate all taints of a particular category. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults - to HTTP. + tolerationSeconds: + description: + TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever (do not + evict). Zero and negative values will be treated as 0 (evict + immediately) by the system. + format: int64 + type: integer + value: + description: + Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. type: string - required: - - port type: object - initialDelaySeconds: - description: 'Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - periodSeconds: - description: How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. + type: array + required: + - datacenterRef + - size + type: object + status: + description: Most recently observed status of this Stargate resource. + properties: + availableReplicas: + description: + Total number of available pods targeted by the Stargate + deployment. Will be zero if the deployment has not been created + yet. + format: int32 + type: integer + conditions: + items: properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' + lastTransitionTime: + description: + LastTransitionTime is the last time the condition + transited from one status to another. + format: date-time type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: 'Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - format: int32 - type: integer - type: object - resources: - description: Resources is the Kubernetes resource requests and limits - to apply, per Stargate pod. Leave nil to use defaults. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - secretsProvider: - default: internal - description: SecretsProvider defines whether the secrets used for - credentials and certs will be backed by an external secret backend. - This moves the responsibility of generating and storing secrets - from the operators to the user and will rely on a mutating webhook - to inject the secrets into the necessary resources - enum: - - internal - - external - type: string - serviceAccount: - default: default - description: ServiceAccount is the service account name to use for - Stargate pods. - type: string - size: - default: 1 - description: Size is the number of Stargate instances to deploy in - each datacenter. They will be spread evenly across racks. - format: int32 - minimum: 1 - type: integer - telemetry: - description: Telemetry defines the desired telemetry integrations - to deploy targeting the Stargate pods for all DCs in this cluster - (unless overriden by DC specific settings) - properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic rewriting of - the label set, being applied to samples before ingestion. - It defines ``-section of Prometheus - configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' - properties: - action: - description: Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: Modulus to take of the hash of the source - label values. - format: int64 - type: integer - regex: - description: Regular expression against which the extracted - value is matched. Default is '(.*)' - type: string - replacement: - description: Replacement value against which a regex - replace is performed if the regular expression matches. - Regex capture groups are available. Default is '$1' - type: string - separator: - description: Separator placed between concatenated source - label values. default is ';'. - type: string - sourceLabels: - description: The source labels select values from existing - labels. Their content is concatenated using the configured - separator and matched against the configured regular - expression for the replace, keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: Label to which the resulting value is written - in a replace action. It is mandatory for replace actions. - Regex capture groups are available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy metrics endpoint) - is enabled. This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters to MCAC - in order to reduce the amount of extracted metrics. Not - setting this field will result in the default filters being - used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics being - extracted.' - items: - type: string - type: array - type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: Sinks is the list of sinks to use for the - Vector agent. - items: - properties: - config: - description: Config is the configuration for the - sink. - type: string - inputs: - description: Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: Sources is the list of sources to use for - the Vector agent. - items: - properties: - config: - description: Config is the configuration for the - source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object - type: array - transforms: - description: Transforms is the list of transforms to use - for the Vector agent. - items: - properties: - config: - description: Config is the configuration for the - transform. - type: string - inputs: - description: Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object - type: array - type: object - enabled: - description: Enabled enables the Vector agent for this resource - (Cassandra, Reaper or Stargate). Enabling the vector agent - will inject a sidecar container into the pod. - type: boolean - image: - description: Image is the name of the Vector image to use. - If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + status: type: string - resources: - description: Resources is the resource requirements for the - Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - scrapeInterval: - description: ScrapeInterval is the interval at which the Vector - agent will scrape the metrics endpoint. Use values like - 30s, 1m, 5m. kube:default=30s + type: type: string + required: + - status + - type type: object - type: object - tolerations: - description: Tolerations are tolerations to apply to the Stargate - pods. Leave nil to let the controller reuse the same tolerations - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty - means match all taint effects. When specified, allowed values - are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies - to. Empty means match all taint keys. If the key is empty, - operator must be Exists; this combination means to match all - values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the - value. Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod - can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time - the toleration (which must be of effect NoExecute, otherwise - this field is ignored) tolerates the taint. By default, it - is not set, which means tolerate the taint forever (do not - evict). Zero and negative values will be treated as 0 (evict - immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. - type: string - type: object - type: array - required: - - datacenterRef - - size - type: object - status: - description: Most recently observed status of this Stargate resource. - properties: - availableReplicas: - description: Total number of available pods targeted by the Stargate - deployment. Will be zero if the deployment has not been created - yet. - format: int32 - type: integer - conditions: - items: - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transited from one status to another. - format: date-time - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - deploymentRefs: - description: DeploymentRefs is the names of the Deployment objects - that were created for this Stargate object. - items: + type: array + deploymentRefs: + description: + DeploymentRefs is the names of the Deployment objects + that were created for this Stargate object. + items: + type: string + type: array + progress: + description: Progress is the progress of this Stargate object. + enum: + - Pending + - Deploying + - Running + type: string + readyReplicas: + description: + ReadyReplicas is the total number of ready pods targeted + by the Stargate deployment. Will be zero if the deployment has not + been created yet. + format: int32 + type: integer + readyReplicasRatio: + description: + ReadyReplicasRatio is a "X/Y" string representing the + ratio between ReadyReplicas and Replicas in the Stargate deployment. + pattern: \d+/\d+ + type: string + replicas: + description: + Total number of non-terminated pods targeted by the Stargate + deployment (their labels match the selector). Will be zero if the + deployment has not been created yet. + format: int32 + type: integer + serviceRef: + description: + ServiceRef is the name of the Service object that was + created for this Stargate object. type: string - type: array - progress: - description: Progress is the progress of this Stargate object. - enum: - - Pending - - Deploying - - Running - type: string - readyReplicas: - description: ReadyReplicas is the total number of ready pods targeted - by the Stargate deployment. Will be zero if the deployment has not - been created yet. - format: int32 - type: integer - readyReplicasRatio: - description: ReadyReplicasRatio is a "X/Y" string representing the - ratio between ReadyReplicas and Replicas in the Stargate deployment. - pattern: \d+/\d+ - type: string - replicas: - description: Total number of non-terminated pods targeted by the Stargate - deployment (their labels match the selector). Will be zero if the - deployment has not been created yet. - format: int32 - type: integer - serviceRef: - description: ServiceRef is the name of the Service object that was - created for this Stargate object. - type: string - updatedReplicas: - description: UpdatedReplicas is the total number of non-terminated - pods targeted by the Stargate deployment that have the desired template - spec. Will be zero if the deployment has not been created yet. - format: int32 - type: integer - required: - - availableReplicas - - readyReplicas - - replicas - - updatedReplicas - type: object - type: object - served: true - storage: true - subresources: - status: {} + updatedReplicas: + description: + UpdatedReplicas is the total number of non-terminated + pods targeted by the Stargate deployment that have the desired template + spec. Will be zero if the deployment has not been created yet. + format: int32 + type: integer + required: + - availableReplicas + - readyReplicas + - replicas + - updatedReplicas + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler.go b/controllers/k8ssandra/cassandra_telemetry_reconciler.go index 76096305d..f4c403123 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler.go @@ -47,7 +47,12 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( if err != nil { return result.Error(err) } - validConfig := telemetry.SpecIsValid(mergedSpec, promInstalled) + validConfig := false + if mergedSpec != nil && mergedSpec.TelemetrySpec != nil { + validConfig = telemetry.SpecIsValid(mergedSpec.TelemetrySpec, promInstalled) + } else { + validConfig = true + } if !validConfig { return result.Error(errors.New("telemetry spec was invalid for this cluster - is Prometheus installed if you have requested it")) } @@ -56,7 +61,7 @@ func (r *K8ssandraClusterReconciler) reconcileCassandraDCTelemetry( return result.Continue() } // Determine if we want a cleanup or a resource update. - if mergedSpec.IsPrometheusEnabled() { + if mergedSpec != nil && mergedSpec.TelemetrySpec != nil && mergedSpec.IsPrometheusEnabled() { logger.Info("Prometheus config found", "mergedSpec", mergedSpec) desiredSM, err := cfg.NewCassServiceMonitor(mergedSpec.IsMcacEnabled()) if err != nil { diff --git a/controllers/k8ssandra/cassandra_telemetry_reconciler_test.go b/controllers/k8ssandra/cassandra_telemetry_reconciler_test.go index abb3404a7..988ff5ed0 100644 --- a/controllers/k8ssandra/cassandra_telemetry_reconciler_test.go +++ b/controllers/k8ssandra/cassandra_telemetry_reconciler_test.go @@ -51,10 +51,12 @@ func Test_reconcileCassandraDCTelemetry_TracksNamespaces(t *testing.T) { Name: cassDC.Name, }, DatacenterOptions: k8ssandraapi.DatacenterOptions{ - Telemetry: &telemetryapi.TelemetrySpec{ - Prometheus: &telemetryapi.PrometheusTelemetrySpec{ - Enabled: pointer.Bool(true), - CommonLabels: map[string]string{"test-label": "test"}, + Telemetry: &telemetryapi.CassandraTelemetrySpec{ + TelemetrySpec: &telemetryapi.TelemetrySpec{ + Prometheus: &telemetryapi.PrometheusTelemetrySpec{ + Enabled: pointer.Bool(true), + CommonLabels: map[string]string{"test-label": "test"}, + }, }, }, }, diff --git a/controllers/k8ssandra/k8ssandracluster_controller_test.go b/controllers/k8ssandra/k8ssandracluster_controller_test.go index 65f153416..c24adc688 100644 --- a/controllers/k8ssandra/k8ssandracluster_controller_test.go +++ b/controllers/k8ssandra/k8ssandracluster_controller_test.go @@ -269,9 +269,11 @@ func createSingleDcCluster(t *testing.T, ctx context.Context, f *framework.Frame // Test that prometheus servicemonitor comes up when it is requested in the CassandraDatacenter. kcPatch := client.MergeFrom(kc.DeepCopy()) - kc.Spec.Cassandra.Datacenters[0].DatacenterOptions.Telemetry = &telemetryapi.TelemetrySpec{ - Prometheus: &telemetryapi.PrometheusTelemetrySpec{ - Enabled: pointer.Bool(true), + kc.Spec.Cassandra.Datacenters[0].DatacenterOptions.Telemetry = &telemetryapi.CassandraTelemetrySpec{ + TelemetrySpec: &telemetryapi.TelemetrySpec{ + Prometheus: &telemetryapi.PrometheusTelemetrySpec{ + Enabled: pointer.Bool(true), + }, }, } if err := f.Patch(ctx, kc, kcPatch, kcKey); err != nil { diff --git a/controllers/k8ssandra/vector.go b/controllers/k8ssandra/vector.go index ee3283edb..b21f8e063 100644 --- a/controllers/k8ssandra/vector.go +++ b/controllers/k8ssandra/vector.go @@ -29,7 +29,7 @@ func (r *K8ssandraClusterReconciler) reconcileVector( Namespace: namespace, Name: telemetry.VectorAgentConfigMapName(kc.SanitizedName(), dcConfig.Meta.Name), } - if kc.Spec.Cassandra.Telemetry.IsVectorEnabled() { + if kc.Spec.Cassandra.Telemetry != nil && kc.Spec.Cassandra.Telemetry.TelemetrySpec != nil && kc.Spec.Cassandra.Telemetry.IsVectorEnabled() { // Create the vector toml config content toml, err := telemetry.CreateCassandraVectorToml(kc.Spec.Cassandra.Telemetry, dcConfig.McacEnabled) if err != nil { diff --git a/controllers/k8ssandra/vector_test.go b/controllers/k8ssandra/vector_test.go index 138eae1d6..e1bd405ec 100644 --- a/controllers/k8ssandra/vector_test.go +++ b/controllers/k8ssandra/vector_test.go @@ -33,9 +33,11 @@ func createSingleDcClusterWithVector(t *testing.T, ctx context.Context, f *frame Spec: api.K8ssandraClusterSpec{ Cassandra: &api.CassandraClusterTemplate{ DatacenterOptions: api.DatacenterOptions{ - Telemetry: &telemetryapi.TelemetrySpec{ - Vector: &telemetryapi.VectorSpec{ - Enabled: pointer.Bool(true), + Telemetry: &telemetryapi.CassandraTelemetrySpec{ + TelemetrySpec: &telemetryapi.TelemetrySpec{ + Vector: &telemetryapi.VectorSpec{ + Enabled: pointer.Bool(true), + }, }, }, }, @@ -139,9 +141,11 @@ func createSingleDcClusterWithVector(t *testing.T, ctx context.Context, f *frame // Test that prometheus servicemonitor comes up when it is requested in the CassandraDatacenter. kcPatch := client.MergeFrom(kc.DeepCopy()) - kc.Spec.Cassandra.Datacenters[0].DatacenterOptions.Telemetry = &telemetryapi.TelemetrySpec{ - Prometheus: &telemetryapi.PrometheusTelemetrySpec{ - Enabled: pointer.Bool(true), + kc.Spec.Cassandra.Datacenters[0].DatacenterOptions.Telemetry = &telemetryapi.CassandraTelemetrySpec{ + TelemetrySpec: &telemetryapi.TelemetrySpec{ + Prometheus: &telemetryapi.PrometheusTelemetrySpec{ + Enabled: pointer.Bool(true), + }, }, } if err := f.Patch(ctx, kc, kcPatch, kcKey); err != nil { diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go index f2d2f37f8..8dc382b9c 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config.go @@ -31,7 +31,7 @@ var ( ) type Configurator struct { - TelemetrySpec telemetryapi.TelemetrySpec + TelemetrySpec telemetryapi.CassandraTelemetrySpec Kluster *k8ssandraapi.K8ssandraCluster Ctx context.Context RemoteClient client.Client diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 9ceb33f3a..790f85a60 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -21,7 +21,7 @@ import ( var ( testCluster k8ssandraapi.K8ssandraCluster = testutils.NewK8ssandraCluster("test-cluster", "test-namespace") Cfg Configurator = Configurator{ - TelemetrySpec: telemetry.NewTelemetrySpec(), + TelemetrySpec: telemetry.NewCassandraTelemetrySpec(), Kluster: &testCluster, Ctx: context.Background(), RemoteClient: testutils.NewFakeClientWRestMapper(), diff --git a/pkg/telemetry/cassandra_metrics_filters.go b/pkg/telemetry/cassandra_metrics_filters.go index 9b3e8f109..a475c114f 100644 --- a/pkg/telemetry/cassandra_metrics_filters.go +++ b/pkg/telemetry/cassandra_metrics_filters.go @@ -27,7 +27,7 @@ var ( // InjectCassandraTelemetryFilters adds MCAC filters to the cassandra container as an env variable. // If filter list is set to nil, the default filters are used, otherwise the provided filters are used. -func InjectCassandraTelemetryFilters(telemetrySpec *telemetry.TelemetrySpec, dcConfig *cassandra.DatacenterConfig) { +func InjectCassandraTelemetryFilters(telemetrySpec *telemetry.CassandraTelemetrySpec, dcConfig *cassandra.DatacenterConfig) { filtersEnvVar := v1.EnvVar{} if telemetrySpec == nil || telemetrySpec.Mcac == nil || telemetrySpec.Mcac.MetricFilters == nil { // Default filters are applied diff --git a/pkg/telemetry/cassandra_metrics_filters_test.go b/pkg/telemetry/cassandra_metrics_filters_test.go index d32082ca0..a8f27f7ab 100644 --- a/pkg/telemetry/cassandra_metrics_filters_test.go +++ b/pkg/telemetry/cassandra_metrics_filters_test.go @@ -1,10 +1,11 @@ package telemetry import ( - "k8s.io/utils/pointer" "strings" "testing" + "k8s.io/utils/pointer" + telemetry "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" "github.com/k8ssandra/k8ssandra-operator/pkg/cassandra" "github.com/stretchr/testify/assert" @@ -26,15 +27,17 @@ func Test_InjectCassandraTelemetryFilters(t *testing.T) { }, } - telemetrySpec := &telemetry.TelemetrySpec{ - Prometheus: &telemetry.PrometheusTelemetrySpec{ - Enabled: pointer.Bool(true), - }, + telemetrySpec := &telemetry.CassandraTelemetrySpec{ Mcac: &telemetry.McacTelemetrySpec{ MetricFilters: &[]string{ "deny:org.apache.cassandra.metrics.Table", "deny:org.apache.cassandra.metrics.table"}, }, + TelemetrySpec: &telemetry.TelemetrySpec{ + Prometheus: &telemetry.PrometheusTelemetrySpec{ + Enabled: pointer.Bool(true), + }, + }, } InjectCassandraTelemetryFilters(telemetrySpec, dcConfig) @@ -59,9 +62,11 @@ func Test_InjectCassandraTelemetryFiltersDefaults(t *testing.T) { }, } - telemetrySpec := &telemetry.TelemetrySpec{ - Prometheus: &telemetry.PrometheusTelemetrySpec{ - Enabled: pointer.Bool(true), + telemetrySpec := &telemetry.CassandraTelemetrySpec{ + TelemetrySpec: &telemetry.TelemetrySpec{ + Prometheus: &telemetry.PrometheusTelemetrySpec{ + Enabled: pointer.Bool(true), + }, }, } @@ -86,7 +91,7 @@ func Test_InjectCassandraTelemetryFilters_Empty(t *testing.T) { } // Test with an empty filters slice, which should result in an empty env variable to be injected - telemetrySpec := &telemetry.TelemetrySpec{ + telemetrySpec := &telemetry.CassandraTelemetrySpec{ Mcac: &telemetry.McacTelemetrySpec{ MetricFilters: &[]string{}, }, diff --git a/pkg/telemetry/test_objects.go b/pkg/telemetry/test_objects.go index 0ddb1083c..36298cfde 100644 --- a/pkg/telemetry/test_objects.go +++ b/pkg/telemetry/test_objects.go @@ -5,7 +5,12 @@ import ( ) func NewTelemetrySpec() telemetryapi.TelemetrySpec { - return telemetryapi.TelemetrySpec{ + return telemetryapi.TelemetrySpec{} + +} + +func NewCassandraTelemetrySpec() telemetryapi.CassandraTelemetrySpec { + return telemetryapi.CassandraTelemetrySpec{ Cassandra: &telemetryapi.CassandraAgentSpec{}, } diff --git a/pkg/telemetry/validation.go b/pkg/telemetry/validation.go index 88f98dee4..4f29280b4 100644 --- a/pkg/telemetry/validation.go +++ b/pkg/telemetry/validation.go @@ -2,11 +2,12 @@ package telemetry import ( "errors" + "reflect" + "github.com/go-logr/logr" telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "k8s.io/apimachinery/pkg/api/meta" - "reflect" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/telemetry/vector.go b/pkg/telemetry/vector.go index 9cea6eab2..363b14869 100644 --- a/pkg/telemetry/vector.go +++ b/pkg/telemetry/vector.go @@ -17,8 +17,8 @@ import ( // InjectCassandraVectorAgent adds the Vector agent container to the Cassandra pods. // If the Vector agent is already present, it is not added again. -func InjectCassandraVectorAgent(telemetrySpec *telemetry.TelemetrySpec, dcConfig *cassandra.DatacenterConfig, k8cName string, logger logr.Logger) error { - if telemetrySpec.IsVectorEnabled() { +func InjectCassandraVectorAgent(telemetrySpec *telemetry.CassandraTelemetrySpec, dcConfig *cassandra.DatacenterConfig, k8cName string, logger logr.Logger) error { + if telemetrySpec != nil && telemetrySpec.TelemetrySpec != nil && telemetrySpec.IsVectorEnabled() { logger.Info("Injecting Vector agent into Cassandra pods") vectorImage := vector.DefaultVectorImage if telemetrySpec.Vector.Image != "" { diff --git a/pkg/telemetry/vector_test.go b/pkg/telemetry/vector_test.go index 9da10f545..b6f164df7 100644 --- a/pkg/telemetry/vector_test.go +++ b/pkg/telemetry/vector_test.go @@ -18,7 +18,7 @@ import ( // InjectCassandraVectorAgent adds the Vector agent container to the Cassandra pods. // If the Vector agent is already present, it is not added again. func TestInjectCassandraVectorAgent(t *testing.T) { - telemetrySpec := &telemetry.TelemetrySpec{Vector: &telemetry.VectorSpec{Enabled: pointer.Bool(true)}} + telemetrySpec := &telemetry.CassandraTelemetrySpec{TelemetrySpec: &telemetry.TelemetrySpec{Vector: &telemetry.VectorSpec{Enabled: pointer.Bool(true)}}} dcConfig := &cassandra.DatacenterConfig{ PodTemplateSpec: corev1.PodTemplateSpec{}, } From ecfb3f5a02bcb6f75fe1110e3a8fa1ba6b20d858 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 1 Feb 2023 15:29:21 +1100 Subject: [PATCH 35/36] Fix issues in rebase. --- apis/telemetry/v1alpha1/telemetry_methods.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 30 + .../bases/k8ssandra.io_k8ssandraclusters.yaml | 873 +- .../bases/reaper.k8ssandra.io_reapers.yaml | 4769 +++++------ .../stargate.k8ssandra.io_stargates.yaml | 7090 ++++++++--------- .../k8ssandra/cassandra_metrics_agent_test.go | 8 +- controllers/k8ssandra/datacenters.go | 2 +- pkg/cassandra/datacenter_test.go | 2 +- .../cassandra_agent_config_test.go | 2 +- 9 files changed, 5663 insertions(+), 7115 deletions(-) diff --git a/apis/telemetry/v1alpha1/telemetry_methods.go b/apis/telemetry/v1alpha1/telemetry_methods.go index 7773a450d..432f9ff01 100644 --- a/apis/telemetry/v1alpha1/telemetry_methods.go +++ b/apis/telemetry/v1alpha1/telemetry_methods.go @@ -16,7 +16,7 @@ func (in *TelemetrySpec) IsPrometheusEnabled() bool { return in != nil && in.Prometheus != nil && in.Prometheus.Enabled != nil && *in.Prometheus.Enabled } -func (in *TelemetrySpec) IsMcacEnabled() bool { +func (in *CassandraTelemetrySpec) IsMcacEnabled() bool { return in == nil || in.Mcac == nil || in.Mcac.Enabled == nil || *in.Mcac.Enabled } diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index a3580af63..d393c2601 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -59,6 +59,36 @@ func (in *CassandraAgentSpec) DeepCopy() *CassandraAgentSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CassandraTelemetrySpec) DeepCopyInto(out *CassandraTelemetrySpec) { + *out = *in + if in.TelemetrySpec != nil { + in, out := &in.TelemetrySpec, &out.TelemetrySpec + *out = new(TelemetrySpec) + (*in).DeepCopyInto(*out) + } + if in.Mcac != nil { + in, out := &in.Mcac, &out.Mcac + *out = new(McacTelemetrySpec) + (*in).DeepCopyInto(*out) + } + if in.Cassandra != nil { + in, out := &in.Cassandra, &out.Cassandra + *out = new(CassandraAgentSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CassandraTelemetrySpec. +func (in *CassandraTelemetrySpec) DeepCopy() *CassandraTelemetrySpec { + if in == nil { + return nil + } + out := new(CassandraTelemetrySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index bf12e3b6a..f62852206 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -10801,104 +10801,6 @@ spec: pods for all DCs in this cluster (unless overriden by DC specific settings) properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic - rewriting of the label set, being - applied to samples before ingestion. - It defines ``-section - of Prometheus configuration. More - info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' - properties: - action: - description: Action to perform based - on regex matching. Default is - 'replace' - type: string - modulus: - description: Modulus to take of - the hash of the source label values. - format: int64 - type: integer - regex: - description: Regular expression - against which the extracted value - is matched. Default is '(.*)' - type: string - replacement: - description: Replacement value against - which a regex replace is performed - if the regular expression matches. - Regex capture groups are available. - Default is '$1' - type: string - separator: - description: Separator placed between - concatenated source label values. - default is ';'. - type: string - sourceLabels: - description: The source labels select - values from existing labels. Their - content is concatenated using - the configured separator and matched - against the configured regular - expression for the replace, keep, - and drop actions. - items: - type: string - type: array - targetLabel: - description: Label to which the - resulting value is written in - a replace action. It is mandatory - for replace actions. Regex capture - groups are available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC - (legacy metrics endpoint) is enabled. - This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing - filters to MCAC in order to reduce the - amount of extracted metrics. Not setting - this field will result in the default - filters being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result - in all metrics being extracted.' - items: - type: string - type: array - type: object prometheus: properties: commonLabels: @@ -11320,99 +11222,6 @@ spec: for all DCs in this cluster (unless overriden by DC specific settings) properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic - rewriting of the label set, being applied - to samples before ingestion. It defines - ``-section of Prometheus - configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' - properties: - action: - description: Action to perform based on - regex matching. Default is 'replace' - type: string - modulus: - description: Modulus to take of the hash - of the source label values. - format: int64 - type: integer - regex: - description: Regular expression against - which the extracted value is matched. - Default is '(.*)' - type: string - replacement: - description: Replacement value against - which a regex replace is performed if - the regular expression matches. Regex - capture groups are available. Default - is '$1' - type: string - separator: - description: Separator placed between - concatenated source label values. default - is ';'. - type: string - sourceLabels: - description: The source labels select - values from existing labels. Their content - is concatenated using the configured - separator and matched against the configured - regular expression for the replace, - keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: Label to which the resulting - value is written in a replace action. - It is mandatory for replace actions. - Regex capture groups are available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy - metrics endpoint) is enabled. This is considered - true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters - to MCAC in order to reduce the amount of extracted - metrics. Not setting this field will result - in the default filters being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in - all metrics being extracted.' - items: - type: string - type: array - type: object prometheus: properties: commonLabels: @@ -12112,26 +11921,87 @@ spec: type: object vector: properties: - config: - description: Config is the name of the configmap - containing custom sinks and transformers for - the Vector agent. The configmap must be in - the same namespace as the CassandraDatacenter - and contain a vector.toml entry with the Vector - configuration in toml format. The agent is - already configured with a "cassandra_metrics" - source that needs to be used as input for - the sinks. If not set, the default console - sink will be used. + components: properties: - name: - description: 'Name of the referent. More - info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string + sinks: + description: Sinks is the list of sinks + to use for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the sink. + type: string + inputs: + description: Inputs is the list of + inputs for the transform. + items: + type: string + type: array + name: + description: Name is the name of the + sink. + type: string + type: + description: Type is the type of the + sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: Sources is the list of sources + to use for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the source. + type: string + name: + description: Name is the name of the + source. + type: string + type: + description: Type is the type of the + source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: Transforms is the list of transforms + to use for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the transform. + type: string + inputs: + description: Inputs is the list of + inputs for the transform. + items: + type: string + type: array + name: + description: Name is the name of the + transform. + type: string + type: + description: Type is the type of the + transform. + type: string + required: + - name + - type + type: object + type: array type: object - x-kubernetes-map-type: atomic enabled: description: Enabled enables the Vector agent for this resource (Cassandra, Reaper or Stargate). @@ -12212,142 +12082,8 @@ spec: type: string type: array type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: Sinks is the list of sinks to use - for the Vector agent. - items: - properties: - config: - description: Config is the configuration - for the sink. - type: string - inputs: - description: Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: Sources is the list of sources - to use for the Vector agent. - items: - properties: - config: - description: Config is the configuration - for the source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object - type: array - transforms: - description: Transforms is the list of transforms - to use for the Vector agent. - items: - properties: - config: - description: Config is the configuration - for the transform. - type: string - inputs: - description: Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object - type: array - type: object - enabled: - description: Enabled enables the Vector agent for - this resource (Cassandra, Reaper or Stargate). - Enabling the vector agent will inject a sidecar - container into the pod. - type: boolean - image: - description: Image is the name of the Vector image - to use. If not set, the default image will be - used. kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: Resources is the resource requirements - for the Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum - amount of compute resources required. If Requests - is omitted for a container, it defaults to - Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - scrapeInterval: - description: ScrapeInterval is the interval at which - the Vector agent will scrape the metrics endpoint. - Use values like 30s, 1m, 5m. kube:default=30s - type: string - type: object + required: + - inline type: object tolerations: description: Tolerations applied to every Cassandra pod. @@ -16514,49 +16250,106 @@ spec: type: object vector: properties: - config: - description: Config is the name of the configmap containing - custom sinks and transformers for the Vector agent. - The configmap must be in the same namespace as the - CassandraDatacenter and contain a vector.toml entry - with the Vector configuration in toml format. The - agent is already configured with a "cassandra_metrics" - source that needs to be used as input for the sinks. - If not set, the default console sink will be used. - properties: - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' - type: string - type: object - x-kubernetes-map-type: atomic - enabled: - description: Enabled enables the Vector agent for - this resource (Cassandra, Reaper or Stargate). Enabling - the vector agent will inject a sidecar container - into the pod. - type: boolean - image: - description: Image is the name of the Vector image - to use. If not set, the default image will be used. - kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: Resources is the resource requirements - for the Vector agent. + components: properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object + sinks: + description: Sinks is the list of sinks to use + for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the sink. + type: string + inputs: + description: Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: Sources is the list of sources to + use for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: Transforms is the list of transforms + to use for the Vector agent. + items: + properties: + config: + description: Config is the configuration + for the transform. + type: string + inputs: + description: Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object + type: array + type: object + enabled: + description: Enabled enables the Vector agent for + this resource (Cassandra, Reaper or Stargate). Enabling + the vector agent will inject a sidecar container + into the pod. + type: boolean + image: + description: Image is the name of the Vector image + to use. If not set, the default image will be used. + kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: Resources is the resource requirements + for the Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object requests: additionalProperties: anyOf: @@ -16607,140 +16400,8 @@ spec: type: string type: array type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: Sinks is the list of sinks to use for - the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the sink. - type: string - inputs: - description: Inputs is the list of inputs for - the transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: Sources is the list of sources to use - for the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object - type: array - transforms: - description: Transforms is the list of transforms - to use for the Vector agent. - items: - properties: - config: - description: Config is the configuration for - the transform. - type: string - inputs: - description: Inputs is the list of inputs for - the transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object - type: array - type: object - enabled: - description: Enabled enables the Vector agent for this - resource (Cassandra, Reaper or Stargate). Enabling the - vector agent will inject a sidecar container into the - pod. - type: boolean - image: - description: Image is the name of the Vector image to - use. If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: Resources is the resource requirements for - the Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount - of compute resources required. If Requests is omitted - for a container, it defaults to Limits if that is - explicitly specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - scrapeInterval: - description: ScrapeInterval is the interval at which the - Vector agent will scrape the metrics endpoint. Use values - like 30s, 1m, 5m. kube:default=30s - type: string - type: object + required: + - inline type: object tolerations: description: Tolerations applied to every Cassandra pod. @@ -19199,91 +18860,6 @@ spec: to deploy targeting the Reaper pods for all DCs in this cluster (unless overriden by DC specific settings) properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic rewriting - of the label set, being applied to samples before - ingestion. It defines ``-section - of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' - properties: - action: - description: Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: Modulus to take of the hash of the - source label values. - format: int64 - type: integer - regex: - description: Regular expression against which the - extracted value is matched. Default is '(.*)' - type: string - replacement: - description: Replacement value against which a regex - replace is performed if the regular expression - matches. Regex capture groups are available. Default - is '$1' - type: string - separator: - description: Separator placed between concatenated - source label values. default is ';'. - type: string - sourceLabels: - description: The source labels select values from - existing labels. Their content is concatenated - using the configured separator and matched against - the configured regular expression for the replace, - keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: Label to which the resulting value - is written in a replace action. It is mandatory - for replace actions. Regex capture groups are - available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy metrics - endpoint) is enabled. This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters to - MCAC in order to reduce the amount of extracted metrics. - Not setting this field will result in the default filters - being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics - being extracted.' - items: - type: string - type: array - type: object prometheus: properties: commonLabels: @@ -20868,91 +20444,6 @@ spec: to deploy targeting the Stargate pods for all DCs in this cluster (unless overriden by DC specific settings) properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: 'RelabelConfig allows dynamic rewriting - of the label set, being applied to samples before - ingestion. It defines ``-section - of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' - properties: - action: - description: Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: Modulus to take of the hash of the - source label values. - format: int64 - type: integer - regex: - description: Regular expression against which the - extracted value is matched. Default is '(.*)' - type: string - replacement: - description: Replacement value against which a regex - replace is performed if the regular expression - matches. Regex capture groups are available. Default - is '$1' - type: string - separator: - description: Separator placed between concatenated - source label values. default is ';'. - type: string - sourceLabels: - description: The source labels select values from - existing labels. Their content is concatenated - using the configured separator and matched against - the configured regular expression for the replace, - keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: Label to which the resulting value - is written in a replace action. It is mandatory - for replace actions. Regex capture groups are - available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: enabled sets whether MCAC (legacy metrics - endpoint) is enabled. This is considered true by default. - type: boolean - metricFilters: - description: 'MetricFilters allows passing filters to - MCAC in order to reduce the amount of extracted metrics. - Not setting this field will result in the default filters - being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics - being extracted.' - items: - type: string - type: array - type: object prometheus: properties: commonLabels: diff --git a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml index 76126e07a..b3b700eb6 100644 --- a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml +++ b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml @@ -15,2658 +15,2287 @@ spec: singular: reaper scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.datacenterRef.name - name: DC - type: string - - jsonPath: .status.progress - name: Status - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Reaper is the Schema for the reapers API - properties: - apiVersion: - description: - "APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: - "Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - metadata: - type: object - spec: - description: ReaperSpec defines the desired state of Reaper - properties: - ServiceAccountName: - default: default - type: string - affinity: - description: Affinity applied to the Reaper pods. - properties: - nodeAffinity: - description: - Describes node affinity scheduling rules for the - pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node matches - the corresponding matchExpressions; the node(s) with the - highest sum are the most preferred. - items: - description: - An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a no-op). - A null preferred scheduling term matches no objects (i.e. - is also a no-op). - properties: - preference: - description: - A node selector term, associated with the - corresponding weight. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. + - additionalPrinterColumns: + - jsonPath: .spec.datacenterRef.name + name: DC + type: string + - jsonPath: .status.progress + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Reaper is the Schema for the reapers API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ReaperSpec defines the desired state of Reaper + properties: + ServiceAccountName: + default: default + type: string + affinity: + description: Affinity applied to the Reaper pods. + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: - Weight associated with matching the corresponding - nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to an update), the system may or may not try to - eventually evict the pod from its node. + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) properties: - nodeSelectorTerms: - description: - Required. A list of node selector terms. - The terms are ORed. - items: - description: - A null or empty node selector term matches - no objects. The requirements of them are ANDed. The - TopologySelectorTerm type implements a subset of the - NodeSelectorTerm. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string - type: array - required: + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. type: string - type: array - required: + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer required: - - nodeSelectorTerms + - podAffinityTerm + - weight type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: - Describes pod affinity scheduling rules (e.g. co-locate - this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. + type: array + matchLabels: + additionalProperties: type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to a pod label update), the system may or may - not try to eventually evict the pod from its node. When - there are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all terms - must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. type: string - type: array - required: + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. type: string - type: array - required: + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: + required: - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: - Describes pod anti-affinity scheduling rules (e.g. - avoid putting this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the anti-affinity expressions specified - by this field, but it may choose a node that violates one - or more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. + type: array + matchLabels: + additionalProperties: type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the anti-affinity requirements specified by - this field are not met at scheduling time, the pod will - not be scheduled onto the node. If the anti-affinity requirements - specified by this field cease to be met at some point during - pod execution (e.g. due to a pod label update), the system - may or may not try to eventually evict the pod from its - node. When there are multiple elements, the lists of nodes - corresponding to each podAffinityTerm are intersected, i.e. - all terms must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - autoScheduling: - description: - Auto scheduling properties. When you enable the auto-schedule - feature, Reaper dynamically schedules repairs for all non-system - keyspaces in a cluster. A cluster's keyspaces are monitored and - any modifications (additions or removals) are detected. When a new - keyspace is created, a new repair schedule is created automatically - for that keyspace. Conversely, when a keyspace is removed, the corresponding - repair schedule is deleted. - properties: - enabled: - default: false - type: boolean - excludedClusters: - description: - ExcludedClusters are the clusters that are to be - excluded from the repair schedule. - items: - type: string - type: array - excludedKeyspaces: - description: - ExcludedKeyspaces are the keyspaces that are to be - excluded from the repair schedule. - items: - type: string - type: array - initialDelayPeriod: - default: PT15S - description: - InitialDelay is the amount of delay time before the - schedule period starts. Must be a valid ISO-8601 duration string. - The default is "PT15S" (15 seconds). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - percentUnrepairedThreshold: - default: 10 - description: - PercentUnrepairedThreshold is the percentage of unrepaired - data over which an incremental repair should be started. Only - relevant when using repair type INCREMENTAL. - maximum: 100 - minimum: 0 - type: integer - periodBetweenPolls: - default: PT10M - description: - PeriodBetweenPolls is the interval time to wait before - checking whether to start a repair task. Must be a valid ISO-8601 - duration string. The default is "PT10M" (10 minutes). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - repairType: - default: AUTO - description: - "RepairType is the type of repair to create: - REGULAR - creates a regular repair (non-adaptive and non-incremental); - - ADAPTIVE creates an adaptive repair; adaptive repairs are - most suited for Cassandra 3. - INCREMENTAL creates an incremental - repair; incremental repairs should only be used with Cassandra - 4+. - AUTO chooses between ADAPTIVE and INCREMENTAL depending - on the Cassandra server version; ADAPTIVE for Cassandra 3 and - INCREMENTAL for Cassandra 4+." - enum: - - REGULAR - - ADAPTIVE - - INCREMENTAL - - AUTO - type: string - scheduleSpreadPeriod: - default: PT6H - description: - ScheduleSpreadPeriod is the time spacing between - each of the repair schedules that is to be carried out. Must - be a valid ISO-8601 duration string. The default is "PT6H" (6 - hours). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? - type: string - timeBeforeFirstSchedule: - default: PT5M - description: - TimeBeforeFirstSchedule is the grace period before - the first repair in the schedule is started. Must be a valid - ISO-8601 duration string. The default is "PT5M" (5 minutes). - pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + autoScheduling: + description: Auto scheduling properties. When you enable the auto-schedule + feature, Reaper dynamically schedules repairs for all non-system + keyspaces in a cluster. A cluster's keyspaces are monitored and + any modifications (additions or removals) are detected. When a new + keyspace is created, a new repair schedule is created automatically + for that keyspace. Conversely, when a keyspace is removed, the corresponding + repair schedule is deleted. + properties: + enabled: + default: false + type: boolean + excludedClusters: + description: ExcludedClusters are the clusters that are to be + excluded from the repair schedule. + items: type: string - type: object - cassandraUserSecretRef: - description: - 'Defines the username and password that Reaper will use - to authenticate CQL connections to Cassandra clusters. These credentials - will be automatically turned into CQL roles by cass-operator when - bootstrapping the datacenter, then passed to the Reaper instance, - so that it can authenticate against nodes in the datacenter using - CQL. If CQL authentication is not required, leave this field empty. - The secret must be in the same namespace as Reaper itself and must - contain two keys: "username" and "password".' - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" + type: array + excludedKeyspaces: + description: ExcludedKeyspaces are the keyspaces that are to be + excluded from the repair schedule. + items: type: string - type: object - x-kubernetes-map-type: atomic - clientEncryptionStores: - description: - Client encryption stores which are used by Cassandra - and Reaper. - properties: - keystorePasswordSecretRef: - description: - ref to the secret that contains the keystore password - if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" + type: array + initialDelayPeriod: + default: PT15S + description: InitialDelay is the amount of delay time before the + schedule period starts. Must be a valid ISO-8601 duration string. + The default is "PT15S" (15 seconds). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + percentUnrepairedThreshold: + default: 10 + description: PercentUnrepairedThreshold is the percentage of unrepaired + data over which an incremental repair should be started. Only + relevant when using repair type INCREMENTAL. + maximum: 100 + minimum: 0 + type: integer + periodBetweenPolls: + default: PT10M + description: PeriodBetweenPolls is the interval time to wait before + checking whether to start a repair task. Must be a valid ISO-8601 + duration string. The default is "PT10M" (10 minutes). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + repairType: + default: AUTO + description: 'RepairType is the type of repair to create: - REGULAR + creates a regular repair (non-adaptive and non-incremental); + - ADAPTIVE creates an adaptive repair; adaptive repairs are + most suited for Cassandra 3. - INCREMENTAL creates an incremental + repair; incremental repairs should only be used with Cassandra + 4+. - AUTO chooses between ADAPTIVE and INCREMENTAL depending + on the Cassandra server version; ADAPTIVE for Cassandra 3 and + INCREMENTAL for Cassandra 4+.' + enum: + - REGULAR + - ADAPTIVE + - INCREMENTAL + - AUTO + type: string + scheduleSpreadPeriod: + default: PT6H + description: ScheduleSpreadPeriod is the time spacing between + each of the repair schedules that is to be carried out. Must + be a valid ISO-8601 duration string. The default is "PT6H" (6 + hours). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + timeBeforeFirstSchedule: + default: PT5M + description: TimeBeforeFirstSchedule is the grace period before + the first repair in the schedule is started. Must be a valid + ISO-8601 duration string. The default is "PT5M" (5 minutes). + pattern: ([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)? + type: string + type: object + cassandraUserSecretRef: + description: 'Defines the username and password that Reaper will use + to authenticate CQL connections to Cassandra clusters. These credentials + will be automatically turned into CQL roles by cass-operator when + bootstrapping the datacenter, then passed to the Reaper instance, + so that it can authenticate against nodes in the datacenter using + CQL. If CQL authentication is not required, leave this field empty. + The secret must be in the same namespace as Reaper itself and must + contain two keys: "username" and "password".' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + clientEncryptionStores: + description: Client encryption stores which are used by Cassandra + and Reaper. + properties: + keystorePasswordSecretRef: + description: ref to the secret that contains the keystore password + if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + keystoreSecretRef: + description: ref to the secret that contains the keystore and + optionally its password (which can also be specified through + the keystorePasswordSecretRef field) if keys are not specified, + "keystore" entry and a "keystore-password" entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: ref to the secret that contains the truststore password + if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" entry + will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: ref to the secret that contains the truststore and + optionally its password (which can also be specified through + the truststorePasswordSecretRef field) if keys are not specified + explicitly, "keystore" entry and a "keystore-password" entry + will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef + type: object + containerImage: + default: + name: cassandra-reaper + repository: thelastpickle + tag: 3.2.1 + description: The image to use for the Reaper pod main container. The + default is "thelastpickle/cassandra-reaper:3.2.1". + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: 'The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + datacenterAvailability: + default: ALL + description: DatacenterAvailability indicates to Reaper its deployment + in relation to the target datacenter's network. For single-DC clusters, + the default (ALL) is fine. For multi-DC clusters, it is recommended + to use EACH, provided that there is one Reaper instance managing + each DC in the cluster; otherwise, if one single Reaper instance + is going to manage more than one DC in the cluster, use ALL. See + https://cassandra-reaper.io/docs/usage/multi_dc/. + enum: + - LOCAL + - ALL + - EACH + type: string + datacenterRef: + description: DatacenterRef is the reference of a CassandraDatacenter + resource that this Reaper instance should manage. It will also be + used as the backend for persisting Reaper's state. Reaper must be + able to access the JMX port (7199 by default) and the CQL port (9042 + by default) on this DC. + properties: + name: + description: The datacenter name. + type: string + namespace: + description: The datacenter namespace. If empty, the datacenter + will be assumed to reside in the same namespace as the Reaper + instance. + type: string + required: + - name + type: object + heapSize: + anyOf: + - type: integer + - type: string + default: 2Gi + description: HeapSize sets the JVM heap size to use for Reaper. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + initContainerImage: + default: + name: cassandra-reaper + repository: thelastpickle + tag: 3.2.1 + description: The image to use for the Reaper pod init container (that + performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.2.1". + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: 'The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + initContainerResources: + description: Init Container resources. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + initContainerSecurityContext: + description: InitContainerSecurityContext is the SecurityContext applied + to the Reaper init container, used to perform schema migrations. + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether a process + can gain more privileges than its parent process. This bool + directly controls if the no_new_privs flag will be set on the + container process. AllowPrivilegeEscalation is true always when + the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by the container + runtime. Note that this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities type type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: - ref to the secret that contains the keystore and - optionally its password (which can also be specified through - the keystorePasswordSecretRef field) if keys are not specified, - "keystore" entry and a "keystore-password" entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities type type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" + type: array + type: object + privileged: + description: Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. Defaults + to false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to use for + the containers. The default is DefaultProcMount which uses the + container runtime defaults for readonly paths and masked paths. + This requires the ProcMountType feature flag to be enabled. + Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root filesystem. + Default is false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when spec.os.name + is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. + properties: + level: + description: Level is SELinux level label that applies to + the container. + type: string + role: + description: Role is a SELinux role label that applies to + the container. + type: string + type: + description: Type is a SELinux type label that applies to + the container. + type: string + user: + description: User is a SELinux user label that applies to + the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use by this container. If + seccomp options are provided at both the pod & container level, + the container options override the pod options. Note that this + field cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings applied to all containers. + If unspecified, the options from the PodSecurityContext will + be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA + credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: string + type: object + type: object + jmxUserSecretRef: + description: 'Deprecated: JMX security is now based on CQL roles. + Reaper will use cassandraUsefSecretRef for authentication, this + field is ignored.' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + keyspace: + default: reaper_db + description: The keyspace to use to store Reaper's state. Will default + to "reaper_db" if unspecified. Will be created if it does not exist, + and if this Reaper resource is managed by K8ssandra. + type: string + livenessProbe: + description: LivenessProbe sets the Reaper liveness probe. Leave nil + to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: - ref to the secret that contains the truststore password - if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" entry - will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + metadata: + description: labels and annotations for Reaper resources + properties: + annotations: + additionalProperties: + type: string + type: object + commonLabels: + additionalProperties: + type: string + description: labels/annotations that will be applied to all components + created by the CRD + type: object + labels: + additionalProperties: + type: string + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" + type: object + labels: + additionalProperties: type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: - ref to the secret that contains the truststore and - optionally its password (which can also be specified through - the truststorePasswordSecretRef field) if keys are not specified - explicitly, "keystore" entry and a "keystore-password" entry - will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" + type: object + labels: + additionalProperties: type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - containerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.2.1 - description: - The image to use for the Reaper pod main container. The - default is "thelastpickle/cassandra-reaper:3.2.1". - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: - The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: - "The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: - The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - datacenterAvailability: - default: ALL - description: - DatacenterAvailability indicates to Reaper its deployment - in relation to the target datacenter's network. For single-DC clusters, - the default (ALL) is fine. For multi-DC clusters, it is recommended - to use EACH, provided that there is one Reaper instance managing - each DC in the cluster; otherwise, if one single Reaper instance - is going to manage more than one DC in the cluster, use ALL. See - https://cassandra-reaper.io/docs/usage/multi_dc/. - enum: - - LOCAL - - ALL - - EACH - type: string - datacenterRef: - description: - DatacenterRef is the reference of a CassandraDatacenter - resource that this Reaper instance should manage. It will also be - used as the backend for persisting Reaper's state. Reaper must be - able to access the JMX port (7199 by default) and the CQL port (9042 - by default) on this DC. - properties: - name: - description: The datacenter name. - type: string - namespace: - description: - The datacenter namespace. If empty, the datacenter - will be assumed to reside in the same namespace as the Reaper - instance. - type: string - required: - - name - type: object - heapSize: - anyOf: - - type: integer - - type: string - default: 2Gi - description: HeapSize sets the JVM heap size to use for Reaper. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.2.1 - description: - The image to use for the Reaper pod init container (that - performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.2.1". - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: - The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: - "The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: - The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - initContainerResources: - description: Init Container resources. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - type: object - initContainerSecurityContext: - description: - InitContainerSecurityContext is the SecurityContext applied - to the Reaper init container, used to perform schema migrations. - properties: - allowPrivilegeEscalation: - description: - "AllowPrivilegeEscalation controls whether a process - can gain more privileges than its parent process. This bool - directly controls if the no_new_privs flag will be set on the - container process. AllowPrivilegeEscalation is true always when - the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows." - type: boolean - capabilities: - description: - The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container - runtime. Note that this field cannot be set when spec.os.name - is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: - Run container in privileged mode. Processes in privileged - containers are essentially equivalent to root on the host. Defaults - to false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - procMount: - description: - procMount denotes the type of proc mount to use for - the containers. The default is DefaultProcMount which uses the - container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: - Whether this container has a read-only root filesystem. - Default is false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - runAsGroup: - description: - The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: - Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence. Note that this field cannot be set when spec.os.name - is windows. + type: object + type: object + type: object + podSecurityContext: + description: PodSecurityContext contains a pod-level SecurityContext + to apply to Reaper pods. + properties: + fsGroup: + description: "A special supplemental group that applies to all + containers in a pod. Some volume types allow the Kubelet to + change the ownership of that volume to be owned by the pod: + \n 1. The owning GID will be the FSGroup 2. The setgid bit is + set (new files created in the volume will be owned by FSGroup) + 3. The permission bits are OR'd with rw-rw---- \n If unset, + the Kubelet will not modify the ownership and permissions of + any volume. Note that this field cannot be set when spec.os.name + is windows." + format: int64 + type: integer + fsGroupChangePolicy: + description: 'fsGroupChangePolicy defines behavior of changing + ownership and permission of the volume before being exposed + inside Pod. This field will only apply to volume types which + support fsGroup based ownership(and permissions). It will have + no effect on ephemeral volume types such as: secret, configmaps + and emptydir. Valid values are "OnRootMismatch" and "Always". + If not specified, "Always" is used. Note that this field cannot + be set when spec.os.name is windows.' + type: string + runAsGroup: + description: The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. Note that this field cannot + be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied to all containers. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. + properties: + level: + description: Level is SELinux level label that applies to + the container. + type: string + role: + description: Role is a SELinux role label that applies to + the container. + type: string + type: + description: Type is a SELinux type label that applies to + the container. + type: string + user: + description: User is a SELinux user label that applies to + the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use by the containers in this + pod. Note that this field cannot be set when spec.os.name is + windows. + properties: + localhostProfile: + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." + type: string + required: + - type + type: object + supplementalGroups: + description: A list of groups applied to the first process run + in each container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. Note + that this field cannot be set when spec.os.name is windows. + items: format: int64 type: integer - seLinuxOptions: - description: - The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - properties: - level: - description: - Level is SELinux level label that applies to - the container. - type: string - role: - description: - Role is a SELinux role label that applies to - the container. - type: string - type: - description: - Type is a SELinux type label that applies to - the container. - type: string - user: - description: - User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: - The seccomp options to use by this container. If - seccomp options are provided at both the pod & container level, - the container options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + type: array + sysctls: + description: Sysctls hold a list of namespaced sysctls used for + the pod. Pods with unsupported sysctls (by the container runtime) + might fail to launch. Note that this field cannot be set when + spec.os.name is windows. + items: + description: Sysctl defines a kernel parameter to be set properties: - localhostProfile: - description: - localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: - "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: - The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will - be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: - GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: - GMSACredentialSpecName is the name of the GMSA - credential spec to use. - type: string - hostProcess: - description: - HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: - The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. - type: string - type: object - type: object - jmxUserSecretRef: - description: - "Deprecated: JMX security is now based on CQL roles. - Reaper will use cassandraUsefSecretRef for authentication, this - field is ignored." - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - keyspace: - default: reaper_db - description: - The keyspace to use to store Reaper's state. Will default - to "reaper_db" if unspecified. Will be created if it does not exist, - and if this Reaper resource is managed by K8ssandra. - type: string - livenessProbe: - description: - LivenessProbe sets the Reaper liveness probe. Leave nil - to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: - Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: - Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: - "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: - Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: - HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. + name: + description: Name of a property to set type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. Defaults - to HTTP. + value: + description: Value of a property to set type: string required: - - port + - name + - value type: object - initialDelaySeconds: - description: - "Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." - type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - metadata: - description: labels and annotations for Reaper resources - properties: - annotations: - additionalProperties: + type: array + windowsOptions: + description: The Windows specific settings applied to all containers. + If unspecified, the options within a container's SecurityContext + will be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. type: string - type: object - commonLabels: - additionalProperties: + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA + credential spec to use. type: string - description: - labels/annotations that will be applied to all components - created by the CRD - type: object - labels: - additionalProperties: + hostProcess: + description: HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - type: object - podSecurityContext: - description: - PodSecurityContext contains a pod-level SecurityContext - to apply to Reaper pods. - properties: - fsGroup: - description: - "A special supplemental group that applies to all - containers in a pod. Some volume types allow the Kubelet to - change the ownership of that volume to be owned by the pod: - \n 1. The owning GID will be the FSGroup 2. The setgid bit is - set (new files created in the volume will be owned by FSGroup) - 3. The permission bits are OR'd with rw-rw---- \n If unset, - the Kubelet will not modify the ownership and permissions of - any volume. Note that this field cannot be set when spec.os.name - is windows." - format: int64 - type: integer - fsGroupChangePolicy: - description: - 'fsGroupChangePolicy defines behavior of changing - ownership and permission of the volume before being exposed - inside Pod. This field will only apply to volume types which - support fsGroup based ownership(and permissions). It will have - no effect on ephemeral volume types such as: secret, configmaps - and emptydir. Valid values are "OnRootMismatch" and "Always". - If not specified, "Always" is used. Note that this field cannot - be set when spec.os.name is windows.' - type: string - runAsGroup: - description: - The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: - Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in SecurityContext. If set - in both SecurityContext and PodSecurityContext, the value specified - in SecurityContext takes precedence. - type: boolean - runAsUser: - description: - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in SecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this field cannot - be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: - The SELinux context to be applied to all containers. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in SecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: - Level is SELinux level label that applies to - the container. - type: string - role: - description: - Role is a SELinux role label that applies to - the container. - type: string - type: - description: - Type is a SELinux type label that applies to - the container. - type: string - user: - description: - User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: - The seccomp options to use by the containers in this - pod. Note that this field cannot be set when spec.os.name is - windows. - properties: - localhostProfile: - description: - localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: - "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." + type: object + type: object + readinessProbe: + description: ReadinessProbe sets the Reaper readiness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: type: string - required: - - type - type: object - supplementalGroups: - description: - A list of groups applied to the first process run - in each container, in addition to the container's primary GID. If - unspecified, no groups will be added to any container. Note - that this field cannot be set when spec.os.name is windows. - items: - format: int64 + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 type: integer - type: array - sysctls: - description: - Sysctls hold a list of namespaced sysctls used for - the pod. Pods with unsupported sysctls (by the container runtime) - might fail to launch. Note that this field cannot be set when - spec.os.name is windows. - items: - description: Sysctl defines a kernel parameter to be set - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - required: + service: + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: - name - value - type: object - type: array - windowsOptions: - description: - The Windows specific settings applied to all containers. - If unspecified, the options within a container's SecurityContext - will be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: - GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: - GMSACredentialSpecName is the name of the GMSA - credential spec to use. - type: string - hostProcess: - description: - HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: - The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. - type: string - type: object - type: object - readinessProbe: - description: - ReadinessProbe sets the Reaper readiness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: - Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: - Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: - "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: - Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: - HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. Defaults - to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: - "Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." - type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - resources: - description: Main Container resources. - properties: - limits: - additionalProperties: + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + - type: integer + - type: string + description: Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + - type: integer + - type: string + description: Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - type: object - secretsProvider: - default: internal - description: - SecretsProvider defines whether the secrets used for - credentials and certs will be backed by an external secret backend. - This moves the responsibility of generating and storing secrets - from the operators to the user and will rely on a mutating webhook - to inject the secrets into the necessary resources - enum: - - internal - - external - type: string - securityContext: - description: SecurityContext applied to the Reaper main container. - properties: - allowPrivilegeEscalation: - description: - "AllowPrivilegeEscalation controls whether a process - can gain more privileges than its parent process. This bool - directly controls if the no_new_privs flag will be set on the - container process. AllowPrivilegeEscalation is true always when - the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows." - type: boolean - capabilities: - description: - The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container - runtime. Note that this field cannot be set when spec.os.name - is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities type - type: string - type: array - type: object - privileged: - description: - Run container in privileged mode. Processes in privileged - containers are essentially equivalent to root on the host. Defaults - to false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - procMount: - description: - procMount denotes the type of proc mount to use for - the containers. The default is DefaultProcMount which uses the - container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: - Whether this container has a read-only root filesystem. - Default is false. Note that this field cannot be set when spec.os.name - is windows. - type: boolean - runAsGroup: - description: - The GID to run the entrypoint of the container process. - Uses runtime default if unset. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: - Indicates that the container must run as a non-root - user. If true, the Kubelet will validate the image at runtime - to ensure that it does not run as UID 0 (root) and fail to start - the container if it does. If unset or false, no such validation - will be performed. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext - and PodSecurityContext, the value specified in SecurityContext - takes precedence. Note that this field cannot be set when spec.os.name - is windows. - format: int64 - type: integer - seLinuxOptions: - description: - The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random - SELinux context for each container. May also be set in PodSecurityContext. If - set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. - properties: - level: - description: - Level is SELinux level label that applies to - the container. - type: string - role: - description: - Role is a SELinux role label that applies to - the container. - type: string - type: - description: - Type is a SELinux type label that applies to - the container. - type: string - user: - description: - User is a SELinux user label that applies to - the container. - type: string - type: object - seccompProfile: - description: - The seccomp options to use by this container. If - seccomp options are provided at both the pod & container level, - the container options override the pod options. Note that this - field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: - localhostProfile indicates a profile defined - in a file on the node should be used. The profile must be - preconfigured on the node to work. Must be a descending - path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". - type: string - type: - description: - "type indicates which kind of seccomp profile - will be applied. Valid options are: \n Localhost - a profile - defined in a file on the node should be used. RuntimeDefault - - the container runtime default profile should be used. - Unconfined - no profile should be applied." - type: string - required: - - type - type: object - windowsOptions: - description: - The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will - be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: - GMSACredentialSpec is where the GMSA admission - webhook (https://github.com/kubernetes-sigs/windows-gmsa) - inlines the contents of the GMSA credential spec named by - the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: - GMSACredentialSpecName is the name of the GMSA - credential spec to use. - type: string - hostProcess: - description: - HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: - The UserName in Windows to run the entrypoint - of the container process. Defaults to the user specified - in image metadata if unspecified. May also be set in PodSecurityContext. - If set in both SecurityContext and PodSecurityContext, the - value specified in SecurityContext takes precedence. - type: string - type: object - type: object - skipSchemaMigration: - default: false - description: - Whether to skip schema migration. Schema migration is - done in an init container on every Reaper deployment and can slow - down Reaper's startup time. Besides, schema migration requires reading - data at QUORUM. It can be skipped if you know that the schema is - already up-to-date, or if you know upfront that QUORUM cannot be - achieved (for example, because a DC is down). - type: boolean - telemetry: - description: - Telemetry defines the desired telemetry integrations - to deploy targeting the Reaper pods for all DCs in this cluster - (unless overriden by DC specific settings) - properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: - type: string - type: object - filters: - items: - description: - "RelabelConfig allows dynamic rewriting of - the label set, being applied to samples before ingestion. - It defines ``-section of Prometheus - configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" - properties: - action: - description: - Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: - Modulus to take of the hash of the source - label values. - format: int64 - type: integer - regex: - description: - Regular expression against which the extracted - value is matched. Default is '(.*)' - type: string - replacement: - description: - Replacement value against which a regex - replace is performed if the regular expression matches. - Regex capture groups are available. Default is '$1' - type: string - separator: - description: - Separator placed between concatenated source - label values. default is ';'. - type: string - sourceLabels: - description: - The source labels select values from existing - labels. Their content is concatenated using the configured - separator and matched against the configured regular - expression for the replace, keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: - Label to which the resulting value is written - in a replace action. It is mandatory for replace actions. - Regex capture groups are available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: - enabled sets whether MCAC (legacy metrics endpoint) - is enabled. This is considered true by default. - type: boolean - metricFilters: - description: - 'MetricFilters allows passing filters to MCAC - in order to reduce the amount of extracted metrics. Not - setting this field will result in the default filters being - used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics being - extracted.' - items: - type: string - type: array - type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: - CommonLabels are applied to all serviceMonitors - created. - type: object - enabled: - description: - Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: - properties: - sinks: - description: - Sinks is the list of sinks to use for the - Vector agent. - items: - properties: - config: - description: - Config is the configuration for the - sink. - type: string - inputs: - description: - Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: - Sources is the list of sources to use for - the Vector agent. - items: - properties: - config: - description: - Config is the configuration for the - source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object - type: array - transforms: - description: - Transforms is the list of transforms to use - for the Vector agent. - items: - properties: - config: - description: - Config is the configuration for the - transform. - type: string - inputs: - description: - Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object - type: array - type: object - enabled: - description: - Enabled enables the Vector agent for this resource - (Cassandra, Reaper or Stargate). Enabling the vector agent - will inject a sidecar container into the pod. - type: boolean - image: - description: - Image is the name of the Vector image to use. - If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: Main Container resources. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + secretsProvider: + default: internal + description: SecretsProvider defines whether the secrets used for + credentials and certs will be backed by an external secret backend. + This moves the responsibility of generating and storing secrets + from the operators to the user and will rely on a mutating webhook + to inject the secrets into the necessary resources + enum: + - internal + - external + type: string + securityContext: + description: SecurityContext applied to the Reaper main container. + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether a process + can gain more privileges than its parent process. This bool + directly controls if the no_new_privs flag will be set on the + container process. AllowPrivilegeEscalation is true always when + the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by the container + runtime. Note that this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities type type: string - resources: - description: - Resources is the resource requirements for the - Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - type: object - scrapeInterval: - description: - ScrapeInterval is the interval at which the Vector - agent will scrape the metrics endpoint. Use values like - 30s, 1m, 5m. kube:default=30s + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities type type: string - type: object - type: object - tolerations: - description: Tolerations applied to the Reaper pods. - items: - description: - The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + type: array + type: object + privileged: + description: Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. Defaults + to false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to use for + the containers. The default is DefaultProcMount which uses the + container runtime defaults for readonly paths and masked paths. + This requires the ProcMountType feature flag to be enabled. + Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root filesystem. + Default is false. Note that this field cannot be set when spec.os.name + is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when spec.os.name + is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. properties: - effect: - description: - Effect indicates the taint effect to match. Empty - means match all taint effects. When specified, allowed values - are NoSchedule, PreferNoSchedule and NoExecute. + level: + description: Level is SELinux level label that applies to + the container. type: string - key: - description: - Key is the taint key that the toleration applies - to. Empty means match all taint keys. If the key is empty, - operator must be Exists; this combination means to match all - values and all keys. + role: + description: Role is a SELinux role label that applies to + the container. type: string - operator: - description: - Operator represents a key's relationship to the - value. Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod - can tolerate all taints of a particular category. + type: + description: Type is a SELinux type label that applies to + the container. type: string - tolerationSeconds: - description: - TolerationSeconds represents the period of time - the toleration (which must be of effect NoExecute, otherwise - this field is ignored) tolerates the taint. By default, it - is not set, which means tolerate the taint forever (do not - evict). Zero and negative values will be treated as 0 (evict - immediately) by the system. - format: int64 - type: integer - value: - description: - Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. + user: + description: User is a SELinux user label that applies to + the container. type: string type: object - type: array - uiUserSecretRef: - description: - Defines the secret which contains the username and password - for the Reaper UI and REST API authentication. - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - required: - - datacenterRef - type: object - status: - description: ReaperStatus defines the observed state of Reaper - properties: - conditions: - items: + seccompProfile: + description: The seccomp options to use by this container. If + seccomp options are provided at both the pod & container level, + the container options override the pod options. Note that this + field cannot be set when spec.os.name is windows. properties: - lastTransitionTime: - description: - LastTransitionTime is the last time the condition - transited from one status to another. - format: date-time - type: string - status: + localhostProfile: + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must only be set if type is "Localhost". type: string type: + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." type: string required: - - status - - type + - type type: object - type: array - progress: - description: Progress is the progress of this Reaper object. - enum: - - Pending - - Deploying - - Configuring - - Running - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} + windowsOptions: + description: The Windows specific settings applied to all containers. + If unspecified, the options from the PodSecurityContext will + be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA + credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should + be run as a 'Host Process' container. This field is alpha-level + and will only be honored by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without the feature flag + will result in errors when validating the Pod. All of a + Pod's containers must have the same effective HostProcess + value (it is not allowed to have a mix of HostProcess containers + and non-HostProcess containers). In addition, if HostProcess + is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: string + type: object + type: object + skipSchemaMigration: + default: false + description: Whether to skip schema migration. Schema migration is + done in an init container on every Reaper deployment and can slow + down Reaper's startup time. Besides, schema migration requires reading + data at QUORUM. It can be skipped if you know that the schema is + already up-to-date, or if you know upfront that QUORUM cannot be + achieved (for example, because a DC is down). + type: boolean + telemetry: + description: Telemetry defines the desired telemetry integrations + to deploy targeting the Reaper pods for all DCs in this cluster + (unless overriden by DC specific settings) + properties: + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: + properties: + sinks: + description: Sinks is the list of sinks to use for the + Vector agent. + items: + properties: + config: + description: Config is the configuration for the + sink. + type: string + inputs: + description: Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: Sources is the list of sources to use for + the Vector agent. + items: + properties: + config: + description: Config is the configuration for the + source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: Transforms is the list of transforms to use + for the Vector agent. + items: + properties: + config: + description: Config is the configuration for the + transform. + type: string + inputs: + description: Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object + type: array + type: object + enabled: + description: Enabled enables the Vector agent for this resource + (Cassandra, Reaper or Stargate). Enabling the vector agent + will inject a sidecar container into the pod. + type: boolean + image: + description: Image is the name of the Vector image to use. + If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: Resources is the resource requirements for the + Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of + compute resources required. If Requests is omitted for + a container, it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined value. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + scrapeInterval: + description: ScrapeInterval is the interval at which the Vector + agent will scrape the metrics endpoint. Use values like + 30s, 1m, 5m. kube:default=30s + type: string + type: object + type: object + tolerations: + description: Tolerations applied to the Reaper pods. + items: + description: The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod + can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever (do not + evict). Zero and negative values will be treated as 0 (evict + immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + uiUserSecretRef: + description: Defines the secret which contains the username and password + for the Reaper UI and REST API authentication. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - datacenterRef + type: object + status: + description: ReaperStatus defines the observed state of Reaper + properties: + conditions: + items: + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the condition + transited from one status to another. + format: date-time + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + type: array + progress: + description: Progress is the progress of this Reaper object. + enum: + - Pending + - Deploying + - Configuring + - Running + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml index 1c6f2e8bf..78a84da4d 100644 --- a/config/crd/bases/stargate.k8ssandra.io_stargates.yaml +++ b/config/crd/bases/stargate.k8ssandra.io_stargates.yaml @@ -15,3996 +15,3392 @@ spec: singular: stargate scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.datacenterRef.name - name: DC - type: string - - jsonPath: .status.progress - name: Status - type: string - - jsonPath: .status.readyReplicasRatio - name: Ready - type: string - - jsonPath: .status.updatedReplicas - name: Up-to-date - type: integer - - jsonPath: .status.availableReplicas - name: Available - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Stargate is the Schema for the stargates API - properties: - apiVersion: - description: - "APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: - "Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - metadata: - type: object - spec: - description: Specification of the desired behavior of this Stargate resource. - properties: - affinity: - description: - Affinity is the affinity to apply to all the Stargate - pods. Leave nil to let the controller reuse the same affinity rules - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity - properties: - nodeAffinity: - description: - Describes node affinity scheduling rules for the - pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node matches - the corresponding matchExpressions; the node(s) with the - highest sum are the most preferred. - items: - description: - An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a no-op). - A null preferred scheduling term matches no objects (i.e. - is also a no-op). - properties: - preference: - description: - A node selector term, associated with the - corresponding weight. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. + - additionalPrinterColumns: + - jsonPath: .spec.datacenterRef.name + name: DC + type: string + - jsonPath: .status.progress + name: Status + type: string + - jsonPath: .status.readyReplicasRatio + name: Ready + type: string + - jsonPath: .status.updatedReplicas + name: Up-to-date + type: integer + - jsonPath: .status.availableReplicas + name: Available + type: integer + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Stargate is the Schema for the stargates API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of this Stargate resource. + properties: + affinity: + description: Affinity is the affinity to apply to all the Stargate + pods. Leave nil to let the controller reuse the same affinity rules + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: - Weight associated with matching the corresponding - nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to an update), the system may or may not try to - eventually evict the pod from its node. + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) properties: - nodeSelectorTerms: - description: - Required. A list of node selector terms. - The terms are ORed. - items: - description: - A null or empty node selector term matches - no objects. The requirements of them are ANDed. The - TopologySelectorTerm type implements a subset of the - NodeSelectorTerm. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string - type: array - required: + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - The label key that the selector - applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: - An array of string values. If - the operator is In or NotIn, the values - array must be non-empty. If the operator - is Exists or DoesNotExist, the values array - must be empty. If the operator is Gt or - Lt, the values array must have a single - element, which will be interpreted as an - integer. This array is replaced during a - strategic merge patch. - items: + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string - type: array - required: + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer required: - - nodeSelectorTerms + - podAffinityTerm + - weight type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: - Describes pod affinity scheduling rules (e.g. co-locate - this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the affinity expressions specified by - this field, but it may choose a node that violates one or - more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object + type: array + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. + type: array + matchLabels: + additionalProperties: type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified by this - field are not met at scheduling time, the pod will not be - scheduled onto the node. If the affinity requirements specified - by this field cease to be met at some point during pod execution - (e.g. due to a pod label update), the system may or may - not try to eventually evict the pod from its node. When - there are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all terms - must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string - type: array - required: + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string - type: array - required: + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: - key - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: + required: - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: - Describes pod anti-affinity scheduling rules (e.g. - avoid putting this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods to - nodes that satisfy the anti-affinity expressions specified - by this field, but it may choose a node that violates one - or more of the expressions. The node that is most preferred - is the one with the greatest sum of weights, i.e. for each - node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements of - this field and adding "weight" to the sum if the node has - pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + allowStargateOnDataNodes: + default: false + description: 'AllowStargateOnDataNodes allows Stargate pods to be + scheduled on a worker node already hosting data pods for this datacenter. + The default is false, which means that Stargate pods will be scheduled + on separate worker nodes. Note: if the datacenter pods have HostNetwork:true, + then the Stargate pods will inherit of it, in which case it is possible + that Stargate nodes won''t be allowed to sit on data nodes even + if this property is set to true, because of port conflicts on the + same IP address.' + type: boolean + auth: + default: true + description: Whether to enable authentication for Stargate. The default + is true; it is highly recommended to always leave authentication + turned on, not only on Stargate nodes, but also on data nodes as + well. Note that Stargate REST APIs are currently only accessible + if authentication is enabled, and if the authenticator in use in + the whole cluster is PasswordAuthenticator. The usage of any other + authenticator will cause the REST API to become inaccessible, see + https://github.com/stargate/stargate/issues/792 for more. Stargate + CQL API however remains accessible even if authentication is disabled + in the cluster, or when a custom authenticator is being used. + type: boolean + authOptions: + description: Authentication options. + properties: + apiAuthMethod: + default: Table + description: 'The method to use for authenticating requests to + the Stargate APIs. Stargate currently has two authentication + / authorization methods: - Table: table-based; - JWT: JSON web + token (JWT)-based. The methods are mutually exclusive. The default + method is Table.' + enum: + - Table + - JWT + type: string + providerUrl: + description: Required when using JWT authentication method, ignored + otherwise. + type: string + tokenTtlSeconds: + description: The time-to-live in seconds of an API authentication + token. Valid only for the Table authentication method. By default, + the token persists for 30 minutes with a sliding window. Each + use of the token to authenticate resets the 30-minute window. + A token created and used after 29 minutes will authenticate + a request, but if 31 minutes passes before use, the token will + no longer exist. Default is 1800 seconds (30 minutes). + minimum: 1 + type: integer + type: object + cassandraConfigMapRef: + description: CassandraConfigMapRef is a reference to a ConfigMap that + holds Cassandra configuration. The map should have a key named cassandra_yaml. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + cassandraEncryption: + description: CassandraEncryption groups together encryption stores + that are passed to the Stargate pods, so that they can be mounted + as volumes. + properties: + clientEncryptionStores: + description: Client encryption stores which are used by Cassandra + and Reaper. + properties: + keystorePasswordSecretRef: + description: ref to the secret that contains the keystore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + keystoreSecretRef: + description: ref to the secret that contains the keystore + and optionally its password (which can also be specified + through the keystorePasswordSecretRef field) if keys are + not specified, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: ref to the secret that contains the truststore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: ref to the secret that contains the truststore + and optionally its password (which can also be specified + through the truststorePasswordSecretRef field) if keys are + not specified explicitly, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef + type: object + serverEncryptionStores: + description: Internode encryption stores which are used by Cassandra + and Stargate. + properties: + keystorePasswordSecretRef: + description: ref to the secret that contains the keystore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "keystore-password" entry + will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + keystoreSecretRef: + description: ref to the secret that contains the keystore + and optionally its password (which can also be specified + through the keystorePasswordSecretRef field) if keys are + not specified, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststorePasswordSecretRef: + description: ref to the secret that contains the truststore + password if password stored in different secret than keystoreSecretRef + if key isn't specified explicitly, "truststore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + truststoreSecretRef: + description: ref to the secret that contains the truststore + and optionally its password (which can also be specified + through the truststorePasswordSecretRef field) if keys are + not specified explicitly, "keystore" entry and a "keystore-password" + entry will be used + properties: + key: + description: The key of the entry in the Secret resource's + `data` field to be used. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - keystoreSecretRef + - truststoreSecretRef + type: object + type: object + containerImage: + default: + repository: stargateio + tag: v1.0.67 + description: ContainerImage is the image characteristics to use for + Stargate containers. Leave nil to use a default image. + properties: + name: + description: The image name to use. + type: string + pullPolicy: + description: The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never + type: string + pullSecretRef: + description: 'The secret to use when pulling the image from private + repositories. If specified, this secret will be passed to individual + puller implementations for them to use. For example, in the + case of Docker, only DockerConfig type secrets are honored. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. + type: string + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". + type: string + type: object + datacenterRef: + description: DatacenterRef is the namespace-local reference of a CassandraDatacenter + resource where Stargate should be deployed. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + heapSize: + anyOf: + - type: integer + - type: string + default: 256Mi + description: 'HeapSize sets the JVM heap size to use for Stargate. + If no Resources are specified, this value will also be used to set + a default memory request and limit for the Stargate pods: these + will be set to HeapSize x2 and x4, respectively.' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + livenessProbe: + description: LivenessProbe sets the Stargate liveness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + metadata: + description: labels and annotations for Stargate resources + properties: + annotations: + additionalProperties: + type: string + type: object + commonLabels: + additionalProperties: + type: string + description: labels/annotations that will be applied to all components + created by the CRD + type: object + labels: + additionalProperties: + type: string + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector is an optional map of label keys and values + to restrict the scheduling of Stargate nodes to workers with matching + labels. Leave nil to let the controller reuse the same node selectors + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + type: object + racks: + description: Racks allow customizing Stargate characteristics for + specific racks in the datacenter. + items: + description: StargateRackTemplate defines custom rules for Stargate + pods in a given rack. These rules will be merged with rules defined + at datacenter level in a StargateDatacenterTemplate; rack-level + rules have precedence over datacenter-level ones. + properties: + affinity: + description: Affinity is the affinity to apply to all the Stargate + pods. Leave nil to let the controller reuse the same affinity + rules used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for + the pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node matches the corresponding matchExpressions; + the node(s) with the highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a + no-op). A null preferred scheduling term matches + no objects (i.e. is also a no-op). + properties: + preference: + description: A node selector term, associated + with the corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic merge patch. items: type: string type: array required: - - key - - operator + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator type: object type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object type: object x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces field. - null selector and null or empty namespaces list - means "this pod's namespace". An empty selector - ({}) matches all namespaces. + weight: + description: Weight associated with matching the + corresponding nodeSelectorTerm, in the range + 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to an + update), the system may or may not try to eventually + evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term + matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements + a subset of the NodeSelectorTerm. properties: matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are - ANDed. + description: A list of node selector requirements + by node's labels. items: - description: - A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. + description: A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. properties: key: - description: - key is the label key that - the selector applies to. + description: The label key that the + selector applies to. type: string operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. type: string values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic merge patch. items: type: string type: array required: - - key - - operator + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. If + the operator is Gt or Lt, the values + array must have a single element, + which will be interpreted as an integer. + This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator type: object type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only "value". - The requirements are ANDed. - type: object type: object x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. The - term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces list - and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified namespaces, - where co-located is defined as running on a node - whose value of the label with key topologyKey - matches that of any node on which any of the selected - pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the corresponding - podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the anti-affinity requirements specified by - this field are not met at scheduling time, the pod will - not be scheduled onto the node. If the anti-affinity requirements - specified by this field cease to be met at some point during - pod execution (e.g. due to a pod label update), the system - may or may not try to eventually evict the pod from its - node. When there are multiple elements, the lists of nodes - corresponding to each podAffinityTerm are intersected, i.e. - all terms must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or not co-located - (anti-affinity) with, where co-located is defined as running - on a node whose value of the label with key - matches that of any node on which a pod of the set of - pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. + co-locate this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node has pods which matches the + corresponding podAffinityTerm; the node(s) with the + highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of + namespaces that the term applies to. The + term is applied to the union of the namespaces + selected by this field and the ones listed + in the namespaces field. null selector and + null or empty namespaces list means "this + pod's namespace". An empty selector ({}) + matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static + list of namespace names that the term applies + to. The term is applied to the union of + the namespaces listed in this field and + the ones selected by namespaceSelector. + null or empty namespaces list and null namespaceSelector + means "this pod's namespace". + items: type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied to the - union of the namespaces selected by this field and - the ones listed in the namespaces field. null selector - and null or empty namespaces list means "this pod's - namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of label - selector requirements. The requirements are ANDed. - items: - description: - A label selector requirement is a - selector that contains values, a key, and an - operator that relates the key and values. - properties: - key: - description: - key is the label key that the - selector applies to. - type: string - operator: - description: - operator represents a key's relationship - to a set of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. If the - operator is Exists or DoesNotExist, the - values array must be empty. This array is - replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is "In", - and the values array contains only "value". The - requirements are ANDed. + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose value + of the label with key topologyKey matches + that of any node on which any of the selected + pods is running. Empty topologyKey is not + allowed. + type: string + required: + - topologyKey type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list of namespace - names that the term applies to. The term is applied - to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. null or - empty namespaces list and null namespaceSelector means - "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where - co-located is defined as running on a node whose value - of the label with key topologyKey matches that of - any node on which any of the selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - allowStargateOnDataNodes: - default: false - description: - "AllowStargateOnDataNodes allows Stargate pods to be - scheduled on a worker node already hosting data pods for this datacenter. - The default is false, which means that Stargate pods will be scheduled - on separate worker nodes. Note: if the datacenter pods have HostNetwork:true, - then the Stargate pods will inherit of it, in which case it is possible - that Stargate nodes won't be allowed to sit on data nodes even - if this property is set to true, because of port conflicts on the - same IP address." - type: boolean - auth: - default: true - description: - Whether to enable authentication for Stargate. The default - is true; it is highly recommended to always leave authentication - turned on, not only on Stargate nodes, but also on data nodes as - well. Note that Stargate REST APIs are currently only accessible - if authentication is enabled, and if the authenticator in use in - the whole cluster is PasswordAuthenticator. The usage of any other - authenticator will cause the REST API to become inaccessible, see - https://github.com/stargate/stargate/issues/792 for more. Stargate - CQL API however remains accessible even if authentication is disabled - in the cluster, or when a custom authenticator is being used. - type: boolean - authOptions: - description: Authentication options. - properties: - apiAuthMethod: - default: Table - description: - "The method to use for authenticating requests to - the Stargate APIs. Stargate currently has two authentication - / authorization methods: - Table: table-based; - JWT: JSON web - token (JWT)-based. The methods are mutually exclusive. The default - method is Table." - enum: - - Table - - JWT - type: string - providerUrl: - description: - Required when using JWT authentication method, ignored - otherwise. - type: string - tokenTtlSeconds: - description: - The time-to-live in seconds of an API authentication - token. Valid only for the Table authentication method. By default, - the token persists for 30 minutes with a sliding window. Each - use of the token to authenticate resets the 30-minute window. - A token created and used after 29 minutes will authenticate - a request, but if 31 minutes passes before use, the token will - no longer exist. Default is 1800 seconds (30 minutes). - minimum: 1 - type: integer - type: object - cassandraConfigMapRef: - description: - CassandraConfigMapRef is a reference to a ConfigMap that - holds Cassandra configuration. The map should have a key named cassandra_yaml. - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - cassandraEncryption: - description: - CassandraEncryption groups together encryption stores - that are passed to the Stargate pods, so that they can be mounted - as volumes. - properties: - clientEncryptionStores: - description: - Client encryption stores which are used by Cassandra - and Reaper. - properties: - keystorePasswordSecretRef: - description: - ref to the secret that contains the keystore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: - ref to the secret that contains the keystore - and optionally its password (which can also be specified - through the keystorePasswordSecretRef field) if keys are - not specified, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: - ref to the secret that contains the truststore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: - ref to the secret that contains the truststore - and optionally its password (which can also be specified - through the truststorePasswordSecretRef field) if keys are - not specified explicitly, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - serverEncryptionStores: - description: - Internode encryption stores which are used by Cassandra - and Stargate. - properties: - keystorePasswordSecretRef: - description: - ref to the secret that contains the keystore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "keystore-password" entry - will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - keystoreSecretRef: - description: - ref to the secret that contains the keystore - and optionally its password (which can also be specified - through the keystorePasswordSecretRef field) if keys are - not specified, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - truststorePasswordSecretRef: - description: - ref to the secret that contains the truststore - password if password stored in different secret than keystoreSecretRef - if key isn't specified explicitly, "truststore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - truststoreSecretRef: - description: - ref to the secret that contains the truststore - and optionally its password (which can also be specified - through the truststorePasswordSecretRef field) if keys are - not specified explicitly, "keystore" entry and a "keystore-password" - entry will be used - properties: - key: - description: - The key of the entry in the Secret resource's - `data` field to be used. - type: string - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - required: - - keystoreSecretRef - - truststoreSecretRef - type: object - type: object - containerImage: - default: - repository: stargateio - tag: v1.0.67 - description: - ContainerImage is the image characteristics to use for - Stargate containers. Leave nil to use a default image. - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: - The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: - "The secret to use when pulling the image from private - repositories. If specified, this secret will be passed to individual - puller implementations for them to use. For example, in the - case of Docker, only DockerConfig type secrets are honored. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: - The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - datacenterRef: - description: - DatacenterRef is the namespace-local reference of a CassandraDatacenter - resource where Stargate should be deployed. - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - heapSize: - anyOf: - - type: integer - - type: string - default: 256Mi - description: - "HeapSize sets the JVM heap size to use for Stargate. - If no Resources are specified, this value will also be used to set - a default memory request and limit for the Stargate pods: these - will be set to HeapSize x2 and x4, respectively." - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - livenessProbe: - description: - LivenessProbe sets the Stargate liveness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: - Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. - properties: - port: - description: - Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: - "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: - Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: - HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. Defaults - to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: - "Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." - type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - metadata: - description: labels and annotations for Stargate resources - properties: - annotations: - additionalProperties: - type: string - type: object - commonLabels: - additionalProperties: - type: string - description: - labels/annotations that will be applied to all components - created by the CRD - type: object - labels: - additionalProperties: - type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: - NodeSelector is an optional map of label keys and values - to restrict the scheduling of Stargate nodes to workers with matching - labels. Leave nil to let the controller reuse the same node selectors - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector - type: object - racks: - description: - Racks allow customizing Stargate characteristics for - specific racks in the datacenter. - items: - description: - StargateRackTemplate defines custom rules for Stargate - pods in a given rack. These rules will be merged with rules defined - at datacenter level in a StargateDatacenterTemplate; rack-level - rules have precedence over datacenter-level ones. - properties: - affinity: - description: - Affinity is the affinity to apply to all the Stargate - pods. Leave nil to let the controller reuse the same affinity - rules used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity - properties: - nodeAffinity: - description: - Describes node affinity scheduling rules for - the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods - to nodes that satisfy the affinity expressions specified - by this field, but it may choose a node that violates - one or more of the expressions. The node that is most - preferred is the one with the greatest sum of weights, - i.e. for each node that meets all of the scheduling - requirements (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum by iterating - through the elements of this field and adding "weight" - to the sum if the node matches the corresponding matchExpressions; - the node(s) with the highest sum are the most preferred. - items: - description: - An empty preferred scheduling term matches - all objects with implicit weight 0 (i.e. it's a - no-op). A null preferred scheduling term matches - no objects (i.e. is also a no-op). - properties: - preference: - description: - A node selector term, associated - with the corresponding weight. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - The label key that the - selector applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: - An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - The label key that the - selector applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: - An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: - Weight associated with matching the - corresponding nodeSelectorTerm, in the range - 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to an - update), the system may or may not try to eventually - evict the pod from its node. - properties: - nodeSelectorTerms: - description: - Required. A list of node selector terms. - The terms are ORed. - items: - description: - A null or empty node selector term - matches no objects. The requirements of them - are ANDed. The TopologySelectorTerm type implements - a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: - A list of node selector requirements - by node's labels. - items: - description: - A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - The label key that the - selector applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: - An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: - A list of node selector requirements - by node's fields. - items: - description: - A node selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - The label key that the - selector applies to. - type: string - operator: - description: - Represents a key's relationship - to a set of values. Valid operators - are In, NotIn, Exists, DoesNotExist. - Gt, and Lt. - type: string - values: - description: - An array of string values. - If the operator is In or NotIn, the - values array must be non-empty. If - the operator is Exists or DoesNotExist, - the values array must be empty. If - the operator is Gt or Lt, the values - array must have a single element, - which will be interpreted as an integer. - This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array + weight: + description: weight associated with matching the + corresponding podAffinityTerm, in the range + 1-100. + format: int32 + type: integer required: - - nodeSelectorTerms + - podAffinityTerm + - weight type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: - Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods - to nodes that satisfy the affinity expressions specified - by this field, but it may choose a node that violates - one or more of the expressions. The node that is most - preferred is the one with the greatest sum of weights, - i.e. for each node that meets all of the scheduling - requirements (resource request, requiredDuringScheduling - affinity expressions, etc.), compute a sum by iterating - through the elements of this field and adding "weight" - to the sum if the node has pods which matches the - corresponding podAffinityTerm; the node(s) with the - highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to a + pod label update), the system may or may not try to + eventually evict the pod from its node. When there + are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. properties: - matchExpressions: - description: - matchExpressions is a list - of label selector requirements. The - requirements are ANDed. + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: - description: - A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: - key is the label key - that the selector applies to. - type: string - operator: - description: - operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of - namespaces that the term applies to. The - term is applied to the union of the namespaces - selected by this field and the ones listed - in the namespaces field. null selector and - null or empty namespaces list means "this - pod's namespace". An empty selector ({}) - matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: - key is the label key - that the selector applies to. - type: string - operator: - description: - operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object + required: + - key + - operator type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static - list of namespace names that the term applies - to. The term is applied to the union of - the namespaces listed in this field and - the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector - means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose value - of the label with key topologyKey matches - that of any node on which any of the selected - pods is running. Empty topologyKey is not - allowed. + type: array + matchLabels: + additionalProperties: type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the - corresponding podAffinityTerm, in the range - 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a - pod label update), the system may or may not try to - eventually evict the pod from its node. When there - are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all - terms must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or - not co-located (anti-affinity) with, where co-located - is defined as running on a node whose value of the - label with key matches that of any - node on which a pod of the set of pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: - matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified - namespaces, where co-located is defined as running - on a node whose value of the label with key - topologyKey matches that of any node on which - any of the selected pods is running. Empty topologyKey - is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: - Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, etc. - as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: - The scheduler will prefer to schedule pods - to nodes that satisfy the anti-affinity expressions - specified by this field, but it may choose a node - that violates one or more of the expressions. The - node that is most preferred is the one with the greatest - sum of weights, i.e. for each node that meets all - of the scheduling requirements (resource request, - requiredDuringScheduling anti-affinity expressions, - etc.), compute a sum by iterating through the elements - of this field and adding "weight" to the sum if the - node has pods which matches the corresponding podAffinityTerm; - the node(s) with the highest sum are the most preferred. - items: - description: - The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: - Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. properties: - matchExpressions: - description: - matchExpressions is a list - of label selector requirements. The - requirements are ANDed. + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: - description: - A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: - key is the label key - that the selector applies to. - type: string - operator: - description: - operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of - namespaces that the term applies to. The - term is applied to the union of the namespaces - selected by this field and the ones listed - in the namespaces field. null selector and - null or empty namespaces list means "this - pod's namespace". An empty selector ({}) - matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: - key is the label key - that the selector applies to. - type: string - operator: - description: - operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: - values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static - list of namespace names that the term applies - to. The term is applied to the union of - the namespaces listed in this field and - the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector - means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located - (affinity) or not co-located (anti-affinity) - with the pods matching the labelSelector - in the specified namespaces, where co-located - is defined as running on a node whose value - of the label with key topologyKey matches - that of any node on which any of the selected - pods is running. Empty topologyKey is not - allowed. - type: string - required: - - topologyKey - type: object - weight: - description: - weight associated with matching the - corresponding podAffinityTerm, in the range - 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: - If the anti-affinity requirements specified - by this field are not met at scheduling time, the - pod will not be scheduled onto the node. If the anti-affinity - requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a - pod label update), the system may or may not try to - eventually evict the pod from its node. When there - are multiple elements, the lists of nodes corresponding - to each podAffinityTerm are intersected, i.e. all - terms must be satisfied. - items: - description: - Defines a set of pods (namely those matching - the labelSelector relative to the given namespace(s)) - that this pod should be co-located (affinity) or - not co-located (anti-affinity) with, where co-located - is defined as running on a node whose value of the - label with key matches that of any - node on which a pod of the set of pods is running - properties: - labelSelector: - description: - A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: - matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: - A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by this - field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: - matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: - A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: - key is the label key that - the selector applies to. - type: string - operator: - description: - operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: - values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: - matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. + required: + - key + - operator type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: - namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected by - namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". - items: - type: string - type: array - topologyKey: - description: - This pod should be co-located (affinity) - or not co-located (anti-affinity) with the pods - matching the labelSelector in the specified - namespaces, where co-located is defined as running - on a node whose value of the label with key - topologyKey matches that of any node on which - any of the selected pods is running. Empty topologyKey - is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - allowStargateOnDataNodes: - default: false - description: - "AllowStargateOnDataNodes allows Stargate pods - to be scheduled on a worker node already hosting data pods - for this datacenter. The default is false, which means that - Stargate pods will be scheduled on separate worker nodes. - Note: if the datacenter pods have HostNetwork:true, then the - Stargate pods will inherit of it, in which case it is possible - that Stargate nodes won't be allowed to sit on data nodes - even if this property is set to true, because of port conflicts - on the same IP address." - type: boolean - authOptions: - description: Authentication options. - properties: - apiAuthMethod: - default: Table - description: - "The method to use for authenticating requests - to the Stargate APIs. Stargate currently has two authentication - / authorization methods: - Table: table-based; - JWT: - JSON web token (JWT)-based. The methods are mutually exclusive. - The default method is Table." - enum: - - Table - - JWT - type: string - providerUrl: - description: - Required when using JWT authentication method, - ignored otherwise. - type: string - tokenTtlSeconds: - description: - The time-to-live in seconds of an API authentication - token. Valid only for the Table authentication method. - By default, the token persists for 30 minutes with a sliding - window. Each use of the token to authenticate resets the - 30-minute window. A token created and used after 29 minutes - will authenticate a request, but if 31 minutes passes - before use, the token will no longer exist. Default is - 1800 seconds (30 minutes). - minimum: 1 - type: integer - type: object - cassandraConfigMapRef: - description: - CassandraConfigMapRef is a reference to a ConfigMap - that holds Cassandra configuration. The map should have a - key named cassandra_yaml. - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - containerImage: - default: - repository: stargateio - tag: v1.0.67 - description: - ContainerImage is the image characteristics to - use for Stargate containers. Leave nil to use a default image. - properties: - name: - description: The image name to use. - type: string - pullPolicy: - description: - The image pull policy to use. Defaults to "Always" - if the tag is "latest", otherwise to "IfNotPresent". - enum: - - Always - - IfNotPresent - - Never - type: string - pullSecretRef: - description: - "The secret to use when pulling the image from - private repositories. If specified, this secret will be - passed to individual puller implementations for them to - use. For example, in the case of Docker, only DockerConfig - type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" - properties: - name: - description: - "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?" - type: string - type: object - x-kubernetes-map-type: atomic - registry: - default: docker.io - description: - The Docker registry to use. Defaults to "docker.io", - the official Docker Hub. - type: string - repository: - description: The Docker repository to use. - type: string - tag: - default: latest - description: The image tag to use. Defaults to "latest". - type: string - type: object - heapSize: - anyOf: - - type: integer - - type: string - default: 256Mi - description: - "HeapSize sets the JVM heap size to use for Stargate. - If no Resources are specified, this value will also be used - to set a default memory request and limit for the Stargate - pods: these will be set to HeapSize x2 and x4, respectively." - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - livenessProbe: - description: - LivenessProbe sets the Stargate liveness probe. - Leave nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute - inside the container, the working directory for the - command is root ('/') in the container's filesystem. - The command is simply exec'd, it is not run inside - a shell, so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is treated - as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: - Minimum consecutive failures for the probe - to be considered failed after having succeeded. Defaults - to 3. Minimum value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. - properties: - port: - description: - Port number of the gRPC service. Number - must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: - "Service is the name of the service to - place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: - Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: - HTTPHeader describes a custom header - to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: - "Number of seconds after the container has - started before liveness probes are initiated. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe - to be considered successful after having failed. Defaults - to 1. Must be 1 for liveness and startup. Minimum value - is 1. - format: int32 - type: integer - tcpSocket: - description: - TCPSocket specifies an action involving a TCP - port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." - type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs - to terminate gracefully upon probe failure. The grace - period is the duration in seconds after the processes - running in the pod are sent a termination signal and the - time when the processes are forcibly halted with a kill - signal. Set this value longer than the expected cleanup - time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, - this value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. Minimum value - is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - metadata: - description: labels and annotations for Stargate resources - properties: - annotations: - additionalProperties: - type: string - type: object - commonLabels: - additionalProperties: - type: string - description: - labels/annotations that will be applied to - all components created by the CRD - type: object - labels: - additionalProperties: - type: string - type: object - pods: - description: labels/annotations for the pod components - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - service: - description: labels/annotations for the service component - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - type: object - name: - description: - Name is the rack name. It must correspond to an - existing rack name in the CassandraDatacenter resource where - Stargate is being deployed, otherwise it will be ignored. - minLength: 2 - type: string - nodeSelector: - additionalProperties: - type: string - description: - NodeSelector is an optional map of label keys and - values to restrict the scheduling of Stargate nodes to workers - with matching labels. Leave nil to let the controller reuse - the same node selectors used for data pods in this datacenter, - if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector - type: object - readinessProbe: - description: - ReadinessProbe sets the Stargate readiness probe. - Leave nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute - inside the container, the working directory for the - command is root ('/') in the container's filesystem. - The command is simply exec'd, it is not run inside - a shell, so traditional shell instructions ('|', etc) - won't work. To use a shell, you need to explicitly - call out to that shell. Exit status of 0 is treated - as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - failureThreshold: - description: - Minimum consecutive failures for the probe - to be considered failed after having succeeded. Defaults - to 3. Minimum value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. - properties: - port: - description: - Port number of the gRPC service. Number - must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: - "Service is the name of the service to - place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: - Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: - HTTPHeader describes a custom header - to be used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - initialDelaySeconds: - description: - "Number of seconds after the container has - started before liveness probes are initiated. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe - to be considered successful after having failed. Defaults - to 1. Must be 1 for liveness and startup. Minimum value - is 1. - format: int32 - type: integer - tcpSocket: - description: - TCPSocket specifies an action involving a TCP - port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." - type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on - the container. Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs - to terminate gracefully upon probe failure. The grace - period is the duration in seconds after the processes - running in the pod are sent a termination signal and the - time when the processes are forcibly halted with a kill - signal. Set this value longer than the expected cleanup - time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, - this value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). This is a beta field and requires enabling - ProbeTerminationGracePeriod feature gate. Minimum value - is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - resources: - description: - Resources is the Kubernetes resource requests and - limits to apply, per Stargate pod. Leave nil to use defaults. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. More info: - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - type: object - secretsProvider: - default: internal - description: - SecretsProvider defines whether the secrets used - for credentials and certs will be backed by an external secret - backend. This moves the responsibility of generating and storing - secrets from the operators to the user and will rely on a - mutating webhook to inject the secrets into the necessary - resources - enum: - - internal - - external - type: string - serviceAccount: - default: default - description: - ServiceAccount is the service account name to use - for Stargate pods. - type: string - telemetry: - description: - Telemetry defines the desired telemetry integrations - to deploy targeting the Stargate pods for all DCs in this - cluster (unless overriden by DC specific settings) - properties: - cassandra: - properties: - endpoint: - properties: - address: - type: string - port: + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. type: string + required: + - topologyKey type: object - filters: - items: - description: - "RelabelConfig allows dynamic rewriting - of the label set, being applied to samples before - ingestion. It defines ``-section - of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" - properties: - action: - description: - Action to perform based on regex - matching. Default is 'replace' - type: string - modulus: - description: - Modulus to take of the hash of the - source label values. - format: int64 - type: integer - regex: - description: - Regular expression against which - the extracted value is matched. Default is '(.*)' - type: string - replacement: - description: - Replacement value against which a - regex replace is performed if the regular expression - matches. Regex capture groups are available. - Default is '$1' - type: string - separator: - description: - Separator placed between concatenated - source label values. default is ';'. - type: string - sourceLabels: - description: - The source labels select values from - existing labels. Their content is concatenated - using the configured separator and matched against - the configured regular expression for the replace, - keep, and drop actions. - items: + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules + (e.g. avoid putting this pod in the same node, zone, etc. + as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the anti-affinity expressions + specified by this field, but it may choose a node + that violates one or more of the expressions. The + node that is most preferred is the one with the greatest + sum of weights, i.e. for each node that meets all + of the scheduling requirements (resource request, + requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if the + node has pods which matches the corresponding podAffinityTerm; + the node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of + namespaces that the term applies to. The + term is applied to the union of the namespaces + selected by this field and the ones listed + in the namespaces field. null selector and + null or empty namespaces list means "this + pod's namespace". An empty selector ({}) + matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static + list of namespace names that the term applies + to. The term is applied to the union of + the namespaces listed in this field and + the ones selected by namespaceSelector. + null or empty namespaces list and null namespaceSelector + means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose value + of the label with key topologyKey matches + that of any node on which any of the selected + pods is running. Empty topologyKey is not + allowed. type: string - type: array - targetLabel: - description: - Label to which the resulting value - is written in a replace action. It is mandatory - for replace actions. Regex capture groups are - available. - type: string - type: object - type: array - type: object - mcac: - properties: - enabled: - description: - enabled sets whether MCAC (legacy metrics - endpoint) is enabled. This is considered true by default. - type: boolean - metricFilters: - description: - 'MetricFilters allows passing filters to - MCAC in order to reduce the amount of extracted metrics. - Not setting this field will result in the default - filters being used: - "deny:org.apache.cassandra.metrics.Table" - - "deny:org.apache.cassandra.metrics.table" - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics - being extracted.' - items: - type: string - type: array - type: object - prometheus: - properties: - commonLabels: - additionalProperties: - type: string - description: - CommonLabels are applied to all serviceMonitors - created. + required: + - topologyKey + type: object + weight: + description: weight associated with matching the + corresponding podAffinityTerm, in the range + 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight type: object - enabled: - description: - Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean - type: object - vector: - properties: - components: + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the anti-affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to a + pod label update), the system may or may not try to + eventually evict the pod from its node. When there + are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running properties: - sinks: - description: - Sinks is the list of sinks to use for - the Vector agent. - items: - properties: - config: - description: - Config is the configuration for - the sink. - type: string - inputs: - description: - Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: - Sources is the list of sources to use - for the Vector agent. - items: - properties: - config: - description: - Config is the configuration for - the source. - type: string - name: - description: Name is the name of the source. + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: type: string - type: - description: Type is the type of the source. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: type: string - required: - - name - - type - type: object - type: array - transforms: - description: - Transforms is the list of transforms - to use for the Vector agent. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". items: - properties: - config: - description: - Config is the configuration for - the transform. - type: string - inputs: - description: - Inputs is the list of inputs - for the transform. - items: - type: string - type: array - name: - description: Name is the name of the transform. - type: string - type: - description: Type is the type of the transform. - type: string - required: - - name - - type - type: object + type: string type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey type: object - enabled: - description: - Enabled enables the Vector agent for this - resource (Cassandra, Reaper or Stargate). Enabling - the vector agent will inject a sidecar container into - the pod. - type: boolean - image: - description: - Image is the name of the Vector image to - use. If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: - Resources is the resource requirements - for the Vector agent. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount - of compute resources required. If Requests is - omitted for a container, it defaults to Limits - if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - type: object - scrapeInterval: - description: - ScrapeInterval is the interval at which - the Vector agent will scrape the metrics endpoint. - Use values like 30s, 1m, 5m. kube:default=30s - type: string - type: object - type: object - tolerations: - description: - Tolerations are tolerations to apply to the Stargate - pods. Leave nil to let the controller reuse the same tolerations - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - description: - The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . - properties: - effect: - description: - Effect indicates the taint effect to match. - Empty means match all taint effects. When specified, - allowed values are NoSchedule, PreferNoSchedule and - NoExecute. - type: string - key: - description: - Key is the taint key that the toleration - applies to. Empty means match all taint keys. If the - key is empty, operator must be Exists; this combination - means to match all values and all keys. - type: string - operator: - description: - Operator represents a key's relationship - to the value. Valid operators are Exists and Equal. - Defaults to Equal. Exists is equivalent to wildcard - for value, so that a pod can tolerate all taints of - a particular category. - type: string - tolerationSeconds: - description: - TolerationSeconds represents the period of - time the toleration (which must be of effect NoExecute, - otherwise this field is ignored) tolerates the taint. - By default, it is not set, which means tolerate the - taint forever (do not evict). Zero and negative values - will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: - Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. - type: string + type: array type: object - type: array - required: - - name - type: object - type: array - readinessProbe: - description: - ReadinessProbe sets the Stargate readiness probe. Leave - nil to use defaults. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: - Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command is - simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit status - of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array type: object - failureThreshold: - description: - Minimum consecutive failures for the probe to be - considered failed after having succeeded. Defaults to 3. Minimum - value is 1. - format: int32 - type: integer - grpc: - description: - GRPC specifies an action involving a GRPC port. This - is a beta field and requires enabling GRPCContainerProbe feature - gate. + allowStargateOnDataNodes: + default: false + description: 'AllowStargateOnDataNodes allows Stargate pods + to be scheduled on a worker node already hosting data pods + for this datacenter. The default is false, which means that + Stargate pods will be scheduled on separate worker nodes. + Note: if the datacenter pods have HostNetwork:true, then the + Stargate pods will inherit of it, in which case it is possible + that Stargate nodes won''t be allowed to sit on data nodes + even if this property is set to true, because of port conflicts + on the same IP address.' + type: boolean + authOptions: + description: Authentication options. properties: - port: - description: - Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 + apiAuthMethod: + default: Table + description: 'The method to use for authenticating requests + to the Stargate APIs. Stargate currently has two authentication + / authorization methods: - Table: table-based; - JWT: + JSON web token (JWT)-based. The methods are mutually exclusive. + The default method is Table.' + enum: + - Table + - JWT + type: string + providerUrl: + description: Required when using JWT authentication method, + ignored otherwise. + type: string + tokenTtlSeconds: + description: The time-to-live in seconds of an API authentication + token. Valid only for the Table authentication method. + By default, the token persists for 30 minutes with a sliding + window. Each use of the token to authenticate resets the + 30-minute window. A token created and used after 29 minutes + will authenticate a request, but if 31 minutes passes + before use, the token will no longer exist. Default is + 1800 seconds (30 minutes). + minimum: 1 type: integer - service: - description: - "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is defined - by gRPC." + type: object + cassandraConfigMapRef: + description: CassandraConfigMapRef is a reference to a ConfigMap + that holds Cassandra configuration. The map should have a + key named cassandra_yaml. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' type: string - required: - - port type: object - httpGet: - description: HTTPGet specifies the http request to perform. + x-kubernetes-map-type: atomic + containerImage: + default: + repository: stargateio + tag: v1.0.67 + description: ContainerImage is the image characteristics to + use for Stargate containers. Leave nil to use a default image. properties: - host: - description: - Host name to connect to, defaults to the pod - IP. You probably want to set "Host" in httpHeaders instead. + name: + description: The image name to use. type: string - httpHeaders: - description: - Custom headers to set in the request. HTTP allows - repeated headers. - items: - description: - HTTPHeader describes a custom header to be - used in HTTP probes - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. + pullPolicy: + description: The image pull policy to use. Defaults to "Always" + if the tag is "latest", otherwise to "IfNotPresent". + enum: + - Always + - IfNotPresent + - Never type: string - port: - anyOf: - - type: integer - - type: string - description: - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: - Scheme to use for connecting to the host. Defaults - to HTTP. + pullSecretRef: + description: 'The secret to use when pulling the image from + private repositories. If specified, this secret will be + passed to individual puller implementations for them to + use. For example, in the case of Docker, only DockerConfig + type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + registry: + default: docker.io + description: The Docker registry to use. Defaults to "docker.io", + the official Docker Hub. type: string - required: - - port - type: object - initialDelaySeconds: - description: - "Number of seconds after the container has started - before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - periodSeconds: - description: - How often (in seconds) to perform the probe. Default - to 10 seconds. Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: - Minimum consecutive successes for the probe to be - considered successful after having failed. Defaults to 1. Must - be 1 for liveness and startup. Minimum value is 1. - format: int32 - type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - properties: - host: - description: - "Optional: Host name to connect to, defaults - to the pod IP." + repository: + description: The Docker repository to use. + type: string + tag: + default: latest + description: The image tag to use. Defaults to "latest". type: string - port: - anyOf: - - type: integer - - type: string - description: - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. Name must be an - IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - description: - Optional duration in seconds the pod needs to terminate - gracefully upon probe failure. The grace period is the duration - in seconds after the processes running in the pod are sent a - termination signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer than the expected - cleanup time for your process. If this value is nil, the pod's - terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates stop immediately - via the kill signal (no opportunity to shut down). This is a - beta field and requires enabling ProbeTerminationGracePeriod - feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer - timeoutSeconds: - description: - "Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - format: int32 - type: integer - type: object - resources: - description: - Resources is the Kubernetes resource requests and limits - to apply, per Stargate pod. Leave nil to use defaults. - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" type: object - type: object - secretsProvider: - default: internal - description: - SecretsProvider defines whether the secrets used for - credentials and certs will be backed by an external secret backend. - This moves the responsibility of generating and storing secrets - from the operators to the user and will rely on a mutating webhook - to inject the secrets into the necessary resources - enum: - - internal - - external - type: string - serviceAccount: - default: default - description: - ServiceAccount is the service account name to use for - Stargate pods. - type: string - size: - default: 1 - description: - Size is the number of Stargate instances to deploy in - each datacenter. They will be spread evenly across racks. - format: int32 - minimum: 1 - type: integer - telemetry: - description: - Telemetry defines the desired telemetry integrations - to deploy targeting the Stargate pods for all DCs in this cluster - (unless overriden by DC specific settings) - properties: - cassandra: + heapSize: + anyOf: + - type: integer + - type: string + default: 256Mi + description: 'HeapSize sets the JVM heap size to use for Stargate. + If no Resources are specified, this value will also be used + to set a default memory request and limit for the Stargate + pods: these will be set to HeapSize x2 and x4, respectively.' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + livenessProbe: + description: LivenessProbe sets the Stargate liveness probe. + Leave nil to use defaults. properties: - endpoint: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. properties: - address: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' type: string port: - type: string + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port type: object - filters: - items: - description: - "RelabelConfig allows dynamic rewriting of - the label set, being applied to samples before ingestion. - It defines ``-section of Prometheus - configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs" - properties: - action: - description: - Action to perform based on regex matching. - Default is 'replace' - type: string - modulus: - description: - Modulus to take of the hash of the source - label values. - format: int64 - type: integer - regex: - description: - Regular expression against which the extracted - value is matched. Default is '(.*)' - type: string - replacement: - description: - Replacement value against which a regex - replace is performed if the regular expression matches. - Regex capture groups are available. Default is '$1' - type: string - separator: - description: - Separator placed between concatenated source - label values. default is ';'. - type: string - sourceLabels: - description: - The source labels select values from existing - labels. Their content is concatenated using the configured - separator and matched against the configured regular - expression for the replace, keep, and drop actions. - items: - type: string - type: array - targetLabel: - description: - Label to which the resulting value is written - in a replace action. It is mandatory for replace actions. - Regex capture groups are available. - type: string - type: object - type: array + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer type: object - mcac: + metadata: + description: labels and annotations for Stargate resources properties: - enabled: - description: - enabled sets whether MCAC (legacy metrics endpoint) - is enabled. This is considered true by default. - type: boolean - metricFilters: - description: - 'MetricFilters allows passing filters to MCAC - in order to reduce the amount of extracted metrics. Not - setting this field will result in the default filters being - used: - "deny:org.apache.cassandra.metrics.Table" - "deny:org.apache.cassandra.metrics.table" - - "allow:org.apache.cassandra.metrics.table.live_ss_table_count" - - "allow:org.apache.cassandra.metrics.Table.LiveSSTableCount" - - "allow:org.apache.cassandra.metrics.table.live_disk_space_used" - - "allow:org.apache.cassandra.metrics.table.LiveDiskSpaceUsed" - - "allow:org.apache.cassandra.metrics.Table.Pending" - "allow:org.apache.cassandra.metrics.Table.Memtable" - - "allow:org.apache.cassandra.metrics.Table.Compaction" - - "allow:org.apache.cassandra.metrics.table.read" - "allow:org.apache.cassandra.metrics.table.write" - - "allow:org.apache.cassandra.metrics.table.range" - "allow:org.apache.cassandra.metrics.table.coordinator" - - "allow:org.apache.cassandra.metrics.table.dropped_mutations" - Setting it to an empty list will result in all metrics being - extracted.' - items: + annotations: + additionalProperties: type: string - type: array - type: object - prometheus: - properties: + type: object commonLabels: additionalProperties: type: string - description: - CommonLabels are applied to all serviceMonitors - created. + description: labels/annotations that will be applied to + all components created by the CRD + type: object + labels: + additionalProperties: + type: string + type: object + pods: + description: labels/annotations for the pod components + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + service: + description: labels/annotations for the service component + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object type: object - enabled: - description: - Enable the creation of Prometheus serviceMonitors - for this resource (Cassandra or Stargate). - type: boolean type: object - vector: + name: + description: Name is the rack name. It must correspond to an + existing rack name in the CassandraDatacenter resource where + Stargate is being deployed, otherwise it will be ignored. + minLength: 2 + type: string + nodeSelector: + additionalProperties: + type: string + description: NodeSelector is an optional map of label keys and + values to restrict the scheduling of Stargate nodes to workers + with matching labels. Leave nil to let the controller reuse + the same node selectors used for data pods in this datacenter, + if any. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + type: object + readinessProbe: + description: ReadinessProbe sets the Stargate readiness probe. + Leave nil to use defaults. properties: - components: + exec: + description: Exec specifies the action to take. properties: - sinks: - description: - Sinks is the list of sinks to use for the - Vector agent. - items: - properties: - config: - description: - Config is the configuration for the - sink. - type: string - inputs: - description: - Inputs is the list of inputs for the - transform. - items: - type: string - type: array - name: - description: Name is the name of the sink. - type: string - type: - description: Type is the type of the sink. - type: string - required: - - name - - type - type: object - type: array - sources: - description: - Sources is the list of sources to use for - the Vector agent. + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. items: - properties: - config: - description: - Config is the configuration for the - source. - type: string - name: - description: Name is the name of the source. - type: string - type: - description: Type is the type of the source. - type: string - required: - - name - - type - type: object + type: string type: array - transforms: - description: - Transforms is the list of transforms to use - for the Vector agent. + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - config: - description: - Config is the configuration for the - transform. - type: string - inputs: - description: - Inputs is the list of inputs for the - transform. - items: - type: string - type: array name: - description: Name is the name of the transform. + description: The header field name type: string - type: - description: Type is the type of the transform. + value: + description: The header field value type: string required: - - name - - type + - name + - value type: object type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port type: object - enabled: - description: - Enabled enables the Vector agent for this resource - (Cassandra, Reaper or Stargate). Enabling the vector agent - will inject a sidecar container into the pod. - type: boolean - image: - description: - Image is the name of the Vector image to use. - If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" - type: string - resources: - description: - Resources is the resource requirements for the - Vector agent. + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: Resources is the Kubernetes resource requests and + limits to apply, per Stargate pod. Leave nil to use defaults. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + secretsProvider: + default: internal + description: SecretsProvider defines whether the secrets used + for credentials and certs will be backed by an external secret + backend. This moves the responsibility of generating and storing + secrets from the operators to the user and will rely on a + mutating webhook to inject the secrets into the necessary + resources + enum: + - internal + - external + type: string + serviceAccount: + default: default + description: ServiceAccount is the service account name to use + for Stargate pods. + type: string + telemetry: + description: Telemetry defines the desired telemetry integrations + to deploy targeting the Stargate pods for all DCs in this + cluster (unless overriden by DC specific settings) + properties: + prometheus: properties: - limits: + commonLabels: additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + type: string + description: CommonLabels are applied to all serviceMonitors + created. type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: - "Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + enabled: + description: Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: + properties: + sinks: + description: Sinks is the list of sinks to use for + the Vector agent. + items: + properties: + config: + description: Config is the configuration for + the sink. + type: string + inputs: + description: Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: Sources is the list of sources to use + for the Vector agent. + items: + properties: + config: + description: Config is the configuration for + the source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: Transforms is the list of transforms + to use for the Vector agent. + items: + properties: + config: + description: Config is the configuration for + the transform. + type: string + inputs: + description: Inputs is the list of inputs + for the transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object + type: array + type: object + enabled: + description: Enabled enables the Vector agent for this + resource (Cassandra, Reaper or Stargate). Enabling + the vector agent will inject a sidecar container into + the pod. + type: boolean + image: + description: Image is the name of the Vector image to + use. If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" + type: string + resources: + description: Resources is the resource requirements + for the Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object type: object + scrapeInterval: + description: ScrapeInterval is the interval at which + the Vector agent will scrape the metrics endpoint. + Use values like 30s, 1m, 5m. kube:default=30s + type: string type: object - scrapeInterval: - description: - ScrapeInterval is the interval at which the Vector - agent will scrape the metrics endpoint. Use values like - 30s, 1m, 5m. kube:default=30s - type: string type: object + tolerations: + description: Tolerations are tolerations to apply to the Stargate + pods. Leave nil to let the controller reuse the same tolerations + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, + allowed values are NoSchedule, PreferNoSchedule and + NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. If the + key is empty, operator must be Exists; this combination + means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and Equal. + Defaults to Equal. Exists is equivalent to wildcard + for value, so that a pod can tolerate all taints of + a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the + taint forever (do not evict). Zero and negative values + will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + required: + - name type: object - tolerations: - description: - Tolerations are tolerations to apply to the Stargate - pods. Leave nil to let the controller reuse the same tolerations - used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - description: - The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + type: array + readinessProbe: + description: ReadinessProbe sets the Stargate readiness probe. Leave + nil to use defaults. + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command is + simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe to be + considered failed after having succeeded. Defaults to 3. Minimum + value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. This + is a beta field and requires enabling GRPCContainerProbe feature + gate. properties: - effect: - description: - Effect indicates the taint effect to match. Empty - means match all taint effects. When specified, allowed values - are NoSchedule, PreferNoSchedule and NoExecute. + port: + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is defined + by gRPC." type: string - key: - description: - Key is the taint key that the toleration applies - to. Empty means match all taint keys. If the key is empty, - operator must be Exists; this combination means to match all - values and all keys. + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. type: string - operator: - description: - Operator represents a key's relationship to the - value. Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod - can tolerate all taints of a particular category. + httpHeaders: + description: Custom headers to set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. type: string - tolerationSeconds: - description: - TolerationSeconds represents the period of time - the toleration (which must be of effect NoExecute, otherwise - this field is ignored) tolerates the taint. By default, it - is not set, which means tolerate the taint forever (do not - evict). Zero and negative values will be treated as 0 (evict - immediately) by the system. - format: int64 - type: integer - value: - description: - Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. type: string + required: + - port type: object - type: array - required: - - datacenterRef - - size - type: object - status: - description: Most recently observed status of this Stargate resource. - properties: - availableReplicas: - description: - Total number of available pods targeted by the Stargate - deployment. Will be zero if the deployment has not been created - yet. - format: int32 - type: integer - conditions: - items: + initialDelaySeconds: + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults to 1. Must + be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. properties: - lastTransitionTime: - description: - LastTransitionTime is the last time the condition - transited from one status to another. - format: date-time + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' type: string - status: + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate + gracefully upon probe failure. The grace period is the duration + in seconds after the processes running in the pod are sent a + termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. Value must + be non-negative integer. The value zero indicates stop immediately + via the kill signal (no opportunity to shut down). This is a + beta field and requires enabling ProbeTerminationGracePeriod + feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds + is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: Resources is the Kubernetes resource requests and limits + to apply, per Stargate pod. Leave nil to use defaults. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + secretsProvider: + default: internal + description: SecretsProvider defines whether the secrets used for + credentials and certs will be backed by an external secret backend. + This moves the responsibility of generating and storing secrets + from the operators to the user and will rely on a mutating webhook + to inject the secrets into the necessary resources + enum: + - internal + - external + type: string + serviceAccount: + default: default + description: ServiceAccount is the service account name to use for + Stargate pods. + type: string + size: + default: 1 + description: Size is the number of Stargate instances to deploy in + each datacenter. They will be spread evenly across racks. + format: int32 + minimum: 1 + type: integer + telemetry: + description: Telemetry defines the desired telemetry integrations + to deploy targeting the Stargate pods for all DCs in this cluster + (unless overriden by DC specific settings) + properties: + prometheus: + properties: + commonLabels: + additionalProperties: + type: string + description: CommonLabels are applied to all serviceMonitors + created. + type: object + enabled: + description: Enable the creation of Prometheus serviceMonitors + for this resource (Cassandra or Stargate). + type: boolean + type: object + vector: + properties: + components: + properties: + sinks: + description: Sinks is the list of sinks to use for the + Vector agent. + items: + properties: + config: + description: Config is the configuration for the + sink. + type: string + inputs: + description: Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the sink. + type: string + type: + description: Type is the type of the sink. + type: string + required: + - name + - type + type: object + type: array + sources: + description: Sources is the list of sources to use for + the Vector agent. + items: + properties: + config: + description: Config is the configuration for the + source. + type: string + name: + description: Name is the name of the source. + type: string + type: + description: Type is the type of the source. + type: string + required: + - name + - type + type: object + type: array + transforms: + description: Transforms is the list of transforms to use + for the Vector agent. + items: + properties: + config: + description: Config is the configuration for the + transform. + type: string + inputs: + description: Inputs is the list of inputs for the + transform. + items: + type: string + type: array + name: + description: Name is the name of the transform. + type: string + type: + description: Type is the type of the transform. + type: string + required: + - name + - type + type: object + type: array + type: object + enabled: + description: Enabled enables the Vector agent for this resource + (Cassandra, Reaper or Stargate). Enabling the vector agent + will inject a sidecar container into the pod. + type: boolean + image: + description: Image is the name of the Vector image to use. + If not set, the default image will be used. kube:default="timberio/vector:0.26.0-alpine" type: string - type: + resources: + description: Resources is the resource requirements for the + Vector agent. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of + compute resources required. If Requests is omitted for + a container, it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined value. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + scrapeInterval: + description: ScrapeInterval is the interval at which the Vector + agent will scrape the metrics endpoint. Use values like + 30s, 1m, 5m. kube:default=30s type: string - required: - - status - - type type: object - type: array - deploymentRefs: - description: - DeploymentRefs is the names of the Deployment objects - that were created for this Stargate object. - items: - type: string - type: array - progress: - description: Progress is the progress of this Stargate object. - enum: - - Pending - - Deploying - - Running - type: string - readyReplicas: - description: - ReadyReplicas is the total number of ready pods targeted - by the Stargate deployment. Will be zero if the deployment has not - been created yet. - format: int32 - type: integer - readyReplicasRatio: - description: - ReadyReplicasRatio is a "X/Y" string representing the - ratio between ReadyReplicas and Replicas in the Stargate deployment. - pattern: \d+/\d+ - type: string - replicas: - description: - Total number of non-terminated pods targeted by the Stargate - deployment (their labels match the selector). Will be zero if the - deployment has not been created yet. - format: int32 - type: integer - serviceRef: - description: - ServiceRef is the name of the Service object that was - created for this Stargate object. + type: object + tolerations: + description: Tolerations are tolerations to apply to the Stargate + pods. Leave nil to let the controller reuse the same tolerations + used for data pods in this datacenter, if any. See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + description: The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod + can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever (do not + evict). Zero and negative values will be treated as 0 (evict + immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + required: + - datacenterRef + - size + type: object + status: + description: Most recently observed status of this Stargate resource. + properties: + availableReplicas: + description: Total number of available pods targeted by the Stargate + deployment. Will be zero if the deployment has not been created + yet. + format: int32 + type: integer + conditions: + items: + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the condition + transited from one status to another. + format: date-time + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + type: array + deploymentRefs: + description: DeploymentRefs is the names of the Deployment objects + that were created for this Stargate object. + items: type: string - updatedReplicas: - description: - UpdatedReplicas is the total number of non-terminated - pods targeted by the Stargate deployment that have the desired template - spec. Will be zero if the deployment has not been created yet. - format: int32 - type: integer - required: - - availableReplicas - - readyReplicas - - replicas - - updatedReplicas - type: object - type: object - served: true - storage: true - subresources: - status: {} + type: array + progress: + description: Progress is the progress of this Stargate object. + enum: + - Pending + - Deploying + - Running + type: string + readyReplicas: + description: ReadyReplicas is the total number of ready pods targeted + by the Stargate deployment. Will be zero if the deployment has not + been created yet. + format: int32 + type: integer + readyReplicasRatio: + description: ReadyReplicasRatio is a "X/Y" string representing the + ratio between ReadyReplicas and Replicas in the Stargate deployment. + pattern: \d+/\d+ + type: string + replicas: + description: Total number of non-terminated pods targeted by the Stargate + deployment (their labels match the selector). Will be zero if the + deployment has not been created yet. + format: int32 + type: integer + serviceRef: + description: ServiceRef is the name of the Service object that was + created for this Stargate object. + type: string + updatedReplicas: + description: UpdatedReplicas is the total number of non-terminated + pods targeted by the Stargate deployment that have the desired template + spec. Will be zero if the deployment has not been created yet. + format: int32 + type: integer + required: + - availableReplicas + - readyReplicas + - replicas + - updatedReplicas + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/controllers/k8ssandra/cassandra_metrics_agent_test.go b/controllers/k8ssandra/cassandra_metrics_agent_test.go index 605b4263d..d8f271aa3 100644 --- a/controllers/k8ssandra/cassandra_metrics_agent_test.go +++ b/controllers/k8ssandra/cassandra_metrics_agent_test.go @@ -32,9 +32,11 @@ func createSingleDcClusterWithMetricsAgent(t *testing.T, ctx context.Context, f Spec: api.K8ssandraClusterSpec{ Cassandra: &api.CassandraClusterTemplate{ DatacenterOptions: api.DatacenterOptions{ - Telemetry: &telemetryapi.TelemetrySpec{ - Vector: &telemetryapi.VectorSpec{ - Enabled: pointer.Bool(true), + Telemetry: &telemetryapi.CassandraTelemetrySpec{ + TelemetrySpec: &telemetryapi.TelemetrySpec{ + Vector: &telemetryapi.VectorSpec{ + Enabled: pointer.Bool(true), + }, }, }, }, diff --git a/controllers/k8ssandra/datacenters.go b/controllers/k8ssandra/datacenters.go index d9acdbe5a..a46286520 100644 --- a/controllers/k8ssandra/datacenters.go +++ b/controllers/k8ssandra/datacenters.go @@ -101,7 +101,7 @@ func (r *K8ssandraClusterReconciler) reconcileDatacenters(ctx context.Context, k mergedTelemetrySpec := kc.Spec.Cassandra.Datacenters[idx].Telemetry.MergeWith(kc.Spec.Cassandra.Telemetry) if mergedTelemetrySpec == nil { - mergedTelemetrySpec = &telemetryapi.TelemetrySpec{} + mergedTelemetrySpec = &telemetryapi.CassandraTelemetrySpec{} } agentCfg := agent.Configurator{ TelemetrySpec: *mergedTelemetrySpec, diff --git a/pkg/cassandra/datacenter_test.go b/pkg/cassandra/datacenter_test.go index dd7bf1d5c..59fed0aeb 100644 --- a/pkg/cassandra/datacenter_test.go +++ b/pkg/cassandra/datacenter_test.go @@ -355,7 +355,7 @@ func TestCoalesce(t *testing.T) { Size: 3, DatacenterOptions: api.DatacenterOptions{ MgmtAPIHeap: &mgmtAPIHeap, - Telemetry: &v1alpha1.TelemetrySpec{ + Telemetry: &v1alpha1.CassandraTelemetrySpec{ Mcac: &v1alpha1.McacTelemetrySpec{ Enabled: pointer.Bool(false), }, diff --git a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go index 790f85a60..82ec7eeb4 100644 --- a/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go +++ b/pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go @@ -53,7 +53,7 @@ func getExpectedConfigMap() corev1.ConfigMap { return expectedCm } -func getExampleTelemetrySpec() telemetryapi.TelemetrySpec { +func getExampleTelemetrySpec() telemetryapi.CassandraTelemetrySpec { tspec := &Cfg.TelemetrySpec tspec.Cassandra.Filters = []promapi.RelabelConfig{ { From 50c99af88eebd1a269183ce46b9ab0f2cc0c114c Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Thu, 2 Feb 2023 13:45:56 +1100 Subject: [PATCH 36/36] Fix rebase related problems. --- apis/telemetry/v1alpha1/telemetry_types.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 42 ------------------- controllers/k8ssandra/vector.go | 2 +- pkg/telemetry/cassandra_agent_config.go | 19 --------- pkg/telemetry/vector.go | 2 +- 5 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 pkg/telemetry/cassandra_agent_config.go diff --git a/apis/telemetry/v1alpha1/telemetry_types.go b/apis/telemetry/v1alpha1/telemetry_types.go index f706f0ee4..e2a924869 100644 --- a/apis/telemetry/v1alpha1/telemetry_types.go +++ b/apis/telemetry/v1alpha1/telemetry_types.go @@ -14,7 +14,7 @@ type TelemetrySpec struct { } type CassandraTelemetrySpec struct { - *TelemetrySpec `json:"inline"` + *TelemetrySpec `json:",inline"` Mcac *McacTelemetrySpec `json:"mcac,omitempty"` Cassandra *CassandraAgentSpec `json:"cassandra,omitempty"` } diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index d393c2601..f539db770 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -28,15 +28,7 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -<<<<<<< HEAD -<<<<<<< HEAD func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { -======= -func (in *CassandraTelemetryAgentSpec) DeepCopyInto(out *CassandraTelemetryAgentSpec) { ->>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) -======= -func (in *CassandraAgentSpec) DeepCopyInto(out *CassandraAgentSpec) { ->>>>>>> bf063e5 (Make type names more concise.) *out = *in out.Endpoint = in.Endpoint if in.Filters != nil { @@ -54,7 +46,6 @@ func (in *CassandraAgentSpec) DeepCopy() *CassandraAgentSpec { return nil } out := new(CassandraAgentSpec) -<<<<<<< HEAD in.DeepCopyInto(out) return out } @@ -100,8 +91,6 @@ func (in *Endpoint) DeepCopy() *Endpoint { return nil } out := new(Endpoint) -======= ->>>>>>> bf063e5 (Make type names more concise.) in.DeepCopyInto(out) return out } @@ -162,21 +151,6 @@ func (in *PrometheusTelemetrySpec) DeepCopy() *PrometheusTelemetrySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Endpoint) DeepCopyInto(out *Endpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. -func (in *Endpoint) DeepCopy() *Endpoint { - if in == nil { - return nil - } - out := new(Endpoint) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = *in @@ -190,22 +164,6 @@ func (in *TelemetrySpec) DeepCopyInto(out *TelemetrySpec) { *out = new(VectorSpec) (*in).DeepCopyInto(*out) } -<<<<<<< HEAD - if in.Cassandra != nil { - in, out := &in.Cassandra, &out.Cassandra -<<<<<<< HEAD -<<<<<<< HEAD - *out = new(CassandraAgentSpec) -======= - *out = new(CassandraTelemetryAgentSpec) ->>>>>>> 4c171ed (CRD upgrades, codegen upgrades.) -======= - *out = new(CassandraAgentSpec) ->>>>>>> bf063e5 (Make type names more concise.) - (*in).DeepCopyInto(*out) - } -======= ->>>>>>> a42670a (Refactor telemetry types) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetrySpec. diff --git a/controllers/k8ssandra/vector.go b/controllers/k8ssandra/vector.go index b21f8e063..bf8f886dd 100644 --- a/controllers/k8ssandra/vector.go +++ b/controllers/k8ssandra/vector.go @@ -31,7 +31,7 @@ func (r *K8ssandraClusterReconciler) reconcileVector( } if kc.Spec.Cassandra.Telemetry != nil && kc.Spec.Cassandra.Telemetry.TelemetrySpec != nil && kc.Spec.Cassandra.Telemetry.IsVectorEnabled() { // Create the vector toml config content - toml, err := telemetry.CreateCassandraVectorToml(kc.Spec.Cassandra.Telemetry, dcConfig.McacEnabled) + toml, err := telemetry.CreateCassandraVectorToml(kc.Spec.Cassandra.Telemetry.TelemetrySpec, dcConfig.McacEnabled) if err != nil { return result.Error(err) } diff --git a/pkg/telemetry/cassandra_agent_config.go b/pkg/telemetry/cassandra_agent_config.go deleted file mode 100644 index 6175763d4..000000000 --- a/pkg/telemetry/cassandra_agent_config.go +++ /dev/null @@ -1,19 +0,0 @@ -package telemetry - -import ( - "context" - - telemetryapi "github.com/k8ssandra/k8ssandra-operator/apis/telemetry/v1alpha1" - "gopkg.in/yaml.v2" - corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func ReconcileTelemetryAgentConfigMap(ctx context.Context, remoteClient client.Client, telemetrySpec telemetryapi.TelemetrySpec) error { - yamlData, err := yaml.Marshal(&telemetrySpec.Cassandra) - if err != nil { - return err - } - cm := corev1.ConfigMap{} - -} diff --git a/pkg/telemetry/vector.go b/pkg/telemetry/vector.go index 363b14869..f886885c5 100644 --- a/pkg/telemetry/vector.go +++ b/pkg/telemetry/vector.go @@ -38,7 +38,7 @@ func InjectCassandraVectorAgent(telemetrySpec *telemetry.CassandraTelemetrySpec, VolumeMounts: []corev1.VolumeMount{ {Name: "vector-config", MountPath: "/etc/vector"}, }, - Resources: vector.VectorContainerResources(telemetrySpec), + Resources: vector.VectorContainerResources(telemetrySpec.TelemetrySpec), } logger.Info("Updating Vector agent in Cassandra pods")