From ef395797cf1abc7d8b315534414a001850f8f024 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:10:24 +0200 Subject: [PATCH 01/70] single quotation go version (#219) --- .github/workflows/run-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 19763fec..95d79bbd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -53,7 +53,7 @@ jobs: - name: setup-go uses: actions/setup-go@v3 with: - go-version: 1.20 + go-version: '1.20' - name: set-env-vars run: | echo "HOME=/actions-runner" >> $GITHUB_ENV @@ -70,7 +70,7 @@ jobs: - name: setup-go uses: actions/setup-go@v3 with: - go-version: 1.20 + go-version: '1.20' - name: set-env-vars run: | echo "HOME=/actions-runner" >> $GITHUB_ENV @@ -93,7 +93,7 @@ jobs: - name: setup-go uses: actions/setup-go@v3 with: - go-version: 1.20 + go-version: '1.20' - name: install-dependencies run: | sudo apt-get update From 101ba441b1680dcc8cf93308365ee1f59b0fa1f8 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:56:54 +0200 Subject: [PATCH 02/70] Fix home env GitHub runner (#220) --- .github/workflows/run-tests.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 95d79bbd..7d58fb15 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -50,13 +50,13 @@ jobs: - smart-checkout runs-on: ${{ needs.start-runner.outputs.runner-label }} steps: + - name: set-env-vars + run: | + echo "HOME=/actions-runner" >> $GITHUB_ENV - name: setup-go uses: actions/setup-go@v3 with: go-version: '1.20' - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: @@ -67,13 +67,13 @@ jobs: - smart-checkout runs-on: ${{ needs.start-runner.outputs.runner-label }} steps: + - name: set-env-vars + run: | + echo "HOME=/actions-runner" >> $GITHUB_ENV - name: setup-go uses: actions/setup-go@v3 with: go-version: '1.20' - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV - name: Install utilities run: | go install mvdan.cc/gofumpt@v0.5.0 @@ -90,6 +90,9 @@ jobs: outputs: result: ${{ steps.run-tests.outputs.result }} steps: + - name: set-env-vars + run: | + echo "HOME=/actions-runner" >> $GITHUB_ENV - name: setup-go uses: actions/setup-go@v3 with: @@ -99,12 +102,9 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential - export HOME=/actions-runner - echo "HOME=/actions-runner" >> $GITHUB_ENV - - go install sigs.k8s.io/kind@v0.21.0 + go install sigs.k8s.io/kind@v0.17.0 - curl -LO https://dl.k8s.io/release/v1.29.1/bin/linux/amd64/kubectl + curl -LO https://dl.k8s.io/release/v1.25.3/bin/linux/amd64/kubectl chmod +x ./kubectl HELM_PKG="helm-v3.13.3-linux-amd64.tar.gz" @@ -126,20 +126,20 @@ jobs: gcc --version go version kind version - kubectl version --short --client=true + kubectl version --client=true helm version - name: setup-medium-test-class-binaries run: | # This installs kube-apiserver and etcd binaries for `medium` # class tests. Refer to the writing tests docs for more info. make envtest - KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.29 -p path) + KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.26 -p path) echo "KUBEBUILDER_ASSETS=$KUBEBUILDER_ASSETS" >> $GITHUB_ENV - name: setup-k8s-cluster run: | kind delete cluster kind create cluster \ - --image=kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144 \ + --image=kindest/node:v1.25.3@sha256:cd248d1438192f7814fbca8fede13cfe5b9918746dfa12583976158a834fd5c5 \ --config=./e2e/kind-cluster-config.yaml kubectl wait --timeout=5m --for=condition=ready node -l worker=true - name: build-operator-image From 088245e13a1473b480ed2073bf425c7427cf8c61 Mon Sep 17 00:00:00 2001 From: nikita kozlovsky Date: Mon, 17 Jun 2024 09:55:21 +0200 Subject: [PATCH 03/70] add TLS support for status service (#215) --- api/v1alpha1/database_types.go | 3 +- api/v1alpha1/database_webhook.go | 4 + api/v1alpha1/service_types.go | 2 + api/v1alpha1/storage_types.go | 3 +- api/v1alpha1/storage_webhook.go | 4 + api/v1alpha1/zz_generated.deepcopy.go | 5 + deploy/ydb-operator/Chart.yaml | 4 +- deploy/ydb-operator/crds/database.yaml | 64 +++++++ deploy/ydb-operator/crds/databasenodeset.yaml | 64 +++++++ .../crds/remotedatabasenodeset.yaml | 64 +++++++ .../crds/remotestoragenodeset.yaml | 64 +++++++ deploy/ydb-operator/crds/storage.yaml | 64 +++++++ deploy/ydb-operator/crds/storagenodeset.yaml | 64 +++++++ e2e/tests/smoke_test.go | 167 ++++++++++++++++++ e2e/tests/test-objects/objects.go | 6 + internal/resources/database.go | 4 + internal/resources/database_statefulset.go | 41 +++++ internal/resources/resource.go | 16 ++ internal/resources/storage.go | 4 + internal/resources/storage_init_job.go | 1 + internal/resources/storage_statefulset.go | 42 +++++ 21 files changed, 686 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/database_types.go b/api/v1alpha1/database_types.go index 21e948e9..9bbe19b9 100644 --- a/api/v1alpha1/database_types.go +++ b/api/v1alpha1/database_types.go @@ -268,5 +268,6 @@ func init() { func (r *Database) AnyCertificatesAdded() bool { return len(r.Spec.CABundle) > 0 || r.Spec.Service.GRPC.TLSConfiguration.Enabled || - r.Spec.Service.Interconnect.TLSConfiguration.Enabled + r.Spec.Service.Interconnect.TLSConfiguration.Enabled || + r.Spec.Service.Status.TLSConfiguration.Enabled } diff --git a/api/v1alpha1/database_webhook.go b/api/v1alpha1/database_webhook.go index 461ec368..424a4490 100644 --- a/api/v1alpha1/database_webhook.go +++ b/api/v1alpha1/database_webhook.go @@ -106,6 +106,10 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err database.Spec.Service.Datastreams.TLSConfiguration = &TLSConfiguration{Enabled: false} } + if database.Spec.Service.Status.TLSConfiguration == nil { + database.Spec.Service.Status.TLSConfiguration = &TLSConfiguration{Enabled: false} + } + if database.Spec.Domain == "" { database.Spec.Domain = DefaultDatabaseDomain } diff --git a/api/v1alpha1/service_types.go b/api/v1alpha1/service_types.go index e7c0aca9..7eb2b35f 100644 --- a/api/v1alpha1/service_types.go +++ b/api/v1alpha1/service_types.go @@ -32,6 +32,8 @@ type InterconnectService struct { type StatusService struct { Service `json:""` + + TLSConfiguration *TLSConfiguration `json:"tls,omitempty"` } type DatastreamsService struct { diff --git a/api/v1alpha1/storage_types.go b/api/v1alpha1/storage_types.go index c8e1d358..039b3a33 100644 --- a/api/v1alpha1/storage_types.go +++ b/api/v1alpha1/storage_types.go @@ -242,5 +242,6 @@ func init() { func (r *Storage) AnyCertificatesAdded() bool { return len(r.Spec.CABundle) > 0 || r.Spec.Service.GRPC.TLSConfiguration.Enabled || - r.Spec.Service.Interconnect.TLSConfiguration.Enabled + r.Spec.Service.Interconnect.TLSConfiguration.Enabled || + r.Spec.Service.Status.TLSConfiguration.Enabled } diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index c6135f65..a6f1f28f 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -156,6 +156,10 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro storage.Spec.Service.Interconnect.TLSConfiguration = &TLSConfiguration{Enabled: false} } + if storage.Spec.Service.Status.TLSConfiguration == nil { + storage.Spec.Service.Status.TLSConfiguration = &TLSConfiguration{Enabled: false} + } + if storage.Spec.Monitoring == nil { storage.Spec.Monitoring = &MonitoringOptions{ Enabled: false, diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index fb95cce9..3f687fa4 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1071,6 +1071,11 @@ func (in *StaticCredentialsAuth) DeepCopy() *StaticCredentialsAuth { func (in *StatusService) DeepCopyInto(out *StatusService) { *out = *in in.Service.DeepCopyInto(&out.Service) + if in.TLSConfiguration != nil { + in, out := &in.TLSConfiguration, &out.TLSConfiguration + *out = new(TLSConfiguration) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusService. diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index d5a1b3ed..166eee86 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.13 +version: 0.5.14 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.13" +appVersion: "0.5.14" diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index c07efdad..e0b1976e 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -3994,6 +3994,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object sharedResources: diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 2fd02003..bbbc2cf7 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -2699,6 +2699,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object sharedResources: diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index 8c193a63..706fa1ef 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -2700,6 +2700,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object sharedResources: diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index 00577e09..e8053cc3 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -2710,6 +2710,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object storageRef: diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index 7cde1a93..650c39c1 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -5166,6 +5166,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object terminationGracePeriodSeconds: diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index c2365985..0c797170 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -2709,6 +2709,70 @@ spec: description: IPFamilyPolicy represents the dual-stack-ness requested or required by a Service type: string + tls: + properties: + CA: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + certificate: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + enabled: + type: boolean + key: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - enabled + type: object type: object type: object storageRef: diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index 9b500958..2dd9bfce 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -1,8 +1,15 @@ package tests import ( + "bufio" "context" + "crypto/tls" + "crypto/x509" + "errors" "fmt" + "io" + "net" + "net/http" "os" "os/exec" "path/filepath" @@ -23,6 +30,7 @@ import ( v1alpha1 "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) const ( @@ -179,6 +187,68 @@ func executeSimpleQuery(ctx context.Context, podName, podNamespace, storageEndpo }, Timeout, Interval).Should(MatchRegexp(".*column0.*1.*")) } +func portForward(ctx context.Context, svcName string, svcNamespace string, port int, f func(int) error) { + Eventually(func(g Gomega) error { + args := []string{ + "-n", svcNamespace, + "port-forward", + fmt.Sprintf("svc/%s", svcName), + fmt.Sprintf(":%d", port), + } + + cmd := exec.CommandContext(ctx, "kubectl", args...) + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + + stderr, err := cmd.StderrPipe() + if err != nil { + return err + } + + if err = cmd.Start(); err != nil { + return err + } + + defer func() { + err := cmd.Process.Kill() + if err != nil { + _, _ = fmt.Fprintf(GinkgoWriter, "Unable to kill process: %s", err) + } + }() + + localPort := 0 + + scanner := bufio.NewScanner(stdout) + portForwardRegex := regexp.MustCompile(`Forwarding from 127.0.0.1:(\d+) ->`) + + for scanner.Scan() { + line := scanner.Text() + + matches := portForwardRegex.FindStringSubmatch(line) + if matches != nil { + localPort, err = strconv.Atoi(matches[1]) + if err != nil { + return err + } + break + } + } + + if localPort != 0 { + if err = f(localPort); err != nil { + return err + } + } else { + content, _ := io.ReadAll(stderr) + + return fmt.Errorf("kubectl port-forward stderr: %s", content) + } + return nil + }, 60*time.Second, Interval).Should(BeNil()) +} + var _ = Describe("Operator smoke test", func() { var ctx context.Context var namespace corev1.Namespace @@ -602,6 +672,103 @@ var _ = Describe("Operator smoke test", func() { checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) }) + It("TLS for status service", func() { + tlsHTTPCheck := func(port int) error { + url := fmt.Sprintf("https://localhost:%d/", port) + cert, err := os.ReadFile(filepath.Join(".", "data", "ca.crt")) + Expect(err).ShouldNot(HaveOccurred()) + + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(cert) + Expect(ok).To(BeTrue()) + + tlsConfig := &tls.Config{ + MinVersion: tls.VersionTLS12, + RootCAs: certPool, + ServerName: "storage-grpc.ydb.svc.cluster.local", + } + + transport := &http.Transport{TLSClientConfig: tlsConfig} + client := &http.Client{ + Transport: transport, + Timeout: 10 * time.Second, + } + resp, err := client.Get(url) + if err != nil { + var netError net.Error + var opError *net.OpError + + // for database: operator sets database ready status before the database is actually can server requests. + if errors.As(err, &netError) && netError.Timeout() || errors.As(err, &opError) || errors.Is(err, io.EOF) { + return err + } + + Expect(err).ShouldNot(HaveOccurred()) + + } + + Expect(resp).To(HaveHTTPStatus(http.StatusOK)) + + return nil + } + + By("create secret...") + cert := testobjects.DefaultCertificate( + filepath.Join(".", "data", "tls.crt"), + filepath.Join(".", "data", "tls.key"), + filepath.Join(".", "data", "ca.crt"), + ) + Expect(k8sClient.Create(ctx, cert)).Should(Succeed()) + + By("create storage...") + storageSample.Spec.Service.Status.TLSConfiguration = &v1alpha1.TLSConfiguration{ + Enabled: true, + Certificate: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "tls.crt", + }, + Key: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "tls.key", + }, + CertificateAuthority: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "ca.crt", + }, + } + + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + + By("create database...") + databaseSample.Spec.Nodes = 1 + databaseSample.Spec.Service.Status = *storageSample.Spec.Service.Status.DeepCopy() + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + + By("waiting until Storage is ready...") + waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + + By("checking that all the storage pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + + By("forward storage status port and check that we can check TLS response") + portForward(ctx, + fmt.Sprintf(resources.StatusServiceNameFormat, storageSample.Name), storageSample.Namespace, + v1alpha1.StatusPort, tlsHTTPCheck, + ) + + By("waiting until database is ready...") + waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + + By("checking that all the database pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + + By("forward database status port and check that we can check TLS response") + portForward(ctx, + fmt.Sprintf(resources.StatusServiceNameFormat, databaseSample.Name), databaseSample.Namespace, + v1alpha1.StatusPort, tlsHTTPCheck, + ) + }) + AfterEach(func() { Expect(uninstallOperatorWithHelm(testobjects.YdbNamespace)).Should(BeTrue()) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) diff --git a/e2e/tests/test-objects/objects.go b/e2e/tests/test-objects/objects.go index d2b1e75e..d9fc5648 100644 --- a/e2e/tests/test-objects/objects.go +++ b/e2e/tests/test-objects/objects.go @@ -78,6 +78,9 @@ func DefaultStorage(storageYamlConfigPath string) *v1alpha1.Storage { }, Status: v1alpha1.StatusService{ Service: v1alpha1.Service{IPFamilies: []corev1.IPFamily{"IPv4"}}, + TLSConfiguration: &v1alpha1.TLSConfiguration{ + Enabled: false, + }, }, }, Monitoring: &v1alpha1.MonitoringOptions{ @@ -138,6 +141,9 @@ func DefaultDatabase() *v1alpha1.Database { }, Status: v1alpha1.StatusService{ Service: v1alpha1.Service{IPFamilies: []corev1.IPFamily{"IPv4"}}, + TLSConfiguration: &v1alpha1.TLSConfiguration{ + Enabled: false, + }, }, }, Datastreams: &v1alpha1.DatastreamsConfig{ diff --git a/internal/resources/database.go b/internal/resources/database.go index f1f3c06f..0214c253 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -17,6 +17,10 @@ type DatabaseBuilder struct { func NewDatabase(ydbCr *api.Database) DatabaseBuilder { cr := ydbCr.DeepCopy() + if cr.Spec.Service.Status.TLSConfiguration == nil { + cr.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} + } + return DatabaseBuilder{Database: cr, Storage: nil} } diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 1ad985a6..c9437b50 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -168,6 +168,18 @@ func (b *DatabaseStatefulSetBuilder) buildVolumes() []corev1.Volume { volumes = append(volumes, buildTLSVolume(interconnectTLSVolumeName, b.Spec.Service.Interconnect.TLSConfiguration)) } + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumes = append(volumes, + buildTLSVolume(statusOriginTLSVolumeName, b.Spec.Service.Status.TLSConfiguration), + corev1.Volume{ + Name: statusTLSVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + ) + } + if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { volumes = append(volumes, b.buildEncryptionVolume()) } @@ -218,6 +230,7 @@ func (b *DatabaseStatefulSetBuilder) buildCaStorePatchingInitContainer() corev1. b.Spec.CABundle, b.Spec.Service.GRPC, b.Spec.Service.Interconnect, + b.Spec.Service.Status, ) imagePullPolicy := corev1.PullIfNotPresent if b.Spec.Image.PullPolicyName != nil { @@ -292,6 +305,19 @@ func (b *DatabaseStatefulSetBuilder) buildCaStorePatchingInitContainerVolumeMoun MountPath: datastreamsTLSVolumeMountPath, }) } + + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusOriginTLSVolumeName, + ReadOnly: true, + MountPath: statusOriginTLSVolumeMountPath, + }) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusTLSVolumeName, + MountPath: statusTLSVolumeMountPath, + }) + } + return volumeMounts } @@ -448,6 +474,14 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { }) } + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusTLSVolumeName, + ReadOnly: true, + MountPath: statusTLSVolumeMountPath, + }) + } + if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: encryptionVolumeName, @@ -549,6 +583,13 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { ) } + if b.Spec.Service.Status.TLSConfiguration.Enabled { + args = append(args, + "--mon-cert", + fmt.Sprintf("%s/%s", statusTLSVolumeMountPath, statusBundleFileName), + ) + } + for _, secret := range b.Spec.Secrets { exist, err := CheckSecretKey( context.Background(), diff --git a/internal/resources/resource.go b/internal/resources/resource.go index a9d60517..f9dec308 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -40,10 +40,14 @@ const ( grpcTLSVolumeName = "grpc-tls-volume" interconnectTLSVolumeName = "interconnect-tls-volume" datastreamsTLSVolumeName = "datastreams-tls-volume" + statusTLSVolumeName = "status-tls-volume" + statusOriginTLSVolumeName = "status-origin-tls-volume" grpcTLSVolumeMountPath = "/tls/grpc" interconnectTLSVolumeMountPath = "/tls/interconnect" datastreamsTLSVolumeMountPath = "/tls/datastreams" + statusTLSVolumeMountPath = "/tls/status" + statusOriginTLSVolumeMountPath = "/tls/status-origin" InitJobNameFormat = "%s-blobstorage-init" OperatorTokenSecretNameFormat = "%s-operator-token" @@ -63,6 +67,7 @@ const ( caBundleFileName = "userCABundle.crt" caCertificatesFileName = "ca-certificates.crt" updateCACertificatesBin = "update-ca-certificates" + statusBundleFileName = "web.pem" localCertsDir = "/usr/local/share/ca-certificates" systemCertsDir = "/etc/ssl/certs" @@ -503,6 +508,7 @@ func buildCAStorePatchingCommandArgs( caBundle string, grpcService api.GRPCService, interconnectService api.InterconnectService, + statusService api.StatusService, ) ([]string, []string) { command := []string{"/bin/bash", "-c"} @@ -520,6 +526,16 @@ func buildCAStorePatchingCommandArgs( arg += fmt.Sprintf("cp %s/%s %s/interconnectRoot.crt && ", interconnectTLSVolumeMountPath, wellKnownNameForTLSCertificateAuthority, localCertsDir) } + if statusService.TLSConfiguration != nil && statusService.TLSConfiguration.Enabled { + arg += fmt.Sprintf("cp %s/%s %s/web.crt && ", statusOriginTLSVolumeMountPath, wellKnownNameForTLSCertificateAuthority, localCertsDir) + arg += fmt.Sprintf("cat %s/%s %s/%s %s/%s > %s/%s && ", + statusOriginTLSVolumeMountPath, wellKnownNameForTLSPrivateKey, + statusOriginTLSVolumeMountPath, wellKnownNameForTLSCertificate, + statusOriginTLSVolumeMountPath, wellKnownNameForTLSCertificateAuthority, + statusTLSVolumeMountPath, statusBundleFileName, + ) + } + if arg != "" { arg += updateCACertificatesBin } diff --git a/internal/resources/storage.go b/internal/resources/storage.go index ced81300..d8f69751 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -16,6 +16,10 @@ type StorageClusterBuilder struct { func NewCluster(ydbCr *api.Storage) StorageClusterBuilder { cr := ydbCr.DeepCopy() + if cr.Spec.Service.Status.TLSConfiguration == nil { + cr.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} + } + return StorageClusterBuilder{cr} } diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index 88d588e6..0507623e 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -278,6 +278,7 @@ func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainer() corev1.Conta b.Spec.CABundle, b.Spec.Service.GRPC, b.Spec.Service.Interconnect, + api.StatusService{TLSConfiguration: &api.TLSConfiguration{Enabled: false}}, ) imagePullPolicy := corev1.PullIfNotPresent if b.Spec.Image.PullPolicyName != nil { diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 61fd1e5d..7a92f2cc 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -212,6 +212,18 @@ func (b *StorageStatefulSetBuilder) buildVolumes() []corev1.Volume { volumes = append(volumes, buildTLSVolume(interconnectTLSVolumeName, b.Spec.Service.Interconnect.TLSConfiguration)) } + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumes = append(volumes, + buildTLSVolume(statusOriginTLSVolumeName, b.Spec.Service.Status.TLSConfiguration), + corev1.Volume{ + Name: statusTLSVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + ) + } + for _, secret := range b.Spec.Secrets { volumes = append(volumes, corev1.Volume{ Name: secret.Name, @@ -251,6 +263,7 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainer() corev1.C b.Spec.CABundle, b.Spec.Service.GRPC, b.Spec.Service.Interconnect, + b.Spec.Service.Status, ) containerResources := corev1.ResourceRequirements{} if b.Spec.Resources != nil { @@ -315,6 +328,20 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainerVolumeMount MountPath: interconnectTLSVolumeMountPath, }) } + + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusOriginTLSVolumeName, + ReadOnly: true, + MountPath: statusOriginTLSVolumeMountPath, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusTLSVolumeName, + MountPath: statusTLSVolumeMountPath, + }) + } + return volumeMounts } @@ -419,6 +446,14 @@ func (b *StorageStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { }) } + if b.Spec.Service.Status.TLSConfiguration.Enabled { + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: statusTLSVolumeName, + ReadOnly: true, + MountPath: statusTLSVolumeMountPath, + }) + } + if b.AnyCertificatesAdded() { volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: localCertsVolumeName, @@ -471,6 +506,13 @@ func (b *StorageStatefulSetBuilder) buildContainerArgs() ([]string, []string) { fmt.Sprintf("%s=%s", api.LabelDeploymentKey, api.LabelDeploymentValueKubernetes), ) + if b.Spec.Service.Status.TLSConfiguration.Enabled { + args = append(args, + "--mon-cert", + fmt.Sprintf("%s/%s", statusTLSVolumeMountPath, statusBundleFileName), + ) + } + for _, secret := range b.Spec.Secrets { exist, err := CheckSecretKey( context.Background(), From e4e82e6856d3e48aa1d574700ff8ea0b966c6a78 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:49:44 +0300 Subject: [PATCH 04/70] bump e2e tests timeout to 1 hour (#222) --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7d58fb15..8221c258 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -163,7 +163,7 @@ jobs: kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 - name: run-tests run: | - go test -v -timeout 1800s -p 1 ./... -args -ginkgo.v + go test -v -timeout 3600s -p 1 ./... -args -ginkgo.v - name: teardown-k8s-cluster run: | kind delete cluster From d91bb38631091100242222b721005df79c1f7690 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:05:39 +0300 Subject: [PATCH 05/70] oauth2 token exchange credentials (#213) --- api/v1alpha1/connection_types.go | 23 +++++++- api/v1alpha1/zz_generated.deepcopy.go | 65 +++++++++++++++++++++ deploy/ydb-operator/Chart.yaml | 4 +- deploy/ydb-operator/crds/storage.yaml | 44 ++++++++++++++ go.mod | 24 ++++---- go.sum | 47 +++++++-------- internal/cms/tenant.go | 2 +- internal/connection/connection.go | 2 +- internal/healthcheck/healthcheck.go | 2 +- internal/resources/resource.go | 82 ++++++++++++++++++++++++++- 10 files changed, 251 insertions(+), 44 deletions(-) diff --git a/api/v1alpha1/connection_types.go b/api/v1alpha1/connection_types.go index 05e67156..981ac10f 100644 --- a/api/v1alpha1/connection_types.go +++ b/api/v1alpha1/connection_types.go @@ -5,8 +5,9 @@ import ( ) type ConnectionOptions struct { - AccessToken *AccessTokenAuth `json:"accessToken,omitempty"` - StaticCredentials *StaticCredentialsAuth `json:"staticCredentials,omitempty"` + AccessToken *AccessTokenAuth `json:"accessToken,omitempty"` + StaticCredentials *StaticCredentialsAuth `json:"staticCredentials,omitempty"` + Oauth2TokenExhange *Oauth2TokenExchange `json:"oauth2TokenExchange,omitempty"` } type AccessTokenAuth struct { @@ -18,6 +19,24 @@ type StaticCredentialsAuth struct { Password *CredentialSource `json:"password,omitempty"` } +type Oauth2TokenExchange struct { + Endpoint string `json:"endpoint"` + PrivateKey *CredentialSource `json:"privateKey"` + JWTHeader *JWTHeader `json:",inline"` + JWTClaims *JWTClaims `json:",inline"` +} + +type JWTHeader struct { + KeyID string `json:"keyID,omitempty"` + SignAlg string `json:"signAlg,omitempty"` +} +type JWTClaims struct { + Issuer string `json:"issuer,omitempty"` + Subject string `json:"subject,omitempty"` + Audience string `json:"audience,omitempty"` + ID string `json:"id,omitempty"` +} + type CredentialSource struct { SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef"` } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 3f687fa4..1d4de76b 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -45,6 +45,11 @@ func (in *ConnectionOptions) DeepCopyInto(out *ConnectionOptions) { *out = new(StaticCredentialsAuth) (*in).DeepCopyInto(*out) } + if in.Oauth2TokenExhange != nil { + in, out := &in.Oauth2TokenExhange, &out.Oauth2TokenExhange + *out = new(Oauth2TokenExchange) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionOptions. @@ -713,6 +718,36 @@ func (in *InterconnectService) DeepCopy() *InterconnectService { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JWTClaims) DeepCopyInto(out *JWTClaims) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTClaims. +func (in *JWTClaims) DeepCopy() *JWTClaims { + if in == nil { + return nil + } + out := new(JWTClaims) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JWTHeader) DeepCopyInto(out *JWTHeader) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTHeader. +func (in *JWTHeader) DeepCopy() *JWTHeader { + if in == nil { + return nil + } + out := new(JWTHeader) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MonitoringOptions) DeepCopyInto(out *MonitoringOptions) { *out = *in @@ -754,6 +789,36 @@ func (in *NamespacedRef) DeepCopy() *NamespacedRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Oauth2TokenExchange) DeepCopyInto(out *Oauth2TokenExchange) { + *out = *in + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(CredentialSource) + (*in).DeepCopyInto(*out) + } + if in.JWTHeader != nil { + in, out := &in.JWTHeader, &out.JWTHeader + *out = new(JWTHeader) + **out = **in + } + if in.JWTClaims != nil { + in, out := &in.JWTClaims, &out.JWTClaims + *out = new(JWTClaims) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Oauth2TokenExchange. +func (in *Oauth2TokenExchange) DeepCopy() *Oauth2TokenExchange { + if in == nil { + return nil + } + out := new(Oauth2TokenExchange) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodImage) DeepCopyInto(out *PodImage) { *out = *in diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 166eee86..fd6941cd 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.14 +version: 0.5.15 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.14" +appVersion: "0.5.15" diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index 650c39c1..de5a5ecc 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -4858,6 +4858,50 @@ spec: required: - secretKeyRef type: object + oauth2TokenExchange: + properties: + audience: + type: string + endpoint: + type: string + id: + type: string + issuer: + type: string + keyID: + type: string + privateKey: + properties: + secretKeyRef: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + 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 + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + required: + - secretKeyRef + type: object + signAlg: + type: string + subject: + type: string + required: + - endpoint + - privateKey + type: object staticCredentials: properties: password: diff --git a/go.mod b/go.mod index 62ecc675..708ba90d 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,16 @@ go 1.20 require ( github.com/banzaicloud/k8s-objectmatcher v1.7.0 github.com/go-logr/logr v1.2.4 + github.com/golang-jwt/jwt/v4 v4.4.1 github.com/google/go-cmp v0.5.9 github.com/onsi/ginkgo/v2 v2.9.4 github.com/onsi/gomega v1.27.6 github.com/pkg/errors v0.9.1 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.50.0 - github.com/ydb-platform/ydb-go-genproto v0.0.0-20230801151335-81e01be38941 - github.com/ydb-platform/ydb-go-sdk/v3 v3.53.0 - google.golang.org/grpc v1.53.0 - google.golang.org/protobuf v1.28.1 + github.com/ydb-platform/ydb-go-genproto v0.0.0-20240528144234-5d5a685e41f7 + github.com/ydb-platform/ydb-go-sdk/v3 v3.74.2 + google.golang.org/grpc v1.57.1 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.26.1 k8s.io/apimachinery v0.26.1 @@ -38,7 +39,6 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.6.9 // indirect @@ -63,17 +63,17 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.4.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.9.1 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/apiextensions-apiserver v0.26.1 // indirect diff --git a/go.sum b/go.sum index d51cc5f9..ddea8dc7 100644 --- a/go.sum +++ b/go.sum @@ -182,7 +182,6 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -348,6 +347,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/rekby/fixenv v0.6.1 h1:jUFiSPpajT4WY2cYuc++7Y1zWrnCxnovGCIX72PZniM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -394,10 +394,10 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/ydb-platform/ydb-go-genproto v0.0.0-20230801151335-81e01be38941 h1:QXgmY0vkYtOoGEXnTjWkyxhOkIzCosMrnoDyYjrv71Q= -github.com/ydb-platform/ydb-go-genproto v0.0.0-20230801151335-81e01be38941/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I= -github.com/ydb-platform/ydb-go-sdk/v3 v3.53.0 h1:fnObls3EJwvjH1L9QHAipazN26Hp924rzeMRv9iu788= -github.com/ydb-platform/ydb-go-sdk/v3 v3.53.0/go.mod h1:YBBMbkISt0UKjrO5JQYjM7xkOBbHoNXKJskiHhpETxQ= +github.com/ydb-platform/ydb-go-genproto v0.0.0-20240528144234-5d5a685e41f7 h1:nL8XwD6fSst7xFUirkaWJmE7kM0CdWRYgu6+YQer1d4= +github.com/ydb-platform/ydb-go-genproto v0.0.0-20240528144234-5d5a685e41f7/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I= +github.com/ydb-platform/ydb-go-sdk/v3 v3.74.2 h1:aciEkENbBcpRVGwU9+EPyC/cdXqiGU9cqc75LN7wxfY= +github.com/ydb-platform/ydb-go-sdk/v3 v3.74.2/go.mod h1:ZXl2InwGFiZKojWCsj6tW/SGFbch7zaehQWX5CjXMEI= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -412,6 +412,7 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -463,14 +464,14 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -478,8 +479,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -505,11 +506,11 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -517,8 +518,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -562,8 +563,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -574,8 +575,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= +google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -590,8 +591,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/cms/tenant.go b/internal/cms/tenant.go index faad8c2f..fade9448 100644 --- a/internal/cms/tenant.go +++ b/internal/cms/tenant.go @@ -8,7 +8,7 @@ import ( "github.com/ydb-platform/ydb-go-genproto/Ydb_Cms_V1" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Cms" - "github.com/ydb-platform/ydb-go-sdk/v3" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" ydbCredentials "github.com/ydb-platform/ydb-go-sdk/v3/credentials" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/internal/connection/connection.go b/internal/connection/connection.go index 38e42767..5c99c6c0 100644 --- a/internal/connection/connection.go +++ b/internal/connection/connection.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/ydb-platform/ydb-go-sdk/v3" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" diff --git a/internal/healthcheck/healthcheck.go b/internal/healthcheck/healthcheck.go index 39de6dbe..bd778661 100644 --- a/internal/healthcheck/healthcheck.go +++ b/internal/healthcheck/healthcheck.go @@ -6,7 +6,7 @@ import ( "github.com/ydb-platform/ydb-go-genproto/Ydb_Monitoring_V1" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Monitoring" - "github.com/ydb-platform/ydb-go-sdk/v3" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" ydbCredentials "github.com/ydb-platform/ydb-go-sdk/v3/credentials" "google.golang.org/protobuf/proto" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/internal/resources/resource.go b/internal/resources/resource.go index f9dec308..7a443ebe 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -8,7 +8,8 @@ import ( "fmt" "github.com/banzaicloud/k8s-objectmatcher/patch" - "github.com/ydb-platform/ydb-go-sdk/v3" + "github.com/golang-jwt/jwt/v4" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" ydbCredentials "github.com/ydb-platform/ydb-go-sdk/v3/credentials" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -425,7 +426,69 @@ func getYDBStaticCredentials( if err != nil { return nil, err } - return ydbCredentials.NewStaticCredentials(username, password, endpoint, dialOptions), nil + + return ydbCredentials.NewStaticCredentials( + username, + password, + endpoint, + ydbCredentials.WithGrpcDialOptions(dialOptions), + ), nil +} + +func getYDBOauth2Credentials( + ctx context.Context, + storage *api.Storage, + restConfig *rest.Config, +) (ydbCredentials.Credentials, error) { + auth := storage.Spec.OperatorConnection + privateKey, err := GetSecretKey( + ctx, + storage.Namespace, + restConfig, + auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to get RSA private key for Oauth2TokenExchange from secret: %s, key: %s, error: %w", + auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Name, + auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Key, + err) + } + privateKeyPEM, err := jwt.ParseRSAPrivateKeyFromPEM([]byte(privateKey)) + if err != nil { + return nil, fmt.Errorf( + "failed to parse RSA private key for Oauth2TokenExchange from secret: %s, key: %s, error: %w", + auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Name, + auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Key, + err, + ) + } + + var signMethod jwt.SigningMethod + if auth.Oauth2TokenExhange.JWTHeader.SignAlg != "" { + if !isSignAlgorithmSupported(auth.Oauth2TokenExhange.JWTHeader.SignAlg) { + return nil, fmt.Errorf( + "sign algorithm %s does not supported", + auth.Oauth2TokenExhange.JWTHeader.SignAlg, + ) + } + signMethod = jwt.GetSigningMethod(auth.Oauth2TokenExhange.JWTHeader.SignAlg) + } else { + signMethod = jwt.SigningMethodRS256 + } + + return ydbCredentials.NewOauth2TokenExchangeCredentials( + ydbCredentials.WithTokenEndpoint(auth.Oauth2TokenExhange.Endpoint), + ydbCredentials.WithAudience(auth.Oauth2TokenExhange.JWTClaims.Audience), + ydbCredentials.WithJWTSubjectToken( + ydbCredentials.WithSigningMethod(signMethod), + ydbCredentials.WithPrivateKey(privateKeyPEM), + ydbCredentials.WithKeyID(auth.Oauth2TokenExhange.JWTHeader.KeyID), + ydbCredentials.WithAudience(auth.Oauth2TokenExhange.JWTClaims.Audience), + ydbCredentials.WithIssuer(auth.Oauth2TokenExhange.JWTClaims.Issuer), + ydbCredentials.WithSubject(auth.Oauth2TokenExhange.JWTClaims.Subject), + ydbCredentials.WithID(auth.Oauth2TokenExhange.JWTClaims.ID), + )) } func GetYDBCredentials( @@ -460,6 +523,10 @@ func GetYDBCredentials( return getYDBStaticCredentials(ctx, storage, restConfig) } + if auth.Oauth2TokenExhange != nil { + return getYDBOauth2Credentials(ctx, storage, restConfig) + } + return nil, errors.New("unsupported auth type for GetYDBCredentials") } @@ -550,3 +617,14 @@ func GetConfigurationChecksum(configuration string) string { hasher.Write([]byte(configuration)) return hex.EncodeToString(hasher.Sum(nil)) } + +func isSignAlgorithmSupported(alg string) bool { + supportedAlgs := jwt.GetAlgorithms() + + for _, supportedAlg := range supportedAlgs { + if alg == supportedAlg { + return true + } + } + return false +} From 0b791fa9b8f5bfe03f61362a86215cba2eb451e2 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:12:50 +0300 Subject: [PATCH 06/70] YDBOPS-9608 support dynconfig (#200) --- Makefile | 2 +- api/v1alpha1/configuration.go | 71 +++++--- api/v1alpha1/database_webhook.go | 6 +- api/v1alpha1/storage_webhook.go | 112 ++++++------- .../data/storage-block-4-2-config-tls.yaml | 2 +- .../configuration/schema/configuration.go | 24 ++- internal/configuration/schema/domains.go | 9 ++ internal/configuration/schema/schema_test.go | 152 ++++++++++++++++++ internal/resources/database.go | 2 +- internal/resources/storage.go | 42 +++-- 10 files changed, 318 insertions(+), 104 deletions(-) create mode 100644 internal/configuration/schema/domains.go create mode 100644 internal/configuration/schema/schema_test.go diff --git a/Makefile b/Makefile index 5c590350..03c416e9 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ kind-load: .PHONY: unit-test unit-test: manifests generate fmt vet envtest ## Run unit tests - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 1800s -p 1 ./internal/controllers/... -ginkgo.v -coverprofile cover.out + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 1800s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out .PHONY: e2e-test e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index 0af5763f..07cdda19 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -1,6 +1,7 @@ package v1alpha1 import ( + "bytes" "crypto/sha256" "fmt" "path" @@ -24,7 +25,7 @@ func hash(text string) string { return fmt.Sprintf("%x", h.Sum(nil)) } -func generateSomeDefaults(cr *Storage, crDB *Database) schema.Configuration { +func generateHosts(cr *Storage) []schema.Host { var hosts []schema.Host for i := 0; i < int(cr.Spec.Nodes); i++ { @@ -57,6 +58,10 @@ func generateSomeDefaults(cr *Storage, crDB *Database) schema.Configuration { } } + return hosts +} + +func generateKeyConfig(cr *Storage, crDB *Database) *schema.KeyConfig { var keyConfig *schema.KeyConfig if crDB != nil && crDB.Spec.Encryption != nil && crDB.Spec.Encryption.Enabled { keyConfig = &schema.KeyConfig{ @@ -71,25 +76,10 @@ func generateSomeDefaults(cr *Storage, crDB *Database) schema.Configuration { } } - return schema.Configuration{ - Hosts: hosts, - KeyConfig: keyConfig, - } + return keyConfig } -func tryFillMissingSections( - resultConfig map[string]interface{}, - generatedConfig schema.Configuration, -) { - if resultConfig["hosts"] == nil { - resultConfig["hosts"] = generatedConfig.Hosts - } - if generatedConfig.KeyConfig != nil { - resultConfig["key_config"] = generatedConfig.KeyConfig - } -} - -func BuildConfiguration(cr *Storage, crDB *Database) (string, error) { +func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { config := make(map[string]interface{}) // If any kind of configuration exists on Database object, then @@ -103,18 +93,47 @@ func BuildConfiguration(cr *Storage, crDB *Database) (string, error) { rawYamlConfiguration = cr.Spec.Configuration } - err := yaml.Unmarshal([]byte(rawYamlConfiguration), &config) + dynconfig, err := ParseDynconfig(rawYamlConfiguration) + if err == nil { + if dynconfig.Config["hosts"] == nil { + hosts := generateHosts(cr) + dynconfig.Config["hosts"] = hosts + } + + return yaml.Marshal(dynconfig) + } + + err = yaml.Unmarshal([]byte(rawYamlConfiguration), &config) if err != nil { - return "", err + return nil, err } - generatedConfig := generateSomeDefaults(cr, crDB) - tryFillMissingSections(config, generatedConfig) + if config["hosts"] == nil { + hosts := generateHosts(cr) + config["hosts"] = hosts + } - data, err := yaml.Marshal(config) - if err != nil { - return "", err + // Will be removed by YDBOPS-9692 + keyConfig := generateKeyConfig(cr, crDB) + if keyConfig != nil { + config["key_config"] = keyConfig } - return string(data), nil + return yaml.Marshal(config) +} + +func ParseConfig(rawYamlConfiguration string) (schema.Configuration, error) { + config := schema.Configuration{} + dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) + dec.KnownFields(false) + err := dec.Decode(&config) + return config, err +} + +func ParseDynconfig(rawYamlConfiguration string) (schema.Dynconfig, error) { + dynconfig := schema.Dynconfig{} + dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) + dec.KnownFields(true) + err := dec.Decode(&dynconfig) + return dynconfig, err } diff --git a/api/v1alpha1/database_webhook.go b/api/v1alpha1/database_webhook.go index 424a4490..b2197b9c 100644 --- a/api/v1alpha1/database_webhook.go +++ b/api/v1alpha1/database_webhook.go @@ -58,6 +58,10 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err database := obj.(*Database) databaselog.Info("default", "name", database.Name) + if !database.Spec.OperatorSync { + return nil + } + if database.Spec.StorageClusterRef.Namespace == "" { database.Spec.StorageClusterRef.Namespace = database.Namespace } @@ -150,7 +154,7 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err if err != nil { return err } - database.Spec.Configuration = configuration + database.Spec.Configuration = string(configuration) } return nil diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index a6f1f28f..2bc98c11 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -61,18 +61,15 @@ func (r *Storage) GetGRPCServiceEndpoint() string { return fmt.Sprintf("%s:%d", host, GRPCPort) } -// +k8s:deepcopy-gen=false -type PartialHostsConfig struct { - Hosts []schema.Host `yaml:"hosts,flow"` -} - func (r *Storage) GetHostFromConfigEndpoint() string { + configuration := make(map[string]interface{}) + // skip handle error because we already checked in webhook - hostsConfig := PartialHostsConfig{} - _ = yaml.Unmarshal([]byte(r.Spec.Configuration), &hostsConfig) + _ = yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) + hostsConfig := configuration["hosts"].([]schema.Host) randNum := rand.Int31n(r.Spec.Nodes) // #nosec G404 - host := hostsConfig.Hosts[randNum].Host + host := hostsConfig[randNum].Host return fmt.Sprintf("%s:%d", host, GRPCPort) } @@ -97,15 +94,6 @@ func (r *Storage) IsRemoteNodeSetsOnly() bool { return true } -// +k8s:deepcopy-gen=false -type PartialDomainsConfig struct { - DomainsConfig struct { - SecurityConfig struct { - EnforceUserTokenRequirement bool `yaml:"enforce_user_token_requirement"` - } `yaml:"security_config"` - } `yaml:"domains_config"` -} - // StorageDefaulter mutates Storages // +k8s:deepcopy-gen=false type StorageDefaulter struct { @@ -119,6 +107,10 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro storage := obj.(*Storage) storagelog.Info("default", "name", storage.Name) + if !storage.Spec.OperatorSync { + return nil + } + if storage.Spec.Image == nil { storage.Spec.Image = &PodImage{} } @@ -174,7 +166,7 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro if err != nil { return err } - storage.Spec.Configuration = configuration + storage.Spec.Configuration = string(configuration) return nil } @@ -187,23 +179,28 @@ var _ webhook.Validator = &Storage{} func (r *Storage) ValidateCreate() error { storagelog.Info("validate create", "name", r.Name) - configuration := make(map[string]interface{}) - err := yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) - if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + var configuration schema.Configuration + + rawYamlConfiguration := r.Spec.Configuration + dynconfig, err := ParseDynconfig(r.Spec.Configuration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) + } + rawYamlConfiguration = string(config) } - hostsConfig := PartialHostsConfig{} - err = yaml.Unmarshal([]byte(r.Spec.Configuration), &hostsConfig) + configuration, err = ParseConfig(rawYamlConfiguration) if err != nil { - return fmt.Errorf("failed to parse YAML to determine `hosts`, error: %w", err) + return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) } var nodesNumber int32 - if len(hostsConfig.Hosts) == 0 { + if len(configuration.Hosts) == 0 { nodesNumber = r.Spec.Nodes } else { - nodesNumber = int32(len(hostsConfig.Hosts)) + nodesNumber = int32(len(configuration.Hosts)) } minNodesPerErasure := map[ErasureType]int32{ @@ -215,15 +212,11 @@ func (r *Storage) ValidateCreate() error { return fmt.Errorf("erasure type %v requires at least %v storage nodes", r.Spec.Erasure, minNodesPerErasure[r.Spec.Erasure]) } - yamlConfig := PartialDomainsConfig{} - err = yaml.Unmarshal([]byte(r.Spec.Configuration), &yamlConfig) - if err != nil { - return fmt.Errorf("failed to parse YAML to determine `enforce_user_token_requirement`, error: %w", err) - } - var authEnabled bool - if yamlConfig.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement { - authEnabled = true + if configuration.DomainsConfig.SecurityConfig != nil { + if configuration.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement != nil { + authEnabled = *configuration.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement + } } if (authEnabled && r.Spec.OperatorConnection == nil) || (!authEnabled && r.Spec.OperatorConnection != nil) { @@ -285,23 +278,28 @@ func hasUpdatesBesidesFrozen(oldStorage, newStorage *Storage) (bool, string) { func (r *Storage) ValidateUpdate(old runtime.Object) error { storagelog.Info("validate update", "name", r.Name) - configuration := make(map[string]interface{}) - err := yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) - if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + var configuration schema.Configuration + + rawYamlConfiguration := r.Spec.Configuration + dynconfig, err := ParseDynconfig(r.Spec.Configuration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) + } + rawYamlConfiguration = string(config) } - hostsConfig := PartialHostsConfig{} - err = yaml.Unmarshal([]byte(r.Spec.Configuration), &hostsConfig) + configuration, err = ParseConfig(rawYamlConfiguration) if err != nil { - return fmt.Errorf("failed to parse YAML to determine `hosts`, error: %w", err) + return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) } var nodesNumber int32 - if len(hostsConfig.Hosts) == 0 { + if len(configuration.Hosts) == 0 { nodesNumber = r.Spec.Nodes } else { - nodesNumber = int32(len(hostsConfig.Hosts)) + nodesNumber = int32(len(configuration.Hosts)) } minNodesPerErasure := map[ErasureType]int32{ @@ -313,6 +311,17 @@ func (r *Storage) ValidateUpdate(old runtime.Object) error { return fmt.Errorf("erasure type %v requires at least %v storage nodes", r.Spec.Erasure, minNodesPerErasure[r.Spec.Erasure]) } + var authEnabled bool + if configuration.DomainsConfig.SecurityConfig != nil { + if configuration.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement != nil { + authEnabled = *configuration.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement + } + } + + if (authEnabled && r.Spec.OperatorConnection == nil) || (!authEnabled && r.Spec.OperatorConnection != nil) { + return fmt.Errorf("field 'spec.operatorConnection' does not align with config option `enforce_user_token_requirement: %t`", authEnabled) + } + if !r.Spec.OperatorSync { oldStorage := old.(*Storage) @@ -331,21 +340,6 @@ func (r *Storage) ValidateUpdate(old runtime.Object) error { } } - yamlConfig := PartialDomainsConfig{} - err = yaml.Unmarshal([]byte(r.Spec.Configuration), &yamlConfig) - if err != nil { - return fmt.Errorf("failed to parse YAML to determine `enforce_user_token_requirement`, error: %w", err) - } - - var authEnabled bool - if yamlConfig.DomainsConfig.SecurityConfig.EnforceUserTokenRequirement { - authEnabled = true - } - - if (authEnabled && r.Spec.OperatorConnection == nil) || (!authEnabled && r.Spec.OperatorConnection != nil) { - return fmt.Errorf("field 'spec.operatorConnection' does not align with config option `enforce_user_token_requirement: %t`", authEnabled) - } - if r.Spec.NodeSets != nil { var nodesInSetsCount int32 for _, nodeSetInline := range r.Spec.NodeSets { diff --git a/e2e/tests/data/storage-block-4-2-config-tls.yaml b/e2e/tests/data/storage-block-4-2-config-tls.yaml index 33948d8d..bfb0498c 100644 --- a/e2e/tests/data/storage-block-4-2-config-tls.yaml +++ b/e2e/tests/data/storage-block-4-2-config-tls.yaml @@ -102,7 +102,7 @@ channel_profile_config: grpc_config: start_grpc_proxy: true ssl_port: 2135 - ca: /tls/grpc/ca.crt + ca: /etc/ssl/certs/ca-certificates.crt cert: /tls/grpc/tls.crt key: /tls/grpc/tls.key grpc_memory_quota_bytes: '1073741824' diff --git a/internal/configuration/schema/configuration.go b/internal/configuration/schema/configuration.go index b446a099..8847af52 100644 --- a/internal/configuration/schema/configuration.go +++ b/internal/configuration/schema/configuration.go @@ -1,6 +1,26 @@ package schema +type Dynconfig struct { + Metadata *Metadata `yaml:"metadata"` + Config map[string]interface{} `yaml:"config"` + AllowedLabels map[string]interface{} `yaml:"allowed_labels"` + SelectorConfig []SelectorConfig `yaml:"selector_config"` +} type Configuration struct { - Hosts []Host `yaml:"hosts"` - KeyConfig *KeyConfig `yaml:"key_config,omitempty"` + DomainsConfig *DomainsConfig `yaml:"domains_config"` + Hosts []Host `yaml:"hosts,omitempty"` + KeyConfig *KeyConfig `yaml:"key_config,omitempty"` +} + +type Metadata struct { + Kind string `yaml:"kind"` + Cluster string `yaml:"cluster"` + Version uint64 `yaml:"version"` + ID uint64 `yaml:"id,omitempty"` +} + +type SelectorConfig struct { + Description string `yaml:"description"` + Selector map[string]interface{} `yaml:"selector"` + Config map[string]interface{} `yaml:"config"` } diff --git a/internal/configuration/schema/domains.go b/internal/configuration/schema/domains.go new file mode 100644 index 00000000..8362f8a2 --- /dev/null +++ b/internal/configuration/schema/domains.go @@ -0,0 +1,9 @@ +package schema + +type DomainsConfig struct { + SecurityConfig *SecurityConfig `yaml:"security_config,omitempty"` +} + +type SecurityConfig struct { + EnforceUserTokenRequirement *bool `yaml:"enforce_user_token_requirement,omitempty"` +} diff --git a/internal/configuration/schema/schema_test.go b/internal/configuration/schema/schema_test.go new file mode 100644 index 00000000..c2553305 --- /dev/null +++ b/internal/configuration/schema/schema_test.go @@ -0,0 +1,152 @@ +package schema_test + +import ( + "fmt" + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/configuration/schema" +) + +//nolint:all +var configurationExample = ` +--- +yaml_config_enabled: true +domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: block-4-2 + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: [1, 2, 3, 4, 5, 6, 7, 8] + nto_select: 5 + ssid: 1 +hosts: +- host: storage-0 + walle_location: {body: 0, data_center: 'dcExample', rack: '0'} + node_id: 1 + host_config_id: 1 +- host: storage-1 + walle_location: {body: 1, data_center: 'dcExample', rack: '1'} + node_id: 2 + host_config_id: 1 +- host: storage-2 + walle_location: {body: 2, data_center: 'dcExample', rack: '2'} + node_id: 3 + host_config_id: 1 +- host: storage-3 + walle_location: {body: 3, data_center: 'dcExample', rack: '3'} + node_id: 4 + host_config_id: 1 +- host: storage-4 + walle_location: {body: 4, data_center: 'dcExample', rack: '4'} + node_id: 5 + host_config_id: 1 +- host: storage-5 + walle_location: {body: 5, data_center: 'dcExample', rack: '5'} + node_id: 6 + host_config_id: 1 +- host: storage-6 + walle_location: {body: 6, data_center: 'dcExample', rack: '6'} + node_id: 7 + host_config_id: 1 +- host: storage-7 + walle_location: {body: 7, data_center: 'dcExample', rack: '7'} + node_id: 8 + host_config_id: 1 +key_config: + keys: + - container_path: "/opt/ydb/secrets/database_encryption/key" + id: "1" + version: 1 +` + +var dynconfigExample = ` +--- +metadata: + kind: MainConfig + version: 0 + cluster: "unknown" + # comment1 +selector_config: +- description: actor system config for dynnodes + selector: + node_type: slot + config: + actor_system_config: + cpu_count: 10 + node_type: COMPUTE + use_auto_config: true +allowed_labels: + node_id: + type: string + host: + type: string + tenant: + type: string +config: + yaml_config_enabled: true +` + +func TestSchema(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Shema suite") +} + +var _ = Describe("Testing schema", func() { + It("Parse dynconfig", func() { + dynconfig, err := v1alpha1.ParseDynconfig(dynconfigExample) + Expect(err).ShouldNot(HaveOccurred()) + Expect(*dynconfig.Metadata).Should(BeEquivalentTo(schema.Metadata{ + Kind: "MainConfig", + Version: 0, + Cluster: "unknown", + })) + Expect(dynconfig.Config["yaml_config_enabled"]).Should(BeTrue()) + }) + + It("Try parse static config as dynconfig", func() { + _, err := v1alpha1.ParseDynconfig(configurationExample) + Expect(err).Should(HaveOccurred()) + }) + + It("Parse static config", func() { + yamlConfig, err := v1alpha1.ParseConfig(configurationExample) + Expect(err).ShouldNot(HaveOccurred()) + hosts := []schema.Host{} + for i := 0; i < 8; i++ { + hosts = append(hosts, schema.Host{ + Host: fmt.Sprintf("storage-%d", i), + NodeID: i + 1, + HostConfigID: 1, + WalleLocation: schema.WalleLocation{ + Body: i, + DataCenter: "dcExample", + Rack: fmt.Sprint(i), + }, + }) + } + Expect(yamlConfig.Hosts).Should(BeEquivalentTo(hosts)) + Expect(*yamlConfig.KeyConfig).Should(BeEquivalentTo(schema.KeyConfig{ + Keys: []schema.Key{ + { + ContainerPath: "/opt/ydb/secrets/database_encryption/key", + ID: "1", + Version: 1, + }, + }, + })) + }) +}) diff --git a/internal/resources/database.go b/internal/resources/database.go index 0214c253..6d17a1d9 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -64,7 +64,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Name: b.GetName(), Data: map[string]string{ - api.ConfigFileName: cfg, + api.ConfigFileName: string(cfg), }, Labels: databaseLabels, }, diff --git a/internal/resources/storage.go b/internal/resources/storage.go index d8f69751..8929edec 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -1,6 +1,7 @@ package resources import ( + "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/rest" @@ -44,20 +45,35 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R var optionalBuilders []ResourceBuilder - // YDBOPS-9722 backward compatibility - cfg, _ := api.BuildConfiguration(b.Unwrap(), nil) - - optionalBuilders = append( - optionalBuilders, - &ConfigMapBuilder{ - Object: b, - Name: b.Storage.GetName(), - Data: map[string]string{ - api.ConfigFileName: cfg, + dynconfig, err := api.ParseDynconfig(b.Spec.Configuration) + if err != nil { + // YDBOPS-9722 backward compatibility + cfg, _ := api.BuildConfiguration(b.Unwrap(), nil) + optionalBuilders = append( + optionalBuilders, + &ConfigMapBuilder{ + Object: b, + Name: b.Storage.GetName(), + Data: map[string]string{ + api.ConfigFileName: string(cfg), + }, + Labels: storageLabels, }, - Labels: storageLabels, - }, - ) + ) + } else { + cfg, _ := yaml.Marshal(dynconfig.Config) + optionalBuilders = append( + optionalBuilders, + &ConfigMapBuilder{ + Object: b, + Name: b.Storage.GetName(), + Data: map[string]string{ + api.ConfigFileName: string(cfg), + }, + Labels: storageLabels, + }, + ) + } if b.Spec.Monitoring.Enabled { optionalBuilders = append(optionalBuilders, From 6c814dee04a0d7dce0b74b187ea3941823441396 Mon Sep 17 00:00:00 2001 From: Mikhail Babich Date: Sun, 23 Jun 2024 15:57:04 +0200 Subject: [PATCH 07/70] Check response of tenant creation request (#224) Bump chart version up to 0.5.16 --- deploy/ydb-operator/Chart.yaml | 4 +- e2e/tests/smoke_test.go | 22 +++-- internal/cms/tenant.go | 84 ++++++++++------- internal/controllers/constants/constants.go | 11 ++- internal/controllers/database/controller.go | 2 +- internal/controllers/database/init.go | 93 ++++++++++++++++++- .../controllers/databasenodeset/controller.go | 2 +- internal/controllers/storage/controller.go | 2 +- .../controllers/storagenodeset/controller.go | 2 +- 9 files changed, 163 insertions(+), 59 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index fd6941cd..49071750 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.15 +version: 0.5.16 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.15" +appVersion: "0.5.16" diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index 2dd9bfce..678e1718 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -474,15 +474,19 @@ var _ = Describe("Operator smoke test", func() { By("checking that all the storage pods are running and ready...") checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) - By("database can be healthily created after Frozen storage...") - Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) - }() - By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) - By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + /* + // This test suite attempts to create a database on uninitialised storage + + By("database can be healthily created after Frozen storage...") + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) + }() + By("waiting until database is ready...") + waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + By("checking that all the database pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + */ }) It("create storage and database with nodeSets", func() { diff --git a/internal/cms/tenant.go b/internal/cms/tenant.go index fade9448..821ede9c 100644 --- a/internal/cms/tenant.go +++ b/internal/cms/tenant.go @@ -6,21 +6,22 @@ import ( "fmt" "github.com/ydb-platform/ydb-go-genproto/Ydb_Cms_V1" + "github.com/ydb-platform/ydb-go-genproto/Ydb_Operation_V1" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Cms" + "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations" ydb "github.com/ydb-platform/ydb-go-sdk/v3" - ydbCredentials "github.com/ydb-platform/ydb-go-sdk/v3/credentials" "sigs.k8s.io/controller-runtime/pkg/log" ydbv1alpha1 "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" "github.com/ydb-platform/ydb-kubernetes-operator/internal/connection" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) var ErrEmptyReplyFromStorage = errors.New("empty reply from storage") type Tenant struct { StorageEndpoint string + Domain string Path string StorageUnits []ydbv1alpha1.StorageUnit Shared bool @@ -29,43 +30,29 @@ type Tenant struct { func (t *Tenant) Create( ctx context.Context, - database *resources.DatabaseBuilder, - creds ydbCredentials.Credentials, opts ...ydb.Option, -) error { +) (string, error) { logger := log.FromContext(ctx) - createDatabaseURL := fmt.Sprintf( - "%s/%s", - t.StorageEndpoint, - database.Spec.Domain, - ) - - db, err := connection.Open(ctx, - createDatabaseURL, - ydb.WithCredentials(creds), - ydb.MergeOptions(opts...), - ) + url := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) + conn, err := connection.Open(ctx, url, opts...) if err != nil { logger.Error(err, "Error connecting to YDB storage") - return err + return "", err } defer func() { - connection.Close(ctx, db) + connection.Close(ctx, conn) }() - client := Ydb_Cms_V1.NewCmsServiceClient(ydb.GRPCConn(db)) - logger.Info(fmt.Sprintf("creating tenant, url: %s", createDatabaseURL)) + client := Ydb_Cms_V1.NewCmsServiceClient(ydb.GRPCConn(conn)) + logger.Info(fmt.Sprintf("creating tenant, url: %s", url)) request := t.makeCreateDatabaseRequest() logger.Info(fmt.Sprintf("creating tenant, request: %s", request)) response, err := client.CreateDatabase(ctx, request) if err != nil { - return err - } - if _, err := processDatabaseCreationResponse(response); err != nil { - return err + return "", err } logger.Info(fmt.Sprintf("creating tenant, response: %s", response)) - return nil + return processDatabaseCreationOperation(response.Operation) } func (t *Tenant) makeCreateDatabaseRequest() *Ydb_Cms.CreateDatabaseRequest { @@ -101,17 +88,46 @@ func (t *Tenant) makeCreateDatabaseRequest() *Ydb_Cms.CreateDatabaseRequest { return request } -func processDatabaseCreationResponse(response *Ydb_Cms.CreateDatabaseResponse) (bool, error) { - if response.Operation == nil { - return false, ErrEmptyReplyFromStorage +func processDatabaseCreationOperation(operation *Ydb_Operations.Operation) (string, error) { + if operation == nil { + return "", ErrEmptyReplyFromStorage } - - if response.Operation.Status == Ydb.StatusIds_ALREADY_EXISTS || response.Operation.Status == Ydb.StatusIds_SUCCESS { - return true, nil + if !operation.Ready { + return operation.Id, nil + } + if operation.Status == Ydb.StatusIds_ALREADY_EXISTS || operation.Status == Ydb.StatusIds_SUCCESS { + return "", nil } - if response.Operation.Status == Ydb.StatusIds_STATUS_CODE_UNSPECIFIED && len(response.Operation.Issues) == 0 { - return true, nil + return "", fmt.Errorf("YDB response error: %v %v", operation.Status, operation.Issues) +} + +func (t *Tenant) CheckCreateOperation( + ctx context.Context, + operationID string, + opts ...ydb.Option, +) (bool, error, error) { + logger := log.FromContext(ctx) + url := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) + conn, err := connection.Open(ctx, url, opts...) + if err != nil { + logger.Error(err, "Error connecting to YDB storage") + return false, nil, err } + defer func() { + connection.Close(ctx, conn) + }() - return false, fmt.Errorf("YDB response error: %v %v", response.Operation.Status, response.Operation.Issues) + client := Ydb_Operation_V1.NewOperationServiceClient(ydb.GRPCConn(conn)) + request := &Ydb_Operations.GetOperationRequest{Id: operationID} + logger.Info(fmt.Sprintf("checking operation, url: %s, operationId: %s, request: %s", url, operationID, request)) + response, err := client.GetOperation(ctx, request) + if err != nil { + return false, nil, err + } + logger.Info(fmt.Sprintf("checking operation, response: %s", response)) + if response.Operation == nil { + return false, nil, ErrEmptyReplyFromStorage + } + oid, err := processDatabaseCreationOperation(response.Operation) + return len(oid) == 0, err, nil } diff --git a/internal/controllers/constants/constants.go b/internal/controllers/constants/constants.go index a2cb1f6d..e7961197 100644 --- a/internal/controllers/constants/constants.go +++ b/internal/controllers/constants/constants.go @@ -25,11 +25,12 @@ const ( StoragePausedCondition = "StoragePaused" StorageReadyCondition = "StorageReady" - DatabasePreparedCondition = "DatabasePrepared" - DatabaseInitializedCondition = "DatabaseInitialized" - DatabaseProvisionedCondition = "DatabaseProvisioned" - DatabasePausedCondition = "DatabasePaused" - DatabaseReadyCondition = "DatabaseReady" + DatabasePreparedCondition = "DatabasePrepared" + DatabaseInitializedCondition = "DatabaseInitialized" + DatabaseProvisionedCondition = "DatabaseProvisioned" + DatabasePausedCondition = "DatabasePaused" + DatabaseReadyCondition = "DatabaseReady" + CreateDatabaseOperationCondition = "CreateDatabaseOperation" NodeSetPreparedCondition = "NodeSetPrepared" NodeSetProvisionedCondition = "NodeSetProvisioned" diff --git a/internal/controllers/database/controller.go b/internal/controllers/database/controller.go index d49088ea..c2060038 100644 --- a/internal/controllers/database/controller.go +++ b/internal/controllers/database/controller.go @@ -164,11 +164,11 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { ). WithEventFilter(predicate.Or( predicate.GenerationChangedPredicate{}, - resources.IgnoreDeletetionPredicate(), resources.LastAppliedAnnotationPredicate(), resources.IsServicePredicate(), resources.IsSecretPredicate(), )). + WithEventFilter(resources.IgnoreDeletetionPredicate()). Complete(r) } diff --git a/internal/controllers/database/init.go b/internal/controllers/database/init.go index d9c6b16b..6b878266 100644 --- a/internal/controllers/database/init.go +++ b/internal/controllers/database/init.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/ydb-platform/ydb-go-sdk/v3" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -62,9 +63,76 @@ func (r *Reconciler) setInitDatabaseCompleted( Reason: ReasonCompleted, Message: message, }) + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + Message: "Tenant creation operation is completed", + }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } +func (r *Reconciler) checkCreateTenantOperation( + ctx context.Context, + database *resources.DatabaseBuilder, + tenant *cms.Tenant, + ydbOptions ydb.Option, +) (bool, ctrl.Result, error) { + condition := meta.FindStatusCondition(database.Status.Conditions, CreateDatabaseOperationCondition) + if condition == nil || len(condition.Message) == 0 { + // Something is wrong with the condition where we save operation id + // retry create tenant + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionTrue, + Reason: ReasonNotRequired, + }) + return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) + } + operationID := condition.Message + finished, operationErr, err := tenant.CheckCreateOperation(ctx, operationID, ydbOptions) + if err != nil { + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "InitializingFailed", + fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, err), + ) + return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, err + } + if operationErr != nil { + // Creation operation failed - retry Create Tenant + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "InitializingFailed", + fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, operationErr), + ) + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionTrue, + Reason: ReasonNotRequired, + }) + return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) + } + if !finished { + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "Pending", + fmt.Sprintf("Tenant creation operation is not completed, operationID: %s", operationID), + ) + return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, nil + } + r.Recorder.Event( + database, + corev1.EventTypeNormal, + "Initialized", + fmt.Sprintf("Tenant %s created", tenant.Path), + ) + return r.setInitDatabaseCompleted(ctx, database, "Database initialized successfully") +} + func (r *Reconciler) initializeTenant( ctx context.Context, database *resources.DatabaseBuilder, @@ -139,8 +207,9 @@ func (r *Reconciler) initializeTenant( return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, ErrIncorrectDatabaseResourcesConfiguration } - tenant := cms.Tenant{ + tenant := &cms.Tenant{ StorageEndpoint: database.Spec.StorageEndpoint, + Domain: database.Spec.Domain, Path: path, StorageUnits: storageUnits, Shared: shared, @@ -167,8 +236,12 @@ func (r *Reconciler) initializeTenant( ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } + ydbOpts := ydb.MergeOptions(ydb.WithCredentials(creds), tlsOptions) - err = tenant.Create(ctx, database, creds, tlsOptions) + if meta.IsStatusConditionFalse(database.Status.Conditions, CreateDatabaseOperationCondition) { + return r.checkCreateTenantOperation(ctx, database, tenant, ydbOpts) + } + operationID, err := tenant.Create(ctx, ydb.WithCredentials(creds), tlsOptions) if err != nil { r.Recorder.Event( database, @@ -176,10 +249,20 @@ func (r *Reconciler) initializeTenant( "InitializingFailed", fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, err), ) + return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, err + } + if len(operationID) > 0 { + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "Pending", + fmt.Sprintf("Tenant creation operation in progress, operationID: %s", operationID), + ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseInitializedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + Message: operationID, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } diff --git a/internal/controllers/databasenodeset/controller.go b/internal/controllers/databasenodeset/controller.go index bfd278e5..f1045dfa 100644 --- a/internal/controllers/databasenodeset/controller.go +++ b/internal/controllers/databasenodeset/controller.go @@ -70,8 +70,8 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { Owns(&appsv1.StatefulSet{}). WithEventFilter(predicate.Or( predicate.GenerationChangedPredicate{}, - resources.IgnoreDeletetionPredicate(), resources.LastAppliedAnnotationPredicate()), ). + WithEventFilter(resources.IgnoreDeletetionPredicate()). Complete(r) } diff --git a/internal/controllers/storage/controller.go b/internal/controllers/storage/controller.go index 90eada89..15dfec9a 100644 --- a/internal/controllers/storage/controller.go +++ b/internal/controllers/storage/controller.go @@ -172,11 +172,11 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { ). WithEventFilter(predicate.Or( predicate.GenerationChangedPredicate{}, - resources.IgnoreDeletetionPredicate(), resources.LastAppliedAnnotationPredicate(), resources.IsServicePredicate(), resources.IsSecretPredicate(), )). + WithEventFilter(resources.IgnoreDeletetionPredicate()). Complete(r) } diff --git a/internal/controllers/storagenodeset/controller.go b/internal/controllers/storagenodeset/controller.go index 81b3da48..e819c912 100644 --- a/internal/controllers/storagenodeset/controller.go +++ b/internal/controllers/storagenodeset/controller.go @@ -69,8 +69,8 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { Owns(&appsv1.StatefulSet{}). WithEventFilter(predicate.Or( predicate.GenerationChangedPredicate{}, - resources.IgnoreDeletetionPredicate(), resources.LastAppliedAnnotationPredicate()), ). + WithEventFilter(resources.IgnoreDeletetionPredicate()). Complete(r) } From 36ee6cf0d586b1341d90b837d6d43d78cfd635ba Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:34:27 +0300 Subject: [PATCH 08/70] YDBOPS-7162 Immutable statefulSet selectorLabels with label "ydb.tech/statefulset-name" (#172) --- internal/controllers/database/sync.go | 28 +++------- internal/controllers/databasenodeset/sync.go | 22 ++++---- .../controllers/storage/controller_test.go | 55 ++++++++++++++++--- internal/controllers/storage/sync.go | 26 +++------ internal/controllers/storagenodeset/sync.go | 36 +++++------- internal/labels/label.go | 2 + internal/resources/database.go | 12 +++- internal/resources/database_statefulset.go | 24 ++++---- internal/resources/databasenodeset.go | 17 +++++- internal/resources/resource.go | 32 +++++++++++ internal/resources/storage.go | 12 +++- internal/resources/storage_statefulset.go | 23 ++++---- internal/resources/storagenodeset.go | 17 +++++- 13 files changed, 194 insertions(+), 112 deletions(-) diff --git a/internal/controllers/database/sync.go b/internal/controllers/database/sync.go index 1d17464e..df0f6e0e 100644 --- a/internal/controllers/database/sync.go +++ b/internal/controllers/database/sync.go @@ -322,26 +322,16 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( database, corev1.EventTypeWarning, - "ProvisioningFailed", - fmt.Sprintf("Failed to get StatefulSets: %s", err), + "ControllerError", + fmt.Sprintf("Failed to get StatefulSet: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - podLabels := labels.Common(database.Name, make(map[string]string)) - podLabels.Merge(map[string]string{ - labels.ComponentKey: labels.DynamicComponent, - }) - - matchingLabels := client.MatchingLabels{} - for k, v := range podLabels { - matchingLabels[k] = v - } - podList := &corev1.PodList{} opts := []client.ListOption{ client.InNamespace(database.Namespace), - matchingLabels, + client.MatchingLabels{labels.StatefulsetComponent: database.Name}, } err = r.List(ctx, podList, opts...) @@ -349,15 +339,15 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( database, corev1.EventTypeWarning, - "ProvisioningFailed", - fmt.Sprintf("Failed to list cluster pods: %s", err), + "ControllerError", + fmt.Sprintf("Failed to list StatefulSet pods: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } runningPods := 0 for _, e := range podList.Items { - if e.Status.Phase == "Running" { + if resources.PodIsReady(e) { runningPods++ } } @@ -367,13 +357,13 @@ func (r *Reconciler) waitForStatefulSetToScale( database, corev1.EventTypeNormal, string(DatabaseProvisioning), - fmt.Sprintf("Waiting for number of running dynamic pods to match expected: %d != %d", runningPods, database.Spec.Nodes), + fmt.Sprintf("Waiting for number of running pods to match expected: %d != %d", runningPods, database.Spec.Nodes), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ Type: DatabaseProvisionedCondition, Status: metav1.ConditionFalse, Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running dynamic pods does not match expected: %d != %d", runningPods, database.Spec.Nodes), + Message: fmt.Sprintf("Number of running pods does not match expected: %d != %d", runningPods, database.Spec.Nodes), }) return r.updateStatus(ctx, database, DefaultRequeueDelay) } @@ -383,7 +373,7 @@ func (r *Reconciler) waitForStatefulSetToScale( Type: DatabaseProvisionedCondition, Status: metav1.ConditionTrue, Reason: ReasonCompleted, - Message: "Successfully scaled to desired number of nodes", + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", database.Spec.Nodes), }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/databasenodeset/sync.go b/internal/controllers/databasenodeset/sync.go index 2915ad1d..35e97b70 100644 --- a/internal/controllers/databasenodeset/sync.go +++ b/internal/controllers/databasenodeset/sync.go @@ -19,6 +19,7 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck + "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -213,15 +214,15 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( databaseNodeSet, corev1.EventTypeWarning, - "Syncing", - fmt.Sprintf("Failed to found StatefulSet: %s", err), + "ProvisioningFailed", + fmt.Sprintf("StatefulSet with name %s was not found: %s", databaseNodeSet.Name, err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, nil } r.Recorder.Event( databaseNodeSet, corev1.EventTypeWarning, - "Syncing", + "ControllerError", fmt.Sprintf("Failed to get StatefulSets: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err @@ -235,21 +236,22 @@ func (r *Reconciler) waitForStatefulSetToScale( podList := &corev1.PodList{} opts := []client.ListOption{ client.InNamespace(databaseNodeSet.Namespace), - matchingLabels, + client.MatchingLabels{labels.StatefulsetComponent: databaseNodeSet.Name}, } - if err = r.List(ctx, podList, opts...); err != nil { + err = r.List(ctx, podList, opts...) + if err != nil { r.Recorder.Event( databaseNodeSet, corev1.EventTypeWarning, - "Syncing", - fmt.Sprintf("Failed to list databaseNodeSet pods: %s", err), + "ControllerError", + fmt.Sprintf("Failed to list StatefulSet pods: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } runningPods := 0 for _, e := range podList.Items { - if e.Status.Phase == "Running" { + if resources.PodIsReady(e) { runningPods++ } } @@ -259,7 +261,7 @@ func (r *Reconciler) waitForStatefulSetToScale( databaseNodeSet, corev1.EventTypeNormal, string(DatabaseNodeSetProvisioning), - fmt.Sprintf("Waiting for number of running databaseNodeSet pods to match expected: %d != %d", runningPods, databaseNodeSet.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, databaseNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ Type: NodeSetProvisionedCondition, @@ -275,7 +277,7 @@ func (r *Reconciler) waitForStatefulSetToScale( Type: NodeSetProvisionedCondition, Status: metav1.ConditionTrue, Reason: ReasonCompleted, - Message: fmt.Sprintf("Scaled DatabaseNodeSet to %d successfully", databaseNodeSet.Spec.Nodes), + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", databaseNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index 31e45e5a..7500535a 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "path/filepath" - "strconv" "strings" "testing" @@ -114,8 +113,7 @@ var _ = Describe("Storage controller medium tests", func() { } Expect(foundVolume).To(BeTrue()) - By("Check that label and annotation propagated to pods...", func() { - podLabels := storageSS.Spec.Template.Labels + By("Check that configuration checksum annotation propagated to pods...", func() { podAnnotations := storageSS.Spec.Template.Annotations foundStorage := v1alpha1.Storage{} @@ -124,12 +122,6 @@ var _ = Describe("Storage controller medium tests", func() { Namespace: testobjects.YdbNamespace, }, &foundStorage)).Should(Succeed()) - foundStorageGenerationLabel := false - if podLabels[labels.StorageGeneration] == strconv.FormatInt(foundStorage.ObjectMeta.Generation, 10) { - foundStorageGenerationLabel = true - } - Expect(foundStorageGenerationLabel).To(BeTrue()) - foundConfigurationChecksumAnnotation := false if podAnnotations[annotations.ConfigurationChecksum] == resources.GetConfigurationChecksum(foundStorage.Spec.Configuration) { foundConfigurationChecksumAnnotation = true @@ -150,5 +142,50 @@ var _ = Describe("Storage controller medium tests", func() { Expect(labelArgKey).Should(BeEquivalentTo(v1alpha1.LabelDeploymentKey)) Expect(labelArgValue).Should(BeEquivalentTo(v1alpha1.LabelDeploymentValueKubernetes)) }) + + By("Check that statefulset podTemplate labels remain immutable...", func() { + testLabelKey := "ydb-label" + testLabelValue := "test" + By("set additional labels to Storage...") + Eventually(func() error { + foundStorage := v1alpha1.Storage{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundStorage)) + additionalLabels := resources.CopyDict(foundStorage.Spec.AdditionalLabels) + additionalLabels[testLabelKey] = testLabelValue + foundStorage.Spec.AdditionalLabels = additionalLabels + return k8sClient.Update(ctx, &foundStorage) + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("check that additional labels was added...") + foundStatefulSets := appsv1.StatefulSetList{} + Eventually(func() error { + err := k8sClient.List(ctx, &foundStatefulSets, + client.InNamespace(testobjects.YdbNamespace), + ) + if err != nil { + return err + } + value, exist := foundStatefulSets.Items[0].Labels[testLabelKey] + if !exist { + return fmt.Errorf("label key `ydb-label` does not exist in StatefulSet. Current labels: %s", foundStatefulSets.Items[0].Labels) + } + if value != testLabelValue { + return fmt.Errorf("label value `ydb-label` in StatefulSet does not equal `test`. Current labels: %s", foundStatefulSets.Items[0].Labels) + } + return nil + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("check that StatefulSet selector was not updated...") + Expect(*foundStatefulSets.Items[0].Spec.Selector).Should(BeEquivalentTo( + metav1.LabelSelector{ + MatchLabels: map[string]string{ + labels.StatefulsetComponent: storageSample.Name, + }, + }, + )) + }) }) }) diff --git a/internal/controllers/storage/sync.go b/internal/controllers/storage/sync.go index 1be13c41..9ece19d7 100644 --- a/internal/controllers/storage/sync.go +++ b/internal/controllers/storage/sync.go @@ -142,26 +142,16 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( storage, corev1.EventTypeWarning, - "ProvisioningFailed", - fmt.Sprintf("Failed to get StatefulSets: %s", err), + "ControllerError", + fmt.Sprintf("Failed to get StatefulSet: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - podLabels := labels.Common(storage.Name, make(map[string]string)) - podLabels.Merge(map[string]string{ - labels.ComponentKey: labels.StorageComponent, - }) - - matchingLabels := client.MatchingLabels{} - for k, v := range podLabels { - matchingLabels[k] = v - } - podList := &corev1.PodList{} opts := []client.ListOption{ client.InNamespace(storage.Namespace), - matchingLabels, + client.MatchingLabels{labels.StatefulsetComponent: storage.Name}, } err = r.List(ctx, podList, opts...) @@ -169,15 +159,15 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( storage, corev1.EventTypeWarning, - "ProvisioningFailed", - fmt.Sprintf("Failed to list cluster pods: %s", err), + "ControllerError", + fmt.Sprintf("Failed to list StatefulSet pods: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } runningPods := 0 for _, e := range podList.Items { - if e.Status.Phase == "Running" { + if resources.PodIsReady(e) { runningPods++ } } @@ -187,7 +177,7 @@ func (r *Reconciler) waitForStatefulSetToScale( storage, corev1.EventTypeNormal, string(StorageProvisioning), - fmt.Sprintf("Waiting for number of running storage pods to match expected: %d != %d", runningPods, storage.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, storage.Spec.Nodes), ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ Type: StorageProvisionedCondition, @@ -203,7 +193,7 @@ func (r *Reconciler) waitForStatefulSetToScale( Type: StorageProvisionedCondition, Status: metav1.ConditionTrue, Reason: ReasonCompleted, - Message: "Successfully scaled to desired number of nodes", + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storage.Spec.Nodes), }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/storagenodeset/sync.go b/internal/controllers/storagenodeset/sync.go index a3d525df..953eae92 100644 --- a/internal/controllers/storagenodeset/sync.go +++ b/internal/controllers/storagenodeset/sync.go @@ -19,6 +19,7 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck + "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -213,49 +214,40 @@ func (r *Reconciler) waitForStatefulSetToScale( r.Recorder.Event( storageNodeSet, corev1.EventTypeWarning, - "Syncing", - fmt.Sprintf("Failed to found StatefulSet: %s", err), + "ProvisioningFailed", + fmt.Sprintf("StatefulSet with name %s was not found: %s", storageNodeSet.Name, err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } r.Recorder.Event( storageNodeSet, corev1.EventTypeWarning, - "Syncing", - fmt.Sprintf("Failed to get StatefulSets: %s", err), + "ControllerError", + fmt.Sprintf("Failed to get StatefulSet: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - matchingLabels := client.MatchingLabels{} - for k, v := range storageNodeSet.Labels { - matchingLabels[k] = v - } - podList := &corev1.PodList{} opts := []client.ListOption{ client.InNamespace(storageNodeSet.Namespace), - matchingLabels, + client.MatchingLabels{labels.StatefulsetComponent: storageNodeSet.Name}, } - if err = r.List(ctx, podList, opts...); err != nil { + + err = r.List(ctx, podList, opts...) + if err != nil { r.Recorder.Event( storageNodeSet, corev1.EventTypeWarning, - "Syncing", - fmt.Sprintf("Failed to list storageNodeSet pods: %s", err), + "ControllerError", + fmt.Sprintf("Failed to list StatefulSet pods: %s", err), ) - meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: "Failed to check Pods .status.phase", - }) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } runningPods := 0 for _, e := range podList.Items { - if e.Status.Phase == "Running" { + if resources.PodIsReady(e) { runningPods++ } } @@ -265,7 +257,7 @@ func (r *Reconciler) waitForStatefulSetToScale( storageNodeSet, corev1.EventTypeNormal, string(StorageNodeSetProvisioning), - fmt.Sprintf("Waiting for number of running storageNodeSet pods to match expected: %d != %d", runningPods, storageNodeSet.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, storageNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ Type: NodeSetProvisionedCondition, @@ -281,7 +273,7 @@ func (r *Reconciler) waitForStatefulSetToScale( Type: NodeSetProvisionedCondition, Status: metav1.ConditionTrue, Reason: ReasonCompleted, - Message: fmt.Sprintf("Scaled StorageNodeSet to %d successfully", storageNodeSet.Spec.Nodes), + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storageNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) } diff --git a/internal/labels/label.go b/internal/labels/label.go index 803dc742..19ff5d94 100644 --- a/internal/labels/label.go +++ b/internal/labels/label.go @@ -19,6 +19,8 @@ const ( // ServiceComponent The specialization of a Service resource ServiceComponent = "ydb.tech/service-for" + // StatefulsetComponent The specialization of a Statefulset resource + StatefulsetComponent = "ydb.tech/statefulset-name" // StorageNodeSetComponent The specialization of a StorageNodeSet resource StorageNodeSetComponent = "ydb.tech/storage-nodeset" // DatabaseNodeSetComponent The specialization of a DatabaseNodeSet resource diff --git a/internal/resources/database.go b/internal/resources/database.go index 6d17a1d9..d7fb2902 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -5,6 +5,7 @@ import ( "k8s.io/client-go/rest" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/metrics" ) @@ -35,6 +36,12 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc databaseLabels := labels.DatabaseLabels(b.Unwrap()) + statefulSetLabels := databaseLabels.Copy() + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + + statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) + statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + grpcServiceLabels := databaseLabels.Copy() grpcServiceLabels.Merge(b.Spec.Service.GRPC.AdditionalLabels) grpcServiceLabels.Merge(map[string]string{labels.ServiceComponent: labels.GRPCComponent}) @@ -174,8 +181,9 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Database: b.Unwrap(), RestConfig: restConfig, - Name: b.Name, - Labels: databaseLabels, + Name: b.Name, + Labels: statefulSetLabels, + Annotations: statefulSetAnnotations, }, ) } else { diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index c9437b50..687ed8e4 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -16,7 +16,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr" ) @@ -25,8 +24,9 @@ type DatabaseStatefulSetBuilder struct { *api.Database RestConfig *rest.Config - Name string - Labels map[string]string + Name string + Labels map[string]string + Annotations map[string]string } var annotationDataCenterPattern = regexp.MustCompile("^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$") @@ -41,7 +41,9 @@ func (b *DatabaseStatefulSetBuilder) Build(obj client.Object) error { sts.ObjectMeta.Name = b.Name } sts.ObjectMeta.Namespace = b.GetNamespace() - sts.ObjectMeta.Annotations = CopyDict(b.Spec.AdditionalAnnotations) + + sts.ObjectMeta.Labels = b.Labels + sts.ObjectMeta.Annotations = b.Annotations replicas := ptr.Int32(b.Spec.Nodes) if b.Spec.Pause { @@ -51,7 +53,9 @@ func (b *DatabaseStatefulSetBuilder) Build(obj client.Object) error { sts.Spec = appsv1.StatefulSetSpec{ Replicas: replicas, Selector: &metav1.LabelSelector{ - MatchLabels: b.Labels, + MatchLabels: map[string]string{ + labels.StatefulsetComponent: b.Name, + }, }, PodManagementPolicy: appsv1.ParallelPodManagement, RevisionHistoryLimit: ptr.Int32(10), @@ -85,16 +89,10 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar { } func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpec { - podTemplateLabels := CopyDict(b.Labels) - podTemplateLabels[labels.DatabaseGeneration] = strconv.FormatInt(b.ObjectMeta.Generation, 10) - - podTemplateAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - podTemplateAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) - podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: podTemplateLabels, - Annotations: podTemplateAnnotations, + Labels: b.Labels, + Annotations: b.Annotations, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{b.buildContainer()}, diff --git a/internal/resources/databasenodeset.go b/internal/resources/databasenodeset.go index cac08b04..9e57519a 100644 --- a/internal/resources/databasenodeset.go +++ b/internal/resources/databasenodeset.go @@ -8,6 +8,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" ) type DatabaseNodeSetBuilder struct { @@ -53,14 +55,25 @@ func (b *DatabaseNodeSetBuilder) Placeholder(cr client.Object) client.Object { } func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { + ydbCr := api.RecastDatabaseNodeSet(b.Unwrap()) + databaseLabels := labels.DatabaseLabels(ydbCr) + + statefulSetLabels := databaseLabels.Copy() + statefulSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: b.Labels[labels.DatabaseNodeSetComponent]}) + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + + statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) + statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + var resourceBuilders []ResourceBuilder resourceBuilders = append(resourceBuilders, &DatabaseStatefulSetBuilder{ Database: api.RecastDatabaseNodeSet(b.DatabaseNodeSet), RestConfig: restConfig, - Name: b.Name, - Labels: b.Labels, + Name: b.Name, + Labels: statefulSetLabels, + Annotations: statefulSetAnnotations, }, ) return resourceBuilders diff --git a/internal/resources/resource.go b/internal/resources/resource.go index 7a443ebe..ac3f0e52 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -173,6 +173,15 @@ func CreateOrUpdateOrMaybeIgnore( return ctrlutil.OperationResultNone, nil } + // Prevent updating selectorLabels for StatefulSet + if updated, ok := obj.(*appsv1.StatefulSet); ok { + existingMatchLabels := CopyDict(existing.(*appsv1.StatefulSet).Spec.Selector.MatchLabels) + updatedMatchLabels := CopyDict(updated.Spec.Selector.MatchLabels) + if !CompareMaps(updatedMatchLabels, existingMatchLabels) { + obj.(*appsv1.StatefulSet).Spec.Selector.MatchLabels = existingMatchLabels + } + } + changed, err := CheckObjectUpdatedIgnoreStatus(existing, obj) if err != nil || !changed { return ctrlutil.OperationResultNone, err @@ -618,6 +627,29 @@ func GetConfigurationChecksum(configuration string) string { return hex.EncodeToString(hasher.Sum(nil)) } +func CompareMaps(map1, map2 map[string]string) bool { + if len(map1) != len(map2) { + return false + } + for key1, value1 := range map1 { + if value2, ok := map2[key1]; !ok || value2 != value1 { + return false + } + } + return true +} + +func PodIsReady(e corev1.Pod) bool { + if e.Status.Phase == corev1.PodRunning { + for _, condition := range e.Status.Conditions { + if condition.Type == corev1.PodReady && condition.Status == corev1.ConditionTrue { + return true + } + } + } + return false +} + func isSignAlgorithmSupported(alg string) bool { supportedAlgs := jwt.GetAlgorithms() diff --git a/internal/resources/storage.go b/internal/resources/storage.go index 8929edec..63a173c7 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -6,6 +6,7 @@ import ( "k8s.io/client-go/rest" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/metrics" ) @@ -31,6 +32,12 @@ func (b *StorageClusterBuilder) Unwrap() *api.Storage { func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { storageLabels := labels.StorageLabels(b.Unwrap()) + statefulSetLabels := storageLabels.Copy() + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + + statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) + statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + grpcServiceLabels := storageLabels.Copy() grpcServiceLabels.Merge(b.Spec.Service.GRPC.AdditionalLabels) grpcServiceLabels.Merge(map[string]string{labels.ServiceComponent: labels.GRPCComponent}) @@ -97,8 +104,9 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R Storage: b.Unwrap(), RestConfig: restConfig, - Name: b.Name, - Labels: storageLabels, + Name: b.Name, + Labels: statefulSetLabels, + Annotations: statefulSetAnnotations, }, ) } else { diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 7a92f2cc..23576227 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -15,7 +15,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr" ) @@ -28,8 +27,9 @@ type StorageStatefulSetBuilder struct { *api.Storage RestConfig *rest.Config - Name string - Labels map[string]string + Name string + Labels map[string]string + Annotations map[string]string } func StringRJust(str, pad string, length int) string { @@ -59,7 +59,8 @@ func (b *StorageStatefulSetBuilder) Build(obj client.Object) error { sts.ObjectMeta.Name = b.Name } sts.ObjectMeta.Namespace = b.GetNamespace() - sts.ObjectMeta.Annotations = CopyDict(b.Spec.AdditionalAnnotations) + sts.ObjectMeta.Labels = b.Labels + sts.ObjectMeta.Annotations = b.Annotations replicas := ptr.Int32(b.Spec.Nodes) if b.Spec.Pause { @@ -69,7 +70,9 @@ func (b *StorageStatefulSetBuilder) Build(obj client.Object) error { sts.Spec = appsv1.StatefulSetSpec{ Replicas: replicas, Selector: &metav1.LabelSelector{ - MatchLabels: b.Labels, + MatchLabels: map[string]string{ + labels.StatefulsetComponent: b.Name, + }, }, PodManagementPolicy: appsv1.ParallelPodManagement, RevisionHistoryLimit: ptr.Int32(10), @@ -105,16 +108,10 @@ func (b *StorageStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpe fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Storage.Name, b.GetNamespace()), } - podTemplateLabels := CopyDict(b.Labels) - podTemplateLabels[labels.StorageGeneration] = strconv.FormatInt(b.ObjectMeta.Generation, 10) - - podTemplateAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - podTemplateAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) - podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: podTemplateLabels, - Annotations: podTemplateAnnotations, + Labels: b.Labels, + Annotations: b.Annotations, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{b.buildContainer()}, diff --git a/internal/resources/storagenodeset.go b/internal/resources/storagenodeset.go index 12709307..d206474f 100644 --- a/internal/resources/storagenodeset.go +++ b/internal/resources/storagenodeset.go @@ -8,6 +8,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" ) type StorageNodeSetBuilder struct { @@ -53,6 +55,16 @@ func (b *StorageNodeSetBuilder) Placeholder(cr client.Object) client.Object { } func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { + ydbCr := api.RecastStorageNodeSet(b.Unwrap()) + storageLabels := labels.StorageLabels(ydbCr) + + statefulSetLabels := storageLabels.Copy() + statefulSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: b.Labels[labels.DatabaseNodeSetComponent]}) + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + + statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) + statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + var resourceBuilders []ResourceBuilder resourceBuilders = append( resourceBuilders, @@ -60,8 +72,9 @@ func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [] Storage: api.RecastStorageNodeSet(b.StorageNodeSet), RestConfig: restConfig, - Name: b.Name, - Labels: b.Labels, + Name: b.Name, + Labels: statefulSetLabels, + Annotations: statefulSetAnnotations, }, ) From 90969e22aae57f634aff3d54fc4512d0c2572bbf Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Fri, 28 Jun 2024 18:19:51 +0300 Subject: [PATCH 09/70] fix panic on GetHostFromConfigEndpoint --- api/v1alpha1/configuration.go | 19 +++++++-- api/v1alpha1/storage_webhook.go | 42 ++++---------------- deploy/ydb-operator/Chart.yaml | 4 +- internal/configuration/schema/schema_test.go | 9 ++++- 4 files changed, 32 insertions(+), 42 deletions(-) diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index 07cdda19..87ddd6bb 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -122,12 +122,23 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { return yaml.Marshal(config) } -func ParseConfig(rawYamlConfiguration string) (schema.Configuration, error) { - config := schema.Configuration{} +func ParseConfiguration(rawYamlConfiguration string) (schema.Configuration, error) { + configuration := schema.Configuration{} + + dynconfig, err := ParseDynconfig(rawYamlConfiguration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return configuration, err + } + rawYamlConfiguration = string(config) + } + dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) dec.KnownFields(false) - err := dec.Decode(&config) - return config, err + err = dec.Decode(&configuration) + + return configuration, err } func ParseDynconfig(rawYamlConfiguration string) (schema.Dynconfig, error) { diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 2bc98c11..669c8817 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -7,7 +7,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/strings/slices" @@ -62,15 +61,12 @@ func (r *Storage) GetGRPCServiceEndpoint() string { } func (r *Storage) GetHostFromConfigEndpoint() string { - configuration := make(map[string]interface{}) + var configuration schema.Configuration // skip handle error because we already checked in webhook - _ = yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) - hostsConfig := configuration["hosts"].([]schema.Host) - - randNum := rand.Int31n(r.Spec.Nodes) // #nosec G404 - host := hostsConfig[randNum].Host - return fmt.Sprintf("%s:%d", host, GRPCPort) + configuration, _ = ParseConfiguration(r.Spec.Configuration) + randNum := rand.Intn(len(configuration.Hosts)) // #nosec G404 + return fmt.Sprintf("%s:%d", configuration.Hosts[randNum].Host, GRPCPort) } func (r *Storage) IsStorageEndpointSecure() bool { @@ -181,19 +177,9 @@ func (r *Storage) ValidateCreate() error { var configuration schema.Configuration - rawYamlConfiguration := r.Spec.Configuration - dynconfig, err := ParseDynconfig(r.Spec.Configuration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) - } - rawYamlConfiguration = string(config) - } - - configuration, err = ParseConfig(rawYamlConfiguration) + configuration, err := ParseConfiguration(r.Spec.Configuration) if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + return fmt.Errorf("failed to parse configuration, error: %w", err) } var nodesNumber int32 @@ -278,21 +264,9 @@ func hasUpdatesBesidesFrozen(oldStorage, newStorage *Storage) (bool, string) { func (r *Storage) ValidateUpdate(old runtime.Object) error { storagelog.Info("validate update", "name", r.Name) - var configuration schema.Configuration - - rawYamlConfiguration := r.Spec.Configuration - dynconfig, err := ParseDynconfig(r.Spec.Configuration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) - } - rawYamlConfiguration = string(config) - } - - configuration, err = ParseConfig(rawYamlConfiguration) + configuration, err := ParseConfiguration(r.Spec.Configuration) if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + return fmt.Errorf("failed to parse configuration, error: %w", err) } var nodesNumber int32 diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 49071750..c1a658df 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.16 +version: 0.5.17 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.16" +appVersion: "0.5.17" diff --git a/internal/configuration/schema/schema_test.go b/internal/configuration/schema/schema_test.go index c2553305..2203845c 100644 --- a/internal/configuration/schema/schema_test.go +++ b/internal/configuration/schema/schema_test.go @@ -122,8 +122,8 @@ var _ = Describe("Testing schema", func() { Expect(err).Should(HaveOccurred()) }) - It("Parse static config", func() { - yamlConfig, err := v1alpha1.ParseConfig(configurationExample) + It("Parse configuration with static config", func() { + yamlConfig, err := v1alpha1.ParseConfiguration(configurationExample) Expect(err).ShouldNot(HaveOccurred()) hosts := []schema.Host{} for i := 0; i < 8; i++ { @@ -149,4 +149,9 @@ var _ = Describe("Testing schema", func() { }, })) }) + + It("Parse configuration with dynamic config", func() { + _, err := v1alpha1.ParseConfiguration(dynconfigExample) + Expect(err).ShouldNot(HaveOccurred()) + }) }) From 1528a143de319573d4750f60fc0ed802b34cd59b Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Fri, 28 Jun 2024 19:37:24 +0300 Subject: [PATCH 10/70] Revert "fix panic on GetHostFromConfigEndpoint" This reverts commit 90969e22aae57f634aff3d54fc4512d0c2572bbf. --- api/v1alpha1/configuration.go | 19 ++------- api/v1alpha1/storage_webhook.go | 42 ++++++++++++++++---- deploy/ydb-operator/Chart.yaml | 4 +- internal/configuration/schema/schema_test.go | 9 +---- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index 87ddd6bb..07cdda19 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -122,23 +122,12 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { return yaml.Marshal(config) } -func ParseConfiguration(rawYamlConfiguration string) (schema.Configuration, error) { - configuration := schema.Configuration{} - - dynconfig, err := ParseDynconfig(rawYamlConfiguration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return configuration, err - } - rawYamlConfiguration = string(config) - } - +func ParseConfig(rawYamlConfiguration string) (schema.Configuration, error) { + config := schema.Configuration{} dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) dec.KnownFields(false) - err = dec.Decode(&configuration) - - return configuration, err + err := dec.Decode(&config) + return config, err } func ParseDynconfig(rawYamlConfiguration string) (schema.Dynconfig, error) { diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 669c8817..2bc98c11 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -7,6 +7,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/strings/slices" @@ -61,12 +62,15 @@ func (r *Storage) GetGRPCServiceEndpoint() string { } func (r *Storage) GetHostFromConfigEndpoint() string { - var configuration schema.Configuration + configuration := make(map[string]interface{}) // skip handle error because we already checked in webhook - configuration, _ = ParseConfiguration(r.Spec.Configuration) - randNum := rand.Intn(len(configuration.Hosts)) // #nosec G404 - return fmt.Sprintf("%s:%d", configuration.Hosts[randNum].Host, GRPCPort) + _ = yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) + hostsConfig := configuration["hosts"].([]schema.Host) + + randNum := rand.Int31n(r.Spec.Nodes) // #nosec G404 + host := hostsConfig[randNum].Host + return fmt.Sprintf("%s:%d", host, GRPCPort) } func (r *Storage) IsStorageEndpointSecure() bool { @@ -177,9 +181,19 @@ func (r *Storage) ValidateCreate() error { var configuration schema.Configuration - configuration, err := ParseConfiguration(r.Spec.Configuration) + rawYamlConfiguration := r.Spec.Configuration + dynconfig, err := ParseDynconfig(r.Spec.Configuration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) + } + rawYamlConfiguration = string(config) + } + + configuration, err = ParseConfig(rawYamlConfiguration) if err != nil { - return fmt.Errorf("failed to parse configuration, error: %w", err) + return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) } var nodesNumber int32 @@ -264,9 +278,21 @@ func hasUpdatesBesidesFrozen(oldStorage, newStorage *Storage) (bool, string) { func (r *Storage) ValidateUpdate(old runtime.Object) error { storagelog.Info("validate update", "name", r.Name) - configuration, err := ParseConfiguration(r.Spec.Configuration) + var configuration schema.Configuration + + rawYamlConfiguration := r.Spec.Configuration + dynconfig, err := ParseDynconfig(r.Spec.Configuration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) + } + rawYamlConfiguration = string(config) + } + + configuration, err = ParseConfig(rawYamlConfiguration) if err != nil { - return fmt.Errorf("failed to parse configuration, error: %w", err) + return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) } var nodesNumber int32 diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index c1a658df..49071750 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.17 +version: 0.5.16 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.17" +appVersion: "0.5.16" diff --git a/internal/configuration/schema/schema_test.go b/internal/configuration/schema/schema_test.go index 2203845c..c2553305 100644 --- a/internal/configuration/schema/schema_test.go +++ b/internal/configuration/schema/schema_test.go @@ -122,8 +122,8 @@ var _ = Describe("Testing schema", func() { Expect(err).Should(HaveOccurred()) }) - It("Parse configuration with static config", func() { - yamlConfig, err := v1alpha1.ParseConfiguration(configurationExample) + It("Parse static config", func() { + yamlConfig, err := v1alpha1.ParseConfig(configurationExample) Expect(err).ShouldNot(HaveOccurred()) hosts := []schema.Host{} for i := 0; i < 8; i++ { @@ -149,9 +149,4 @@ var _ = Describe("Testing schema", func() { }, })) }) - - It("Parse configuration with dynamic config", func() { - _, err := v1alpha1.ParseConfiguration(dynconfigExample) - Expect(err).ShouldNot(HaveOccurred()) - }) }) From 5c82a992d81336b6a6be1a99cd0688fdf0f19b5a Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:43:54 +0300 Subject: [PATCH 11/70] fix panic on GetHostFromConfigEndpoint #2 (#227) --- api/v1alpha1/configuration.go | 19 +++++++-- api/v1alpha1/storage_webhook.go | 44 ++++---------------- deploy/ydb-operator/Chart.yaml | 4 +- internal/configuration/schema/schema_test.go | 9 +++- 4 files changed, 32 insertions(+), 44 deletions(-) diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index 07cdda19..87ddd6bb 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -122,12 +122,23 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { return yaml.Marshal(config) } -func ParseConfig(rawYamlConfiguration string) (schema.Configuration, error) { - config := schema.Configuration{} +func ParseConfiguration(rawYamlConfiguration string) (schema.Configuration, error) { + configuration := schema.Configuration{} + + dynconfig, err := ParseDynconfig(rawYamlConfiguration) + if err == nil { + config, err := yaml.Marshal(dynconfig.Config) + if err != nil { + return configuration, err + } + rawYamlConfiguration = string(config) + } + dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) dec.KnownFields(false) - err := dec.Decode(&config) - return config, err + err = dec.Decode(&configuration) + + return configuration, err } func ParseDynconfig(rawYamlConfiguration string) (schema.Dynconfig, error) { diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 2bc98c11..96ca906a 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -7,7 +7,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/strings/slices" @@ -62,15 +61,12 @@ func (r *Storage) GetGRPCServiceEndpoint() string { } func (r *Storage) GetHostFromConfigEndpoint() string { - configuration := make(map[string]interface{}) + var configuration schema.Configuration // skip handle error because we already checked in webhook - _ = yaml.Unmarshal([]byte(r.Spec.Configuration), &configuration) - hostsConfig := configuration["hosts"].([]schema.Host) - - randNum := rand.Int31n(r.Spec.Nodes) // #nosec G404 - host := hostsConfig[randNum].Host - return fmt.Sprintf("%s:%d", host, GRPCPort) + configuration, _ = ParseConfiguration(r.Spec.Configuration) + randNum := rand.Intn(len(configuration.Hosts)) // #nosec G404 + return fmt.Sprintf("%s:%d", configuration.Hosts[randNum].Host, GRPCPort) } func (r *Storage) IsStorageEndpointSecure() bool { @@ -179,21 +175,9 @@ var _ webhook.Validator = &Storage{} func (r *Storage) ValidateCreate() error { storagelog.Info("validate create", "name", r.Name) - var configuration schema.Configuration - - rawYamlConfiguration := r.Spec.Configuration - dynconfig, err := ParseDynconfig(r.Spec.Configuration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) - } - rawYamlConfiguration = string(config) - } - - configuration, err = ParseConfig(rawYamlConfiguration) + configuration, err := ParseConfiguration(r.Spec.Configuration) if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + return fmt.Errorf("failed to parse configuration, error: %w", err) } var nodesNumber int32 @@ -278,21 +262,9 @@ func hasUpdatesBesidesFrozen(oldStorage, newStorage *Storage) (bool, string) { func (r *Storage) ValidateUpdate(old runtime.Object) error { storagelog.Info("validate update", "name", r.Name) - var configuration schema.Configuration - - rawYamlConfiguration := r.Spec.Configuration - dynconfig, err := ParseDynconfig(r.Spec.Configuration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return fmt.Errorf("failed to parse .config from dynconfig, error: %w", err) - } - rawYamlConfiguration = string(config) - } - - configuration, err = ParseConfig(rawYamlConfiguration) + configuration, err := ParseConfiguration(r.Spec.Configuration) if err != nil { - return fmt.Errorf("failed to parse .spec.configuration, error: %w", err) + return fmt.Errorf("failed to parse configuration, error: %w", err) } var nodesNumber int32 diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 49071750..c1a658df 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.16 +version: 0.5.17 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.16" +appVersion: "0.5.17" diff --git a/internal/configuration/schema/schema_test.go b/internal/configuration/schema/schema_test.go index c2553305..2203845c 100644 --- a/internal/configuration/schema/schema_test.go +++ b/internal/configuration/schema/schema_test.go @@ -122,8 +122,8 @@ var _ = Describe("Testing schema", func() { Expect(err).Should(HaveOccurred()) }) - It("Parse static config", func() { - yamlConfig, err := v1alpha1.ParseConfig(configurationExample) + It("Parse configuration with static config", func() { + yamlConfig, err := v1alpha1.ParseConfiguration(configurationExample) Expect(err).ShouldNot(HaveOccurred()) hosts := []schema.Host{} for i := 0; i < 8; i++ { @@ -149,4 +149,9 @@ var _ = Describe("Testing schema", func() { }, })) }) + + It("Parse configuration with dynamic config", func() { + _, err := v1alpha1.ParseConfiguration(dynconfigExample) + Expect(err).ShouldNot(HaveOccurred()) + }) }) From 7245f02eb3358585ab2bde301f5e25e2b31da08e Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:19:09 +0300 Subject: [PATCH 12/70] Use StatefulSet status instead of List Pod by selector labels (#228) * use statefulset status instead of list pod by labels * fix missing "ydb.tech/remote-cluster" label * bump helm chart version --- deploy/ydb-operator/Chart.yaml | 4 +- internal/controllers/database/sync.go | 35 +++------------- internal/controllers/databasenodeset/sync.go | 42 +++----------------- internal/controllers/storage/sync.go | 35 +++------------- internal/controllers/storagenodeset/sync.go | 32 ++------------- internal/resources/database.go | 6 +-- internal/resources/databasenodeset.go | 14 +++++-- internal/resources/storage.go | 6 +-- internal/resources/storagenodeset.go | 14 +++++-- 9 files changed, 47 insertions(+), 141 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index c1a658df..c1595dc3 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.17 +version: 0.5.18 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.17" +appVersion: "0.5.18" diff --git a/internal/controllers/database/sync.go b/internal/controllers/database/sync.go index df0f6e0e..466f8f67 100644 --- a/internal/controllers/database/sync.go +++ b/internal/controllers/database/sync.go @@ -20,7 +20,6 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -304,11 +303,11 @@ func (r *Reconciler) waitForStatefulSetToScale( return Continue, ctrl.Result{Requeue: false}, nil } - found := &appsv1.StatefulSet{} + foundStatefulSet := &appsv1.StatefulSet{} err := r.Get(ctx, types.NamespacedName{ Name: database.Name, Namespace: database.Namespace, - }, found) + }, foundStatefulSet) if err != nil { if apierrors.IsNotFound(err) { r.Recorder.Event( @@ -328,42 +327,18 @@ func (r *Reconciler) waitForStatefulSetToScale( return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - podList := &corev1.PodList{} - opts := []client.ListOption{ - client.InNamespace(database.Namespace), - client.MatchingLabels{labels.StatefulsetComponent: database.Name}, - } - - err = r.List(ctx, podList, opts...) - if err != nil { - r.Recorder.Event( - database, - corev1.EventTypeWarning, - "ControllerError", - fmt.Sprintf("Failed to list StatefulSet pods: %s", err), - ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err - } - - runningPods := 0 - for _, e := range podList.Items { - if resources.PodIsReady(e) { - runningPods++ - } - } - - if runningPods != int(database.Spec.Nodes) { + if foundStatefulSet.Status.ReadyReplicas != database.Spec.Nodes { r.Recorder.Event( database, corev1.EventTypeNormal, string(DatabaseProvisioning), - fmt.Sprintf("Waiting for number of running pods to match expected: %d != %d", runningPods, database.Spec.Nodes), + fmt.Sprintf("Waiting for number of running pods to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, database.Spec.Nodes), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ Type: DatabaseProvisionedCondition, Status: metav1.ConditionFalse, Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running pods does not match expected: %d != %d", runningPods, database.Spec.Nodes), + Message: fmt.Sprintf("Number of running pods does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, database.Spec.Nodes), }) return r.updateStatus(ctx, database, DefaultRequeueDelay) } diff --git a/internal/controllers/databasenodeset/sync.go b/internal/controllers/databasenodeset/sync.go index 35e97b70..0e0b2cde 100644 --- a/internal/controllers/databasenodeset/sync.go +++ b/internal/controllers/databasenodeset/sync.go @@ -14,12 +14,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -204,11 +202,11 @@ func (r *Reconciler) waitForStatefulSetToScale( return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } - found := &appsv1.StatefulSet{} + foundStatefulSet := &appsv1.StatefulSet{} err := r.Get(ctx, types.NamespacedName{ Name: databaseNodeSet.Name, Namespace: databaseNodeSet.Namespace, - }, found) + }, foundStatefulSet) if err != nil { if apierrors.IsNotFound(err) { r.Recorder.Event( @@ -223,51 +221,23 @@ func (r *Reconciler) waitForStatefulSetToScale( databaseNodeSet, corev1.EventTypeWarning, "ControllerError", - fmt.Sprintf("Failed to get StatefulSets: %s", err), + fmt.Sprintf("Failed to get StatefulSet: %s", err), ) return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - matchingLabels := client.MatchingLabels{} - for k, v := range databaseNodeSet.Labels { - matchingLabels[k] = v - } - - podList := &corev1.PodList{} - opts := []client.ListOption{ - client.InNamespace(databaseNodeSet.Namespace), - client.MatchingLabels{labels.StatefulsetComponent: databaseNodeSet.Name}, - } - err = r.List(ctx, podList, opts...) - if err != nil { - r.Recorder.Event( - databaseNodeSet, - corev1.EventTypeWarning, - "ControllerError", - fmt.Sprintf("Failed to list StatefulSet pods: %s", err), - ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err - } - - runningPods := 0 - for _, e := range podList.Items { - if resources.PodIsReady(e) { - runningPods++ - } - } - - if runningPods != int(databaseNodeSet.Spec.Nodes) { + if foundStatefulSet.Status.ReadyReplicas != databaseNodeSet.Spec.Nodes { r.Recorder.Event( databaseNodeSet, corev1.EventTypeNormal, string(DatabaseNodeSetProvisioning), - fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, databaseNodeSet.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, databaseNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ Type: NodeSetProvisionedCondition, Status: metav1.ConditionFalse, Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", runningPods, databaseNodeSet.Spec.Nodes), + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, databaseNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, databaseNodeSet, DefaultRequeueDelay) } diff --git a/internal/controllers/storage/sync.go b/internal/controllers/storage/sync.go index 9ece19d7..91a3593b 100644 --- a/internal/controllers/storage/sync.go +++ b/internal/controllers/storage/sync.go @@ -21,7 +21,6 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck "github.com/ydb-platform/ydb-kubernetes-operator/internal/healthcheck" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -124,11 +123,11 @@ func (r *Reconciler) waitForStatefulSetToScale( return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } - found := &appsv1.StatefulSet{} + foundStatefulSet := &appsv1.StatefulSet{} err := r.Get(ctx, types.NamespacedName{ Name: storage.Name, Namespace: storage.Namespace, - }, found) + }, foundStatefulSet) if err != nil { if apierrors.IsNotFound(err) { r.Recorder.Event( @@ -148,42 +147,18 @@ func (r *Reconciler) waitForStatefulSetToScale( return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - podList := &corev1.PodList{} - opts := []client.ListOption{ - client.InNamespace(storage.Namespace), - client.MatchingLabels{labels.StatefulsetComponent: storage.Name}, - } - - err = r.List(ctx, podList, opts...) - if err != nil { - r.Recorder.Event( - storage, - corev1.EventTypeWarning, - "ControllerError", - fmt.Sprintf("Failed to list StatefulSet pods: %s", err), - ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err - } - - runningPods := 0 - for _, e := range podList.Items { - if resources.PodIsReady(e) { - runningPods++ - } - } - - if runningPods != int(storage.Spec.Nodes) { + if foundStatefulSet.Status.ReadyReplicas != storage.Spec.Nodes { r.Recorder.Event( storage, corev1.EventTypeNormal, string(StorageProvisioning), - fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, storage.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storage.Spec.Nodes), ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ Type: StorageProvisionedCondition, Status: metav1.ConditionFalse, Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", runningPods, storage.Spec.Nodes), + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storage.Spec.Nodes), }) return r.updateStatus(ctx, storage, DefaultRequeueDelay) } diff --git a/internal/controllers/storagenodeset/sync.go b/internal/controllers/storagenodeset/sync.go index 953eae92..fc0b9ed4 100644 --- a/internal/controllers/storagenodeset/sync.go +++ b/internal/controllers/storagenodeset/sync.go @@ -14,12 +14,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -228,42 +226,18 @@ func (r *Reconciler) waitForStatefulSetToScale( return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } - podList := &corev1.PodList{} - opts := []client.ListOption{ - client.InNamespace(storageNodeSet.Namespace), - client.MatchingLabels{labels.StatefulsetComponent: storageNodeSet.Name}, - } - - err = r.List(ctx, podList, opts...) - if err != nil { - r.Recorder.Event( - storageNodeSet, - corev1.EventTypeWarning, - "ControllerError", - fmt.Sprintf("Failed to list StatefulSet pods: %s", err), - ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err - } - - runningPods := 0 - for _, e := range podList.Items { - if resources.PodIsReady(e) { - runningPods++ - } - } - - if runningPods != int(storageNodeSet.Spec.Nodes) { + if foundStatefulSet.Status.ReadyReplicas != storageNodeSet.Spec.Nodes { r.Recorder.Event( storageNodeSet, corev1.EventTypeNormal, string(StorageNodeSetProvisioning), - fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", runningPods, storageNodeSet.Spec.Nodes), + fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storageNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ Type: NodeSetProvisionedCondition, Status: metav1.ConditionFalse, Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", runningPods, storageNodeSet.Spec.Nodes), + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storageNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, storageNodeSet, DefaultRequeueDelay) } diff --git a/internal/resources/database.go b/internal/resources/database.go index d7fb2902..4276b3d0 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -200,6 +200,9 @@ func (b *DatabaseBuilder) getNodeSetBuilders(databaseLabels labels.Labels) []Res nodeSetLabels := databaseLabels.Copy() nodeSetLabels.Merge(nodeSetSpecInline.Labels) nodeSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: nodeSetSpecInline.Name}) + if nodeSetSpecInline.Remote != nil { + nodeSetLabels.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) + } nodeSetAnnotations := CopyDict(b.Annotations) if nodeSetSpecInline.Annotations != nil { @@ -210,9 +213,6 @@ func (b *DatabaseBuilder) getNodeSetBuilders(databaseLabels labels.Labels) []Res databaseNodeSetSpec := b.recastDatabaseNodeSetSpecInline(nodeSetSpecInline.DeepCopy()) if nodeSetSpecInline.Remote != nil { - nodeSetLabels = nodeSetLabels.Merge(map[string]string{ - labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster, - }) nodeSetBuilders = append( nodeSetBuilders, &RemoteDatabaseNodeSetBuilder{ diff --git a/internal/resources/databasenodeset.go b/internal/resources/databasenodeset.go index 9e57519a..ce044d55 100644 --- a/internal/resources/databasenodeset.go +++ b/internal/resources/databasenodeset.go @@ -58,9 +58,15 @@ func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [ ydbCr := api.RecastDatabaseNodeSet(b.Unwrap()) databaseLabels := labels.DatabaseLabels(ydbCr) + statefulSetName := b.Name statefulSetLabels := databaseLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: b.Labels[labels.DatabaseNodeSetComponent]}) - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: statefulSetName}) + + databaseNodeSetName := b.Labels[labels.DatabaseNodeSetComponent] + statefulSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: databaseNodeSetName}) + if remoteCluster, exist := b.Labels[labels.RemoteClusterKey]; exist { + statefulSetLabels.Merge(map[string]string{labels.RemoteClusterKey: remoteCluster}) + } statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) @@ -68,10 +74,10 @@ func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [ var resourceBuilders []ResourceBuilder resourceBuilders = append(resourceBuilders, &DatabaseStatefulSetBuilder{ - Database: api.RecastDatabaseNodeSet(b.DatabaseNodeSet), + Database: ydbCr, RestConfig: restConfig, - Name: b.Name, + Name: statefulSetName, Labels: statefulSetLabels, Annotations: statefulSetAnnotations, }, diff --git a/internal/resources/storage.go b/internal/resources/storage.go index 63a173c7..38169a60 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -165,6 +165,9 @@ func (b *StorageClusterBuilder) getNodeSetBuilders(storageLabels labels.Labels) nodeSetLabels := storageLabels.Copy() nodeSetLabels.Merge(nodeSetSpecInline.Labels) nodeSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: nodeSetSpecInline.Name}) + if nodeSetSpecInline.Remote != nil { + nodeSetLabels.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) + } nodeSetAnnotations := CopyDict(b.Annotations) if nodeSetSpecInline.Annotations != nil { @@ -175,9 +178,6 @@ func (b *StorageClusterBuilder) getNodeSetBuilders(storageLabels labels.Labels) storageNodeSetSpec := b.recastStorageNodeSetSpecInline(nodeSetSpecInline.DeepCopy()) if nodeSetSpecInline.Remote != nil { - nodeSetLabels = nodeSetLabels.Merge(map[string]string{ - labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster, - }) nodeSetBuilders = append( nodeSetBuilders, &RemoteStorageNodeSetBuilder{ diff --git a/internal/resources/storagenodeset.go b/internal/resources/storagenodeset.go index d206474f..0fd915a5 100644 --- a/internal/resources/storagenodeset.go +++ b/internal/resources/storagenodeset.go @@ -58,9 +58,15 @@ func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [] ydbCr := api.RecastStorageNodeSet(b.Unwrap()) storageLabels := labels.StorageLabels(ydbCr) + statefulSetName := b.Name statefulSetLabels := storageLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: b.Labels[labels.DatabaseNodeSetComponent]}) - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: statefulSetName}) + + storageNodeSetName := b.Labels[labels.StorageNodeSetComponent] + statefulSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: storageNodeSetName}) + if remoteCluster, exist := b.Labels[labels.RemoteClusterKey]; exist { + statefulSetLabels.Merge(map[string]string{labels.RemoteClusterKey: remoteCluster}) + } statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) @@ -69,10 +75,10 @@ func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [] resourceBuilders = append( resourceBuilders, &StorageStatefulSetBuilder{ - Storage: api.RecastStorageNodeSet(b.StorageNodeSet), + Storage: ydbCr, RestConfig: restConfig, - Name: b.Name, + Name: statefulSetName, Labels: statefulSetLabels, Annotations: statefulSetAnnotations, }, From 20bfc74bb95762b8ac59b28c81e180c4c7935205 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 1 Jul 2024 23:46:10 +0300 Subject: [PATCH 13/70] YDBOPS-8536 Do not trigger Reconcile on CREATE event for Owns (#229) * ignore CREATE event from owns objects * unit-test detect StatefulSet delete event * compare only lastApplied annotation * fix misspell lint * bump helm chart version --- Makefile | 4 +- deploy/ydb-operator/Chart.yaml | 4 +- internal/annotations/annotations.go | 33 ++----- internal/controllers/database/controller.go | 36 +++++--- .../controllers/databasenodeset/controller.go | 14 +-- .../remotedatabasenodeset/controller.go | 19 ++-- .../remotestoragenodeset/controller.go | 19 ++-- internal/controllers/storage/controller.go | 35 ++++--- .../controllers/storage/controller_test.go | 9 ++ internal/controllers/storage/init.go | 12 +++ .../controllers/storagenodeset/controller.go | 14 +-- internal/resources/databasenodeset.go | 4 + internal/resources/predicate.go | 91 +++++++++++++++++++ internal/resources/remotedatabasenodeset.go | 4 + internal/resources/remotestoragenodeset.go | 4 + internal/resources/resource.go | 47 ---------- internal/resources/storagenodeset.go | 6 +- 17 files changed, 220 insertions(+), 135 deletions(-) create mode 100644 internal/resources/predicate.go diff --git a/Makefile b/Makefile index 03c416e9..8807f845 100644 --- a/Makefile +++ b/Makefile @@ -79,11 +79,11 @@ kind-load: .PHONY: unit-test unit-test: manifests generate fmt vet envtest ## Run unit tests - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 1800s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 900s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out .PHONY: e2e-test e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests - go test -v -timeout 1800s -p 1 ./e2e/... -args -ginkgo.v + go test -v -timeout 3600s -p 1 ./e2e/... -args -ginkgo.v .PHONY: test test: unit-test e2e-test ## Run all tests diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index c1595dc3..049a171d 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.18 +version: 0.5.19 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.18" +appVersion: "0.5.19" diff --git a/internal/annotations/annotations.go b/internal/annotations/annotations.go index e3942940..db590ad8 100644 --- a/internal/annotations/annotations.go +++ b/internal/annotations/annotations.go @@ -1,7 +1,5 @@ package annotations -import "strings" - const ( PrimaryResourceStorageAnnotation = "ydb.tech/primary-resource-storage" PrimaryResourceDatabaseAnnotation = "ydb.tech/primary-resource-database" @@ -11,30 +9,17 @@ const ( LastAppliedAnnotation = "ydb.tech/last-applied" ) -func GetYdbTechAnnotations(annotations map[string]string) map[string]string { - result := make(map[string]string) - for key, value := range annotations { - if strings.HasPrefix(key, "ydb.tech/") { - result[key] = value - } - } - return result +func CompareLastAppliedAnnotation(map1, map2 map[string]string) bool { + value1 := getLastAppliedAnnotation(map1) + value2 := getLastAppliedAnnotation(map2) + return value1 == value2 } -func CompareMaps(map1, map2 map[string]string) bool { - if len(map1) != len(map2) { - return false - } - for key1, value1 := range map1 { - if value2, ok := map2[key1]; !ok || value2 != value1 { - return false +func getLastAppliedAnnotation(annotations map[string]string) string { + for key, value := range annotations { + if key == LastAppliedAnnotation { + return value } } - return true -} - -func CompareYdbTechAnnotations(map1, map2 map[string]string) bool { - map1 = GetYdbTechAnnotations(map1) - map2 = GetYdbTechAnnotations(map2) - return CompareMaps(map1, map2) + return "" } diff --git a/internal/controllers/database/controller.go b/internal/controllers/database/controller.go index c2060038..71fa7f18 100644 --- a/internal/controllers/database/controller.go +++ b/internal/controllers/database/controller.go @@ -13,6 +13,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" @@ -69,6 +70,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu r.Log.Error(err, "unexpected Get error") return ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } + result, err := r.Sync(ctx, resource) if err != nil { r.Log.Error(err, "unexpected Sync error") @@ -152,23 +154,31 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { } return controller. - For(&v1alpha1.Database{}). - Owns(&v1alpha1.RemoteDatabaseNodeSet{}). - Owns(&v1alpha1.DatabaseNodeSet{}). - Owns(&appsv1.StatefulSet{}). - Owns(&corev1.ConfigMap{}). - Owns(&corev1.Service{}). + For(&v1alpha1.Database{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + Owns(&v1alpha1.RemoteDatabaseNodeSet{}, + builder.WithPredicates(resources.LastAppliedAnnotationPredicate()), // TODO: YDBOPS-9194 + ). + Owns(&v1alpha1.DatabaseNodeSet{}, + builder.WithPredicates(resources.LastAppliedAnnotationPredicate()), // TODO: YDBOPS-9194 + ). + Owns(&appsv1.StatefulSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + Owns(&corev1.ConfigMap{}, + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), + ). + Owns(&corev1.Service{}, + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), + ). Watches( &source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.findDatabasesForSecret), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). - WithEventFilter(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate(), - resources.IsServicePredicate(), - resources.IsSecretPredicate(), - )). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + WithEventFilter(resources.IsDatabaseCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/controllers/databasenodeset/controller.go b/internal/controllers/databasenodeset/controller.go index f1045dfa..36219778 100644 --- a/internal/controllers/databasenodeset/controller.go +++ b/internal/controllers/databasenodeset/controller.go @@ -10,6 +10,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" @@ -66,12 +67,13 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { controller := ctrl.NewControllerManagedBy(mgr) return controller. - For(&v1alpha1.DatabaseNodeSet{}). - Owns(&appsv1.StatefulSet{}). - WithEventFilter(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate()), + For(&v1alpha1.DatabaseNodeSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), ). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + Owns(&appsv1.StatefulSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + WithEventFilter(resources.IsDatabaseNodeSetCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/controllers/remotedatabasenodeset/controller.go b/internal/controllers/remotedatabasenodeset/controller.go index c9479c25..ae0d662c 100644 --- a/internal/controllers/remotedatabasenodeset/controller.go +++ b/internal/controllers/remotedatabasenodeset/controller.go @@ -165,31 +165,30 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, remoteCluster *cluster.C Watches( source.NewKindWithCache(&v1alpha1.RemoteDatabaseNodeSet{}, cluster.GetCache()), &handler.EnqueueRequestForObject{}, - builder.WithPredicates(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate(), - )), + builder.WithPredicates(predicate.GenerationChangedPredicate{}), ). Watches( &source.Kind{Type: &v1alpha1.DatabaseNodeSet{}}, &handler.EnqueueRequestForObject{}, - builder.WithPredicates( - resources.LabelExistsPredicate(isNodeSetFromMgmt), - ), + builder.WithPredicates(resources.LabelExistsPredicate(isNodeSetFromMgmt)), ). Watches( &source.Kind{Type: &corev1.Service{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). Watches( - &source.Kind{Type: &corev1.Secret{}}, + &source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). Watches( - &source.Kind{Type: &corev1.ConfigMap{}}, + &source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + WithEventFilter(resources.IsRemoteDatabaseNodeSetCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/controllers/remotestoragenodeset/controller.go b/internal/controllers/remotestoragenodeset/controller.go index aafe961a..91ce95ea 100644 --- a/internal/controllers/remotestoragenodeset/controller.go +++ b/internal/controllers/remotestoragenodeset/controller.go @@ -165,31 +165,30 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, remoteCluster *cluster.C Watches( source.NewKindWithCache(&v1alpha1.RemoteStorageNodeSet{}, cluster.GetCache()), &handler.EnqueueRequestForObject{}, - builder.WithPredicates(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate(), - )), + builder.WithPredicates(predicate.GenerationChangedPredicate{}), ). Watches( &source.Kind{Type: &v1alpha1.StorageNodeSet{}}, &handler.EnqueueRequestForObject{}, - builder.WithPredicates( - resources.LabelExistsPredicate(isNodeSetFromMgmt), - ), + builder.WithPredicates(resources.LabelExistsPredicate(isNodeSetFromMgmt)), ). Watches( &source.Kind{Type: &corev1.Service{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). Watches( - &source.Kind{Type: &corev1.Secret{}}, + &source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). Watches( - &source.Kind{Type: &corev1.ConfigMap{}}, + &source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(annotationFilter), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + WithEventFilter(resources.IsRemoteStorageNodeSetCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/controllers/storage/controller.go b/internal/controllers/storage/controller.go index 15dfec9a..23354aeb 100644 --- a/internal/controllers/storage/controller.go +++ b/internal/controllers/storage/controller.go @@ -14,6 +14,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" @@ -160,23 +161,31 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { } return controller. - For(&v1alpha1.Storage{}). - Owns(&v1alpha1.RemoteStorageNodeSet{}). - Owns(&v1alpha1.StorageNodeSet{}). - Owns(&appsv1.StatefulSet{}). - Owns(&corev1.ConfigMap{}). - Owns(&corev1.Service{}). + For(&v1alpha1.Storage{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + Owns(&v1alpha1.RemoteStorageNodeSet{}, + builder.WithPredicates(resources.LastAppliedAnnotationPredicate()), // TODO: YDBOPS-9194 + ). + Owns(&v1alpha1.StorageNodeSet{}, + builder.WithPredicates(resources.LastAppliedAnnotationPredicate()), // TODO: YDBOPS-9194 + ). + Owns(&appsv1.StatefulSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + Owns(&corev1.ConfigMap{}, + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), + ). + Owns(&corev1.Service{}, + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), + ). Watches( &source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.findStoragesForSecret), + builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}), ). - WithEventFilter(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate(), - resources.IsServicePredicate(), - resources.IsSecretPredicate(), - )). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + WithEventFilter(resources.IsStorageCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index 7500535a..92e74ff3 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -186,6 +186,15 @@ var _ = Describe("Storage controller medium tests", func() { }, }, )) + + By("check that delete StatefulSet event was detected...") + Expect(k8sClient.List(ctx, &foundStatefulSets, client.InNamespace(testobjects.YdbNamespace))).ShouldNot(HaveOccurred()) + Expect(len(foundStatefulSets.Items)).Should(Equal(1)) + Expect(k8sClient.Delete(ctx, &foundStatefulSets.Items[0])).ShouldNot(HaveOccurred()) + Eventually(func() int { + Expect(k8sClient.List(ctx, &foundStatefulSets, client.InNamespace(testobjects.YdbNamespace))).ShouldNot(HaveOccurred()) + return len(foundStatefulSets.Items) + }, test.Timeout, test.Interval).Should(Equal(1)) }) }) }) diff --git a/internal/controllers/storage/init.go b/internal/controllers/storage/init.go index cdcb5b78..d92f6c88 100644 --- a/internal/controllers/storage/init.go +++ b/internal/controllers/storage/init.go @@ -119,6 +119,12 @@ func (r *Reconciler) initializeBlobstorage( return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } + r.Recorder.Event( + storage, + corev1.EventTypeNormal, + "InitializingStorage", + fmt.Sprintf("Successfully created Job %s", fmt.Sprintf(resources.InitJobNameFormat, storage.Name)), + ) return Stop, ctrl.Result{RequeueAfter: StorageInitializationRequeueDelay}, nil } @@ -207,6 +213,12 @@ func (r *Reconciler) initializeBlobstorage( return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } + r.Recorder.Event( + storage, + corev1.EventTypeNormal, + "InitializingStorage", + fmt.Sprintf("Waiting for Job %s status update", initJob.Name), + ) return Stop, ctrl.Result{RequeueAfter: StorageInitializationRequeueDelay}, nil } diff --git a/internal/controllers/storagenodeset/controller.go b/internal/controllers/storagenodeset/controller.go index e819c912..e65e2070 100644 --- a/internal/controllers/storagenodeset/controller.go +++ b/internal/controllers/storagenodeset/controller.go @@ -10,6 +10,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" @@ -65,12 +66,13 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { controller := ctrl.NewControllerManagedBy(mgr) return controller. - For(&v1alpha1.StorageNodeSet{}). - Owns(&appsv1.StatefulSet{}). - WithEventFilter(predicate.Or( - predicate.GenerationChangedPredicate{}, - resources.LastAppliedAnnotationPredicate()), + For(&v1alpha1.StorageNodeSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), ). - WithEventFilter(resources.IgnoreDeletetionPredicate()). + Owns(&appsv1.StatefulSet{}, + builder.WithPredicates(predicate.GenerationChangedPredicate{}), + ). + WithEventFilter(resources.IsStorageNodeSetCreatePredicate()). + WithEventFilter(resources.IgnoreDeleteStateUnknownPredicate()). Complete(r) } diff --git a/internal/resources/databasenodeset.go b/internal/resources/databasenodeset.go index ce044d55..5050fbc2 100644 --- a/internal/resources/databasenodeset.go +++ b/internal/resources/databasenodeset.go @@ -88,6 +88,10 @@ func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [ func NewDatabaseNodeSet(databaseNodeSet *api.DatabaseNodeSet) DatabaseNodeSetResource { crDatabaseNodeSet := databaseNodeSet.DeepCopy() + if crDatabaseNodeSet.Spec.Service.Status.TLSConfiguration == nil { + crDatabaseNodeSet.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} + } + return DatabaseNodeSetResource{DatabaseNodeSet: crDatabaseNodeSet} } diff --git a/internal/resources/predicate.go b/internal/resources/predicate.go new file mode 100644 index 00000000..65e1a241 --- /dev/null +++ b/internal/resources/predicate.go @@ -0,0 +1,91 @@ +package resources + +import ( + "k8s.io/apimachinery/pkg/labels" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/event" + "sigs.k8s.io/controller-runtime/pkg/predicate" + + api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" +) + +func LastAppliedAnnotationPredicate() predicate.Predicate { + return predicate.Funcs{ + UpdateFunc: func(e event.UpdateEvent) bool { + return !annotations.CompareLastAppliedAnnotation( + e.ObjectOld.GetAnnotations(), + e.ObjectNew.GetAnnotations(), + ) + }, + } +} + +func IsStorageCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isStorage := e.Object.(*api.Storage) + return isStorage + }, + } +} + +func IsStorageNodeSetCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isStorageNodeSet := e.Object.(*api.StorageNodeSet) + return isStorageNodeSet + }, + } +} + +func IsRemoteStorageNodeSetCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isRemoteStorageNodeSet := e.Object.(*api.RemoteStorageNodeSet) + return isRemoteStorageNodeSet + }, + } +} + +func IsDatabaseCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isDatabase := e.Object.(*api.Database) + return isDatabase + }, + } +} + +func IsDatabaseNodeSetCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isDatabaseNodeSet := e.Object.(*api.DatabaseNodeSet) + return isDatabaseNodeSet + }, + } +} + +func IsRemoteDatabaseNodeSetCreatePredicate() predicate.Predicate { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + _, isRemoteDatabaseNodeSet := e.Object.(*api.RemoteDatabaseNodeSet) + return isRemoteDatabaseNodeSet + }, + } +} + +func IgnoreDeleteStateUnknownPredicate() predicate.Predicate { + return predicate.Funcs{ + DeleteFunc: func(e event.DeleteEvent) bool { + // Evaluates to false if the object has been confirmed deleted. + return !e.DeleteStateUnknown + }, + } +} + +func LabelExistsPredicate(selector labels.Selector) predicate.Predicate { + return predicate.NewPredicateFuncs(func(o client.Object) bool { + return selector.Matches(labels.Set(o.GetLabels())) + }) +} diff --git a/internal/resources/remotedatabasenodeset.go b/internal/resources/remotedatabasenodeset.go index c3a7efd4..93fcf5c1 100644 --- a/internal/resources/remotedatabasenodeset.go +++ b/internal/resources/remotedatabasenodeset.go @@ -82,6 +82,10 @@ func (b *RemoteDatabaseNodeSetResource) GetResourceBuilders() []ResourceBuilder func NewRemoteDatabaseNodeSet(remoteDatabaseNodeSet *api.RemoteDatabaseNodeSet) RemoteDatabaseNodeSetResource { crRemoteDatabaseNodeSet := remoteDatabaseNodeSet.DeepCopy() + if crRemoteDatabaseNodeSet.Spec.Service.Status.TLSConfiguration == nil { + crRemoteDatabaseNodeSet.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} + } + return RemoteDatabaseNodeSetResource{RemoteDatabaseNodeSet: crRemoteDatabaseNodeSet} } diff --git a/internal/resources/remotestoragenodeset.go b/internal/resources/remotestoragenodeset.go index 635ed591..c8dbf8d9 100644 --- a/internal/resources/remotestoragenodeset.go +++ b/internal/resources/remotestoragenodeset.go @@ -82,6 +82,10 @@ func (b *RemoteStorageNodeSetResource) GetResourceBuilders() []ResourceBuilder { func NewRemoteStorageNodeSet(remoteStorageNodeSet *api.RemoteStorageNodeSet) RemoteStorageNodeSetResource { crRemoteStorageNodeSet := remoteStorageNodeSet.DeepCopy() + if crRemoteStorageNodeSet.Spec.Service.Status.TLSConfiguration == nil { + crRemoteStorageNodeSet.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} + } + return RemoteStorageNodeSetResource{RemoteStorageNodeSet: crRemoteStorageNodeSet} } diff --git a/internal/resources/resource.go b/internal/resources/resource.go index ac3f0e52..0a6be746 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -16,7 +16,6 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/rest" @@ -24,8 +23,6 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/predicate" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" ydbannotations "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" @@ -353,50 +350,6 @@ func EqualRemoteResourceWithObject( return false } -func LastAppliedAnnotationPredicate() predicate.Predicate { - return predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - return !ydbannotations.CompareYdbTechAnnotations( - e.ObjectOld.GetAnnotations(), - e.ObjectNew.GetAnnotations(), - ) - }, - } -} - -func IgnoreDeletetionPredicate() predicate.Predicate { - return predicate.Funcs{ - DeleteFunc: func(e event.DeleteEvent) bool { - // Evaluates to false if the object has been confirmed deleted. - return !e.DeleteStateUnknown - }, - } -} - -func IsServicePredicate() predicate.Predicate { - return predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - _, isService := e.ObjectOld.(*corev1.Service) - return isService - }, - } -} - -func IsSecretPredicate() predicate.Predicate { - return predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - _, isSecret := e.ObjectOld.(*corev1.Secret) - return isSecret - }, - } -} - -func LabelExistsPredicate(selector labels.Selector) predicate.Predicate { - return predicate.NewPredicateFuncs(func(o client.Object) bool { - return selector.Matches(labels.Set(o.GetLabels())) - }) -} - func getYDBStaticCredentials( ctx context.Context, storage *api.Storage, diff --git a/internal/resources/storagenodeset.go b/internal/resources/storagenodeset.go index 0fd915a5..efbc446c 100644 --- a/internal/resources/storagenodeset.go +++ b/internal/resources/storagenodeset.go @@ -90,9 +90,11 @@ func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [] func NewStorageNodeSet(storageNodeSet *api.StorageNodeSet) StorageNodeSetResource { crStorageNodeSet := storageNodeSet.DeepCopy() - return StorageNodeSetResource{ - StorageNodeSet: crStorageNodeSet, + if crStorageNodeSet.Spec.Service.Status.TLSConfiguration == nil { + crStorageNodeSet.Spec.Service.Status.TLSConfiguration = &api.TLSConfiguration{Enabled: false} } + + return StorageNodeSetResource{StorageNodeSet: crStorageNodeSet} } func (b *StorageNodeSetResource) Unwrap() *api.StorageNodeSet { From 5be25454f6fb709693f5812cb783f9abbb184f37 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:54:48 +0300 Subject: [PATCH 14/70] Beautify GitHub CI tests output (#230) * use concurrency group * using gotestsum * retry docker pull kube-webhook-certgen --- .github/workflows/run-tests.yml | 106 +++++++++++++++++++++++++++----- Makefile | 2 +- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8221c258..dd847b36 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -45,6 +45,9 @@ jobs: uses: actions/checkout@v3 if: github.event.pull_request.head.sha == '' lint: + concurrency: + group: lint-golangci-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true needs: - start-runner - smart-checkout @@ -62,6 +65,9 @@ jobs: with: version: v1.52.2 code-format-check: + concurrency: + group: lint-autoformat-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true needs: - start-runner - smart-checkout @@ -82,13 +88,65 @@ jobs: run: bash ./.github/scripts/format-all-go-code.sh "$PWD" - name: Check repository diff run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken" - run-tests: + run-unit-tests: + concurrency: + group: run-unit-tests-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true needs: - start-runner - smart-checkout + - lint + - code-format-check + runs-on: ${{ needs.start-runner.outputs.runner-label }} + outputs: + result: ${{ steps.run-unit-tests.outputs.result }} + steps: + - name: set-env-vars + run: | + echo "HOME=/actions-runner" >> $GITHUB_ENV + - name: setup-go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + - name: setup-medium-test-class-binaries + run: | + # This installs kube-apiserver and etcd binaries for `medium` + # class tests. Refer to the writing tests docs for more info. + make envtest + KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.26 -p path) + echo "KUBEBUILDER_ASSETS=$KUBEBUILDER_ASSETS" >> $GITHUB_ENV + - name: setup-gotestsum + run: | + go install gotest.tools/gotestsum@v1.12.0 + - name: run-unit-tests + id: run-unit-tests + run: | + gotestsum --format pkgname --jsonfile log.json -- -v -timeout 900s -p 1 ./internal/... -ginkgo.vv -coverprofile cover.out + - name: convert-to-human-readable + run: jq -r '.Output| gsub("[\\n]"; "")' log.json 2>/dev/null 1>log.txt || true + - name: artifact-upload-step + uses: actions/upload-artifact@v4 + id: artifact-upload-step + if: always() + with: + name: unit-tests-log + path: log.txt + if-no-files-found: error + - name: echo-tests-log-url + run: echo 'Unit tests log URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}' + run-e2e-tests: + concurrency: + group: run-e2e-tests-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + needs: + - start-runner + - smart-checkout + - lint + - code-format-check + - run-unit-tests runs-on: ${{ needs.start-runner.outputs.runner-label }} outputs: - result: ${{ steps.run-tests.outputs.result }} + result: ${{ steps.run-e2e-tests.outputs.result }} steps: - name: set-env-vars run: | @@ -128,13 +186,6 @@ jobs: kind version kubectl version --client=true helm version - - name: setup-medium-test-class-binaries - run: | - # This installs kube-apiserver and etcd binaries for `medium` - # class tests. Refer to the writing tests docs for more info. - make envtest - KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.26 -p path) - echo "KUBEBUILDER_ASSETS=$KUBEBUILDER_ASSETS" >> $GITHUB_ENV - name: setup-k8s-cluster run: | kind delete cluster @@ -153,26 +204,49 @@ jobs: - name: load-and-deploy-operator run: | kind load docker-image kind/ydb-operator:current - - name: pull-and-load-other-images + - name: pull-and-load-kube-webhook-certgen-image + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + retry_wait_seconds: 20 + max_attempts: 3 + command: | + docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 + kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 + - name: pull-and-load-ydb-image run: | - docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 - kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 - # TODO would be cool to parse YDB image from manifests to avoid duplicating information docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 - - name: run-tests + - name: setup-gotestsum run: | - go test -v -timeout 3600s -p 1 ./... -args -ginkgo.v + go install gotest.tools/gotestsum@v1.12.0 + - name: run-e2e-tests + id: run-e2e-tests + run: | + gotestsum --format pkgname --jsonfile log.json -- -v -timeout 3600s -p 1 ./e2e/... -ginkgo.vv + - name: convert-to-human-readable + run: jq -r '.Output| gsub("[\\n]"; "")' log.json 2>/dev/null 1>log.txt || true + - name: artifact-upload-step + uses: actions/upload-artifact@v4 + id: artifact-upload-step + if: always() + with: + name: e2e-tests-log + path: log.txt + if-no-files-found: error + - name: echo-tests-log-url + run: echo 'Unit tests log URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}' - name: teardown-k8s-cluster run: | kind delete cluster stop-runner: needs: - start-runner - - run-tests - lint - code-format-check + - run-unit-tests + - run-e2e-tests runs-on: ubuntu-latest if: always() steps: diff --git a/Makefile b/Makefile index 8807f845..9962da2f 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ unit-test: manifests generate fmt vet envtest ## Run unit tests .PHONY: e2e-test e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests - go test -v -timeout 3600s -p 1 ./e2e/... -args -ginkgo.v + go test -v -timeout 3600s -p 1 ./e2e/... -ginkgo.v .PHONY: test test: unit-test e2e-test ## Run all tests From 71402a77a0802f94eecb7aeea72d0d08d4746c9d Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:51:36 +0300 Subject: [PATCH 15/70] update ydb docker image version for samples (#231) --- samples/database.yaml | 2 +- samples/minikube/database.yaml | 2 +- samples/minikube/storage.yaml | 2 +- samples/storage-block-4-2.yaml | 2 +- samples/storage-mirror-3dc-nodeset.yaml | 2 +- samples/storage-mirror-3dc.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/database.yaml b/samples/database.yaml index 60dcd62f..0aa381de 100644 --- a/samples/database.yaml +++ b/samples/database.yaml @@ -4,7 +4,7 @@ metadata: name: database-sample spec: image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 3 resources: storageUnits: diff --git a/samples/minikube/database.yaml b/samples/minikube/database.yaml index 9066208d..0eab7436 100644 --- a/samples/minikube/database.yaml +++ b/samples/minikube/database.yaml @@ -4,7 +4,7 @@ metadata: name: database-minikube-sample spec: image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 1 domain: Root service: diff --git a/samples/minikube/storage.yaml b/samples/minikube/storage.yaml index f3fabc6a..43d2db5a 100644 --- a/samples/minikube/storage.yaml +++ b/samples/minikube/storage.yaml @@ -5,7 +5,7 @@ metadata: spec: dataStore: [] image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 1 domain: Root erasure: none diff --git a/samples/storage-block-4-2.yaml b/samples/storage-block-4-2.yaml index 5890ee74..e4bfa4c8 100644 --- a/samples/storage-block-4-2.yaml +++ b/samples/storage-block-4-2.yaml @@ -11,7 +11,7 @@ spec: storage: 93Gi volumeMode: Block image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 8 erasure: block-4-2 configuration: |- diff --git a/samples/storage-mirror-3dc-nodeset.yaml b/samples/storage-mirror-3dc-nodeset.yaml index d058b651..5029331c 100644 --- a/samples/storage-mirror-3dc-nodeset.yaml +++ b/samples/storage-mirror-3dc-nodeset.yaml @@ -11,7 +11,7 @@ spec: requests: storage: 80Gi image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 9 nodeSets: - name: nodeset-1 diff --git a/samples/storage-mirror-3dc.yaml b/samples/storage-mirror-3dc.yaml index 07f9b307..7b1d42d3 100644 --- a/samples/storage-mirror-3dc.yaml +++ b/samples/storage-mirror-3dc.yaml @@ -11,7 +11,7 @@ spec: requests: storage: 80Gi image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 nodes: 9 erasure: mirror-3-dc configuration: |- From 3b62f2d27a858142f2e6fcb2ce9f7ce4eb1f825a Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:02:41 +0300 Subject: [PATCH 16/70] YDBOPS-9168 Storage finalizer waiting for existing Databases (#211) --- deploy/ydb-operator/Chart.yaml | 4 +- e2e/tests/smoke_test.go | 107 ++++++++++++++++-- e2e/tests/test-objects/objects.go | 2 + internal/annotations/annotations.go | 1 + .../remotedatabasenodeset/controller_test.go | 2 + .../remotestoragenodeset/controller_test.go | 1 + internal/controllers/storage/controller.go | 93 +++++++++++++++ 7 files changed, 201 insertions(+), 9 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 049a171d..7600af0c 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.19 +version: 0.5.20 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.19" +appVersion: "0.5.20" diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index 678e1718..9aacbcba 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -31,6 +32,7 @@ import ( testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" ) const ( @@ -158,7 +160,7 @@ func bringYdbCliToPod(podName, podNamespace string) { }, Timeout, Interval).Should(BeNil()) } -func executeSimpleQuery(ctx context.Context, podName, podNamespace, storageEndpoint string) { +func executeSimpleQuery(podName, podNamespace, storageEndpoint string) { Eventually(func(g Gomega) string { args := []string{ "-n", @@ -345,7 +347,7 @@ var _ = Describe("Operator smoke test", func() { bringYdbCliToPod(podName, testobjects.YdbNamespace) By("execute simple query inside ydb database pod...") - executeSimpleQuery(ctx, podName, testobjects.YdbNamespace, storageEndpoint) + executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) }) It("pause and un-pause Storage, should destroy and bring up Pods", func() { @@ -492,7 +494,6 @@ var _ = Describe("Operator smoke test", func() { It("create storage and database with nodeSets", func() { By("issuing create commands...") storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-config-nodeSets.yaml")) - databaseSample = testobjects.DefaultDatabase() testNodeSetName := "nodeset" for idx := 1; idx <= 2; idx++ { storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ @@ -572,7 +573,7 @@ var _ = Describe("Operator smoke test", func() { bringYdbCliToPod(podName, testobjects.YdbNamespace) By("execute simple query inside ydb database pod...") - executeSimpleQuery(ctx, podName, testobjects.YdbNamespace, storageEndpoint) + executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) }) It("operatorConnection check, create storage with default staticCredentials", func() { @@ -652,28 +653,115 @@ var _ = Describe("Operator smoke test", func() { LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, Key: "ca.crt", } - Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) }() + + By("waiting until Storage is ready...") + waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + + By("checking that all the storage pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + By("create database...") + databaseSample.Spec.Service.GRPC.TLSConfiguration.Enabled = true + databaseSample.Spec.Service.GRPC.TLSConfiguration.Certificate = corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "tls.crt", + } + databaseSample.Spec.Service.GRPC.TLSConfiguration.Key = corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "tls.key", + } + databaseSample.Spec.Service.GRPC.TLSConfiguration.CertificateAuthority = corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, + Key: "ca.crt", + } Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() + By("waiting until database is ready...") + waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + + By("checking that all the database pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + + storagePods := corev1.PodList{} + Expect(k8sClient.List(ctx, &storagePods, + client.InNamespace(testobjects.YdbNamespace), + client.MatchingLabels{ + "ydb-cluster": "kind-database", + })).Should(Succeed()) + podName := storagePods.Items[0].Name + + By("bring YDB CLI inside ydb storage pod...") + bringYdbCliToPod(podName, testobjects.YdbNamespace) + + By("execute simple query inside ydb storage pod...") + storageEndpoint := fmt.Sprintf("grpcs://%s:%d", testobjects.StorageGRPCService, testobjects.StorageGRPCPort) + executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + }) + + It("Check that Storage deleted after Database...", func() { + By("create storage...") + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + + By("create database...") + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) - By("waiting until database is ready...") + By("waiting until Database is ready...") waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + + By("delete Storage...") + Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) + + By("checking that Storage deletionTimestamp is not nil...") + Eventually(func() bool { + foundStorage := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundStorage) + if err != nil { + return false + } + return !foundStorage.DeletionTimestamp.IsZero() + }, test.Timeout, test.Interval).Should(BeTrue()) + + By("checking that Storage is present in cluster...") + Consistently(func() error { + foundStorage := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundStorage) + return err + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("delete Database...") + Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) + + By("checking that Storage deleted from cluster...") + Eventually(func() bool { + foundStorage := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundStorage) + return apierrors.IsNotFound(err) + }, test.Timeout, test.Interval).Should(BeTrue()) }) It("TLS for status service", func() { @@ -740,13 +828,18 @@ var _ = Describe("Operator smoke test", func() { Key: "ca.crt", }, } - Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) + }() By("create database...") databaseSample.Spec.Nodes = 1 databaseSample.Spec.Service.Status = *storageSample.Spec.Service.Status.DeepCopy() Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) + }() By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) diff --git a/e2e/tests/test-objects/objects.go b/e2e/tests/test-objects/objects.go index d9fc5648..17d30094 100644 --- a/e2e/tests/test-objects/objects.go +++ b/e2e/tests/test-objects/objects.go @@ -18,6 +18,8 @@ const ( CertificateSecretName = "storage-crt" DefaultDomain = "Root" ReadyStatus = "Ready" + StorageGRPCService = "storage-grpc.ydb.svc.cluster.local" + StorageGRPCPort = 2135 ) func constructAntiAffinityFor(key, value string) *corev1.Affinity { diff --git a/internal/annotations/annotations.go b/internal/annotations/annotations.go index db590ad8..5fa06070 100644 --- a/internal/annotations/annotations.go +++ b/internal/annotations/annotations.go @@ -5,6 +5,7 @@ const ( PrimaryResourceDatabaseAnnotation = "ydb.tech/primary-resource-database" RemoteResourceVersionAnnotation = "ydb.tech/remote-resource-version" ConfigurationChecksum = "ydb.tech/configuration-checksum" + StorageFinalizerKey = "ydb.tech/storage-finalizer" RemoteFinalizerKey = "ydb.tech/remote-finalizer" LastAppliedAnnotation = "ydb.tech/last-applied" ) diff --git a/internal/controllers/remotedatabasenodeset/controller_test.go b/internal/controllers/remotedatabasenodeset/controller_test.go index 3780c6cf..2e7ca0a8 100644 --- a/internal/controllers/remotedatabasenodeset/controller_test.go +++ b/internal/controllers/remotedatabasenodeset/controller_test.go @@ -347,6 +347,8 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { }) AfterEach(func() { + Expect(localClient.Delete(ctx, databaseSample)).Should(Succeed()) + Expect(localClient.Delete(ctx, storageSample)).Should(Succeed()) deleteAll(localEnv, localClient, &localNamespace) deleteAll(remoteEnv, remoteClient, &localNamespace) }) diff --git a/internal/controllers/remotestoragenodeset/controller_test.go b/internal/controllers/remotestoragenodeset/controller_test.go index 343eace5..28882efe 100644 --- a/internal/controllers/remotestoragenodeset/controller_test.go +++ b/internal/controllers/remotestoragenodeset/controller_test.go @@ -279,6 +279,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { }) AfterEach(func() { + Expect(localClient.Delete(ctx, storageSample)).Should(Succeed()) deleteAll(localEnv, localClient, &localNamespace) deleteAll(remoteEnv, remoteClient, &localNamespace) }) diff --git a/internal/controllers/storage/controller.go b/internal/controllers/storage/controller.go index 23354aeb..34239316 100644 --- a/internal/controllers/storage/controller.go +++ b/internal/controllers/storage/controller.go @@ -2,6 +2,8 @@ package storage import ( "context" + "errors" + "fmt" "github.com/go-logr/logr" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" @@ -16,6 +18,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" @@ -23,6 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + ydbannotations "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" ) @@ -77,6 +81,40 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu r.Log.Error(err, "unexpected Get error") return ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err } + + //nolint:nestif + // examine DeletionTimestamp to determine if object is under deletion + if resource.ObjectMeta.DeletionTimestamp.IsZero() { + // The object is not being deleted, so if it does not have our finalizer, + // then lets add the finalizer and update the object. This is equivalent + // to registering our finalizer. + if !controllerutil.ContainsFinalizer(resource, ydbannotations.StorageFinalizerKey) { + controllerutil.AddFinalizer(resource, ydbannotations.StorageFinalizerKey) + if err := r.Client.Update(ctx, resource); err != nil { + return ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + } + } else { + // The object is being deleted + if controllerutil.ContainsFinalizer(resource, ydbannotations.StorageFinalizerKey) { + // our finalizer is present, so lets handle any external dependency + if err := r.checkExistingDatabases(ctx, resource); err != nil { + // if fail to check dependency existence, return with error + // so that it can be retried. + return ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + // remove our finalizer from the list and update it. + controllerutil.RemoveFinalizer(resource, ydbannotations.StorageFinalizerKey) + if err := r.Client.Update(ctx, resource); err != nil { + return ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + } + + // Stop reconciliation as the item is being deleted + return ctrl.Result{Requeue: false}, nil + } + result, err := r.Sync(ctx, resource) if err != nil { r.Log.Error(err, "unexpected Sync error") @@ -130,6 +168,18 @@ func createFieldIndexers(mgr ctrl.Manager) error { return err } + if err := mgr.GetFieldIndexer().IndexField( + context.Background(), + &v1alpha1.Database{}, + StorageRefField, + func(obj client.Object) []string { + // grab the Database object, extract the .spec.storageRef.name... + database := obj.(*v1alpha1.Database) + return []string{database.Spec.StorageClusterRef.Name} + }); err != nil { + return err + } + return mgr.GetFieldIndexer().IndexField( context.Background(), &v1alpha1.Storage{}, @@ -212,3 +262,46 @@ func (r *Reconciler) findStoragesForSecret(secret client.Object) []reconcile.Req } return requests } + +func (r *Reconciler) checkExistingDatabases( + ctx context.Context, + storage *v1alpha1.Storage, +) error { + databaseList := &v1alpha1.DatabaseList{} + err := r.Client.List( + ctx, + databaseList, + client.InNamespace(storage.Namespace), + client.MatchingFields{ + StorageRefField: storage.Name, + }, + ) + if err != nil { + r.Log.Error(err, "failed to list Databases") + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to list Databases: %s", err), + ) + return err + } + + if len(databaseList.Items) > 0 { + var databases []string + for _, database := range databaseList.Items { + databases = append(databases, database.Name) + } + errMessage := fmt.Sprintf("Waiting for existing Databases to be deleted: %v", databases) + r.Log.Info(errMessage) + r.Recorder.Event( + storage, + corev1.EventTypeNormal, + string(StorageProvisioning), + fmt.Sprintf(errMessage, databases), + ) + return errors.New(errMessage) + } + + return nil +} From d74311450d8e097fb6a2df7f6768bbc53cf6eff2 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:53:56 +0300 Subject: [PATCH 17/70] fix oauth2 jwt headers (#236) --- api/v1alpha1/connection_types.go | 14 +++---- api/v1alpha1/const.go | 5 ++- api/v1alpha1/storage_webhook.go | 40 ++++++++++++++++++++ api/v1alpha1/zz_generated.deepcopy.go | 21 +++++------ deploy/ydb-operator/Chart.yaml | 4 +- deploy/ydb-operator/crds/storage.yaml | 1 + internal/resources/resource.go | 53 ++++++++------------------- 7 files changed, 78 insertions(+), 60 deletions(-) diff --git a/api/v1alpha1/connection_types.go b/api/v1alpha1/connection_types.go index 981ac10f..3d66cb1c 100644 --- a/api/v1alpha1/connection_types.go +++ b/api/v1alpha1/connection_types.go @@ -5,9 +5,9 @@ import ( ) type ConnectionOptions struct { - AccessToken *AccessTokenAuth `json:"accessToken,omitempty"` - StaticCredentials *StaticCredentialsAuth `json:"staticCredentials,omitempty"` - Oauth2TokenExhange *Oauth2TokenExchange `json:"oauth2TokenExchange,omitempty"` + AccessToken *AccessTokenAuth `json:"accessToken,omitempty"` + StaticCredentials *StaticCredentialsAuth `json:"staticCredentials,omitempty"` + Oauth2TokenExchange *Oauth2TokenExchange `json:"oauth2TokenExchange,omitempty"` } type AccessTokenAuth struct { @@ -22,13 +22,13 @@ type StaticCredentialsAuth struct { type Oauth2TokenExchange struct { Endpoint string `json:"endpoint"` PrivateKey *CredentialSource `json:"privateKey"` - JWTHeader *JWTHeader `json:",inline"` - JWTClaims *JWTClaims `json:",inline"` + JWTHeader `json:",inline"` + JWTClaims `json:",inline"` } type JWTHeader struct { - KeyID string `json:"keyID,omitempty"` - SignAlg string `json:"signAlg,omitempty"` + KeyID *string `json:"keyID"` + SignAlg string `json:"signAlg,omitempty"` } type JWTClaims struct { Issuer string `json:"issuer,omitempty"` diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index e67b55c9..f9055fe3 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -33,8 +33,9 @@ const ( BinariesDir = "/opt/ydb/bin" DaemonBinaryName = "ydbd" - DefaultRootUsername = "root" - DefaultRootPassword = "" + DefaultRootUsername = "root" + DefaultRootPassword = "" + DefaultSignAlgorithm = "RS256" LabelDeploymentKey = "deployment" LabelDeploymentValueKubernetes = "kubernetes" diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 96ca906a..84ddba19 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -5,6 +5,7 @@ import ( "fmt" "math/rand" + "github.com/golang-jwt/jwt/v4" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" corev1 "k8s.io/api/core/v1" @@ -107,6 +108,14 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro return nil } + if storage.Spec.OperatorConnection != nil { + if storage.Spec.OperatorConnection.Oauth2TokenExchange != nil { + if storage.Spec.OperatorConnection.Oauth2TokenExchange.SignAlg == "" { + storage.Spec.OperatorConnection.Oauth2TokenExchange.SignAlg = DefaultSignAlgorithm + } + } + } + if storage.Spec.Image == nil { storage.Spec.Image = &PodImage{} } @@ -171,6 +180,17 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro var _ webhook.Validator = &Storage{} +func isSignAlgorithmSupported(alg string) bool { + supportedAlgs := jwt.GetAlgorithms() + + for _, supportedAlg := range supportedAlgs { + if alg == supportedAlg { + return true + } + } + return false +} + // ValidateCreate implements webhook.Validator so a webhook will be registered for the type func (r *Storage) ValidateCreate() error { storagelog.Info("validate create", "name", r.Name) @@ -207,6 +227,16 @@ func (r *Storage) ValidateCreate() error { return fmt.Errorf("field 'spec.operatorConnection' does not satisfy with config option `enforce_user_token_requirement: %t`", authEnabled) } + if r.Spec.OperatorConnection != nil && r.Spec.OperatorConnection.Oauth2TokenExchange != nil { + auth := r.Spec.OperatorConnection.Oauth2TokenExchange + if auth.KeyID == nil { + return fmt.Errorf("field keyID is required for OAuth2TokenExchange type") + } + if !isSignAlgorithmSupported(auth.SignAlg) { + return fmt.Errorf("signAlg %s does not supported for OAuth2TokenExchange type", auth.SignAlg) + } + } + if r.Spec.NodeSets != nil { var nodesInSetsCount int32 for _, nodeSetInline := range r.Spec.NodeSets { @@ -294,6 +324,16 @@ func (r *Storage) ValidateUpdate(old runtime.Object) error { return fmt.Errorf("field 'spec.operatorConnection' does not align with config option `enforce_user_token_requirement: %t`", authEnabled) } + if r.Spec.OperatorConnection != nil && r.Spec.OperatorConnection.Oauth2TokenExchange != nil { + auth := r.Spec.OperatorConnection.Oauth2TokenExchange + if auth.KeyID == nil { + return fmt.Errorf("field keyID is required for OAuth2TokenExchange type") + } + if !isSignAlgorithmSupported(auth.SignAlg) { + return fmt.Errorf("signAlg %s does not supported for OAuth2TokenExchange type", auth.SignAlg) + } + } + if !r.Spec.OperatorSync { oldStorage := old.(*Storage) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 1d4de76b..e0259a21 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -45,8 +45,8 @@ func (in *ConnectionOptions) DeepCopyInto(out *ConnectionOptions) { *out = new(StaticCredentialsAuth) (*in).DeepCopyInto(*out) } - if in.Oauth2TokenExhange != nil { - in, out := &in.Oauth2TokenExhange, &out.Oauth2TokenExhange + if in.Oauth2TokenExchange != nil { + in, out := &in.Oauth2TokenExchange, &out.Oauth2TokenExchange *out = new(Oauth2TokenExchange) (*in).DeepCopyInto(*out) } @@ -736,6 +736,11 @@ func (in *JWTClaims) DeepCopy() *JWTClaims { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JWTHeader) DeepCopyInto(out *JWTHeader) { *out = *in + if in.KeyID != nil { + in, out := &in.KeyID, &out.KeyID + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTHeader. @@ -797,16 +802,8 @@ func (in *Oauth2TokenExchange) DeepCopyInto(out *Oauth2TokenExchange) { *out = new(CredentialSource) (*in).DeepCopyInto(*out) } - if in.JWTHeader != nil { - in, out := &in.JWTHeader, &out.JWTHeader - *out = new(JWTHeader) - **out = **in - } - if in.JWTClaims != nil { - in, out := &in.JWTClaims, &out.JWTClaims - *out = new(JWTClaims) - **out = **in - } + in.JWTHeader.DeepCopyInto(&out.JWTHeader) + out.JWTClaims = in.JWTClaims } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Oauth2TokenExchange. diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 7600af0c..0cd686ae 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.20 +version: 0.5.21 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.20" +appVersion: "0.5.21" diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index de5a5ecc..a7dc0b0c 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -4900,6 +4900,7 @@ spec: type: string required: - endpoint + - keyID - privateKey type: object staticCredentials: diff --git a/internal/resources/resource.go b/internal/resources/resource.go index 0a6be746..e379ad15 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -407,49 +407,39 @@ func getYDBOauth2Credentials( ctx, storage.Namespace, restConfig, - auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef, + auth.Oauth2TokenExchange.PrivateKey.SecretKeyRef, ) if err != nil { return nil, fmt.Errorf( "failed to get RSA private key for Oauth2TokenExchange from secret: %s, key: %s, error: %w", - auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Name, - auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Key, + auth.Oauth2TokenExchange.PrivateKey.SecretKeyRef.Name, + auth.Oauth2TokenExchange.PrivateKey.SecretKeyRef.Key, err) } + + keyID := *auth.Oauth2TokenExchange.KeyID + signMethod := jwt.GetSigningMethod(auth.Oauth2TokenExchange.SignAlg) privateKeyPEM, err := jwt.ParseRSAPrivateKeyFromPEM([]byte(privateKey)) if err != nil { return nil, fmt.Errorf( "failed to parse RSA private key for Oauth2TokenExchange from secret: %s, key: %s, error: %w", - auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Name, - auth.Oauth2TokenExhange.PrivateKey.SecretKeyRef.Key, + auth.Oauth2TokenExchange.PrivateKey.SecretKeyRef.Name, + auth.Oauth2TokenExchange.PrivateKey.SecretKeyRef.Key, err, ) } - var signMethod jwt.SigningMethod - if auth.Oauth2TokenExhange.JWTHeader.SignAlg != "" { - if !isSignAlgorithmSupported(auth.Oauth2TokenExhange.JWTHeader.SignAlg) { - return nil, fmt.Errorf( - "sign algorithm %s does not supported", - auth.Oauth2TokenExhange.JWTHeader.SignAlg, - ) - } - signMethod = jwt.GetSigningMethod(auth.Oauth2TokenExhange.JWTHeader.SignAlg) - } else { - signMethod = jwt.SigningMethodRS256 - } - return ydbCredentials.NewOauth2TokenExchangeCredentials( - ydbCredentials.WithTokenEndpoint(auth.Oauth2TokenExhange.Endpoint), - ydbCredentials.WithAudience(auth.Oauth2TokenExhange.JWTClaims.Audience), + ydbCredentials.WithTokenEndpoint(auth.Oauth2TokenExchange.Endpoint), + ydbCredentials.WithAudience(auth.Oauth2TokenExchange.Audience), ydbCredentials.WithJWTSubjectToken( + ydbCredentials.WithKeyID(keyID), ydbCredentials.WithSigningMethod(signMethod), ydbCredentials.WithPrivateKey(privateKeyPEM), - ydbCredentials.WithKeyID(auth.Oauth2TokenExhange.JWTHeader.KeyID), - ydbCredentials.WithAudience(auth.Oauth2TokenExhange.JWTClaims.Audience), - ydbCredentials.WithIssuer(auth.Oauth2TokenExhange.JWTClaims.Issuer), - ydbCredentials.WithSubject(auth.Oauth2TokenExhange.JWTClaims.Subject), - ydbCredentials.WithID(auth.Oauth2TokenExhange.JWTClaims.ID), + ydbCredentials.WithIssuer(auth.Oauth2TokenExchange.Issuer), + ydbCredentials.WithSubject(auth.Oauth2TokenExchange.Subject), + ydbCredentials.WithID(auth.Oauth2TokenExchange.ID), + ydbCredentials.WithAudience(auth.Oauth2TokenExchange.Audience), )) } @@ -485,7 +475,7 @@ func GetYDBCredentials( return getYDBStaticCredentials(ctx, storage, restConfig) } - if auth.Oauth2TokenExhange != nil { + if auth.Oauth2TokenExchange != nil { return getYDBOauth2Credentials(ctx, storage, restConfig) } @@ -602,14 +592,3 @@ func PodIsReady(e corev1.Pod) bool { } return false } - -func isSignAlgorithmSupported(alg string) bool { - supportedAlgs := jwt.GetAlgorithms() - - for _, supportedAlg := range supportedAlgs { - if alg == supportedAlg { - return true - } - } - return false -} From b5c4253934be5c55b978c204986b0462b815c0da Mon Sep 17 00:00:00 2001 From: nikita kozlovsky Date: Tue, 16 Jul 2024 12:50:52 +0200 Subject: [PATCH 18/70] add extra volumes and extra init containers support for operator helm chart deployment (#238) * helm: add extraVolumes, extraVolumeMounts, extraInitContainers, extraEnvs * bump operator version to 0.5.22 --- deploy/ydb-operator/Chart.yaml | 4 ++-- deploy/ydb-operator/templates/deployment.yaml | 16 +++++++++++++++- deploy/ydb-operator/values.yaml | 5 +++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 0cd686ae..843e10b7 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.21 +version: 0.5.22 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.21" +appVersion: "0.5.22" diff --git a/deploy/ydb-operator/templates/deployment.yaml b/deploy/ydb-operator/templates/deployment.yaml index 4860cab5..5574e797 100644 --- a/deploy/ydb-operator/templates/deployment.yaml +++ b/deploy/ydb-operator/templates/deployment.yaml @@ -31,6 +31,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.extraInitContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - args: - --health-probe-bind-address=:8081 @@ -86,12 +90,19 @@ spec: - mountPath: /mgmt-cluster name: mgmt-cluster-kubeconfig {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} + {{- with .Values.extraEnvs }} + env: + {{ toYaml . | nindent 12 }} + {{- end }} securityContext: runAsNonRoot: true serviceAccountName: {{ include "ydb.fullname" . }} terminationGracePeriodSeconds: 10 - {{- if or .Values.webhook.enabled .Values.mgmtCluster.enabled }} + {{- if or .Values.webhook.enabled .Values.mgmtCluster.enabled .Values.extraVolumes }} volumes: {{- if .Values.webhook.enabled }} - name: webhook-tls @@ -112,6 +123,9 @@ spec: secret: secretName: {{ .Values.mgmtCluster.kubeconfig }} {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- if .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }} diff --git a/deploy/ydb-operator/values.yaml b/deploy/ydb-operator/values.yaml index e4cd7496..dd0fc717 100644 --- a/deploy/ydb-operator/values.yaml +++ b/deploy/ydb-operator/values.yaml @@ -119,3 +119,8 @@ webhook: # issuerRef: # name: "issuer" # kind: "ClusterIssuer" + +extraVolumes: [] +extraVolumeMounts: [] +extraInitContainers: [] +extraEnvs: [] From 234a076c2fffe5d7b63806967de8985fe27338df Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:01:00 +0300 Subject: [PATCH 19/70] fixes tests data (#239) --- .../storage-block-4-2-config-nodeSets.yaml | 16 ++--- .../storage-block-4-2-config-staticCreds.yaml | 16 ++--- .../data/storage-block-4-2-config-tls.yaml | 70 +++++++++---------- e2e/tests/data/storage-block-4-2-config.yaml | 16 ++--- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml b/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml index a51620d4..831fa5f5 100644 --- a/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml +++ b/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml @@ -55,35 +55,35 @@ blob_storage_config: rings: - fail_domains: - vdisk_locations: - - node_id: storage-nodeset-1-0 + - node_id: 1 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-1-1 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-1-2 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-1-3 + - node_id: 4 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-2-0 + - node_id: 5 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-2-1 + - node_id: 6 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-2-2 + - node_id: 7 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-nodeset-2-3 + - node_id: 8 pdisk_category: SSD path: SectorMap:1:1 channel_profile_config: diff --git a/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml b/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml index efa13ae2..f6cc762b 100644 --- a/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml +++ b/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml @@ -57,35 +57,35 @@ blob_storage_config: rings: - fail_domains: - vdisk_locations: - - node_id: storage-0 + - node_id: 1 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-1 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-2 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-3 + - node_id: 4 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-4 + - node_id: 5 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-5 + - node_id: 6 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-6 + - node_id: 7 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-7 + - node_id: 8 pdisk_category: SSD path: SectorMap:1:1 channel_profile_config: diff --git a/e2e/tests/data/storage-block-4-2-config-tls.yaml b/e2e/tests/data/storage-block-4-2-config-tls.yaml index bfb0498c..2fcd115e 100644 --- a/e2e/tests/data/storage-block-4-2-config-tls.yaml +++ b/e2e/tests/data/storage-block-4-2-config-tls.yaml @@ -51,41 +51,41 @@ actor_system_config: blob_storage_config: service_set: groups: - - erasure_species: block-4-2 - rings: - - fail_domains: - - vdisk_locations: - - node_id: storage-0 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-1 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-2 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-3 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-4 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-5 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-6 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: storage-7 - pdisk_category: SSD - path: SectorMap:1:1 + - erasure_species: block-4-2 + rings: + - fail_domains: + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 4 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 5 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 6 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 7 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 8 + pdisk_category: SSD + path: SectorMap:1:1 channel_profile_config: profile: - channel: diff --git a/e2e/tests/data/storage-block-4-2-config.yaml b/e2e/tests/data/storage-block-4-2-config.yaml index 8e9f81cf..831fa5f5 100644 --- a/e2e/tests/data/storage-block-4-2-config.yaml +++ b/e2e/tests/data/storage-block-4-2-config.yaml @@ -55,35 +55,35 @@ blob_storage_config: rings: - fail_domains: - vdisk_locations: - - node_id: storage-0 + - node_id: 1 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-1 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-2 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-3 + - node_id: 4 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-4 + - node_id: 5 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-5 + - node_id: 6 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-6 + - node_id: 7 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-7 + - node_id: 8 pdisk_category: SSD path: SectorMap:1:1 channel_profile_config: From 58cccb6d483dfe87efb86c9dd99c535499ba6c0f Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:58:46 +0300 Subject: [PATCH 20/70] bump client-go version to the latest 0.26.x (#234) --- go.mod | 16 ++++++++-------- go.sum | 34 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 708ba90d..788f6f54 100644 --- a/go.mod +++ b/go.mod @@ -16,10 +16,10 @@ require ( google.golang.org/grpc v1.57.1 google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 - k8s.io/client-go v0.26.1 - k8s.io/kubectl v0.26.1 + k8s.io/api v0.26.15 + k8s.io/apimachinery v0.26.15 + k8s.io/client-go v0.26.15 + k8s.io/kubectl v0.26.15 k8s.io/utils v0.0.0-20230115233650-391b47cb4029 sigs.k8s.io/controller-runtime v0.14.1 ) @@ -40,7 +40,7 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect @@ -70,14 +70,14 @@ require ( golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.1 // indirect + golang.org/x/tools v0.12.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiextensions-apiserver v0.26.1 // indirect - k8s.io/component-base v0.26.1 // indirect + k8s.io/apiextensions-apiserver v0.26.15 // indirect + k8s.io/component-base v0.26.15 // indirect k8s.io/klog/v2 v2.90.0 // indirect k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index ddea8dc7..88222cae 100644 --- a/go.sum +++ b/go.sum @@ -198,8 +198,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= @@ -438,7 +438,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -542,8 +542,8 @@ golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -626,23 +626,23 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= +k8s.io/api v0.26.15 h1:tjMERUjIwkq+2UtPZL5ZbSsLkpxUv4gXWZfV5lQl+Og= +k8s.io/api v0.26.15/go.mod h1:CtWOrFl8VLCTLolRlhbBxo4fy83tjCLEtYa5pMubIe0= k8s.io/apiextensions-apiserver v0.18.3/go.mod h1:TMsNGs7DYpMXd+8MOCX8KzPOCx8fnZMoIGB24m03+JE= -k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI= -k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM= +k8s.io/apiextensions-apiserver v0.26.15 h1:QePn6+5mihx8sXQLaOXzvF4XPv2RGGj8Pv+O4P75GPU= +k8s.io/apiextensions-apiserver v0.26.15/go.mod h1:PbhgN0XidyF+9vCTUmNgVFK0MMEYqlHLZ4AJeBfiNMo= k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/apimachinery v0.26.15 h1:GPxeERYBSqSZlj3xIkX4L6mBjzZ9q8JPnJ+Vj15qe+g= +k8s.io/apimachinery v0.26.15/go.mod h1:O/uIhIOWuy6ndHqQ6qbkjD7OgeMhVtlk8+Z66ZcmJQc= k8s.io/apiserver v0.18.3/go.mod h1:tHQRmthRPLUtwqsOnJJMoI8SW3lnoReZeE861lH8vUw= k8s.io/client-go v0.18.3/go.mod h1:4a/dpQEvzAhT1BbuWW09qvIaGw6Gbu1gZYiQZIi1DMw= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= +k8s.io/client-go v0.26.15 h1:A2Yav2v+VZQfpEsf5ESFp2Lqq5XACKBDrwkG+jEtOg0= +k8s.io/client-go v0.26.15/go.mod h1:KJs7snLEyKPlypqTQG/ngcaqE6h3/6qTvVHDViRL+iI= k8s.io/code-generator v0.18.3/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.3/go.mod h1:bp5GzGR0aGkYEfTj+eTY0AN/vXTgkJdQXjNTTVUaa3k= -k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4= -k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU= +k8s.io/component-base v0.26.15 h1:32XJyv5fo/lbDZhYU1HyISXTgdSUkbW5cO4DhfR6Y/8= +k8s.io/component-base v0.26.15/go.mod h1:9V+nBzUtTNtRuYfYmQQEhuKrjhL80i2l6F2H2qUsHAI= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -657,8 +657,8 @@ k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a h1:s6zvHjyDQX1NtVT88pvw2tddqhqY0Bz0Gbnn+yctsFU= k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= -k8s.io/kubectl v0.26.1 h1:K8A0Jjlwg8GqrxOXxAbjY5xtmXYeYjLU96cHp2WMQ7s= -k8s.io/kubectl v0.26.1/go.mod h1:miYFVzldVbdIiXMrHZYmL/EDWwJKM+F0sSsdxsATFPo= +k8s.io/kubectl v0.26.15 h1:Q118/ZVWmUYEm6Iod8MKuxQFwTBBopBogGq5tkudvhg= +k8s.io/kubectl v0.26.15/go.mod h1:JgN3H70qdFjI/93T91gVOAsSExxNmccoCQLDNX//aYw= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20230115233650-391b47cb4029 h1:L8zDtT4jrxj+TaQYD0k8KNlr556WaVQylDXswKmX+dE= k8s.io/utils v0.0.0-20230115233650-391b47cb4029/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= From 0642f3fd41785ed7078acefb93631baf60b0fc74 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:35:55 +0300 Subject: [PATCH 21/70] Cms operation (#240) * cms operation for tenant * fix database initializing conditions --- internal/cms/operation.go | 74 ++++++++++++++++++ internal/cms/tenant.go | 87 ++++++--------------- internal/controllers/constants/constants.go | 1 + internal/controllers/database/init.go | 85 ++++++++++++++------ 4 files changed, 161 insertions(+), 86 deletions(-) create mode 100644 internal/cms/operation.go diff --git a/internal/cms/operation.go b/internal/cms/operation.go new file mode 100644 index 00000000..5865a50c --- /dev/null +++ b/internal/cms/operation.go @@ -0,0 +1,74 @@ +package cms + +import ( + "context" + "fmt" + "time" + + "github.com/ydb-platform/ydb-go-genproto/Ydb_Operation_V1" + "github.com/ydb-platform/ydb-go-genproto/protos/Ydb" + "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations" + "github.com/ydb-platform/ydb-go-sdk/v3" + "sigs.k8s.io/controller-runtime/pkg/log" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/connection" +) + +const ( + GetOperationTimeoutSeconds = 10 +) + +type Operation struct { + StorageEndpoint string + Domain string + ID string +} + +func (op *Operation) GetOperation( + ctx context.Context, + opts ...ydb.Option, +) (*Ydb_Operations.GetOperationResponse, error) { + logger := log.FromContext(ctx) + + endpoint := fmt.Sprintf("%s/%s", op.StorageEndpoint, op.Domain) + ydbCtx, ydbCtxCancel := context.WithTimeout(ctx, time.Second) + defer ydbCtxCancel() + conn, err := connection.Open(ydbCtx, endpoint, ydb.MergeOptions(opts...)) + if err != nil { + return nil, fmt.Errorf("error connecting to YDB: %w", err) + } + defer func() { + connection.Close(ydbCtx, conn) + }() + + cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, GetOperationTimeoutSeconds*time.Second) + defer cmsCtxCancel() + client := Ydb_Operation_V1.NewOperationServiceClient(ydb.GRPCConn(conn)) + request := &Ydb_Operations.GetOperationRequest{Id: op.ID} + + logger.Info("CMS GetOperation", "endpoint", endpoint, "request", request) + return client.GetOperation(cmsCtx, request) +} + +func (op *Operation) CheckGetOperationResponse(ctx context.Context, response *Ydb_Operations.GetOperationResponse) (bool, string, error) { + logger := log.FromContext(ctx) + + logger.Info("CMS GetOperation", "response", response) + return CheckOperationStatus(response.GetOperation()) +} + +func CheckOperationStatus(operation *Ydb_Operations.Operation) (bool, string, error) { + if operation == nil { + return false, "", ErrEmptyReplyFromStorage + } + + if !operation.GetReady() { + return false, operation.Id, nil + } + + if operation.Status == Ydb.StatusIds_ALREADY_EXISTS || operation.Status == Ydb.StatusIds_SUCCESS { + return true, operation.Id, nil + } + + return true, operation.Id, fmt.Errorf("YDB response error: %v %v", operation.Status, operation.Issues) +} diff --git a/internal/cms/tenant.go b/internal/cms/tenant.go index 821ede9c..ad5b57d6 100644 --- a/internal/cms/tenant.go +++ b/internal/cms/tenant.go @@ -4,12 +4,10 @@ import ( "context" "errors" "fmt" + "time" "github.com/ydb-platform/ydb-go-genproto/Ydb_Cms_V1" - "github.com/ydb-platform/ydb-go-genproto/Ydb_Operation_V1" - "github.com/ydb-platform/ydb-go-genproto/protos/Ydb" "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Cms" - "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations" ydb "github.com/ydb-platform/ydb-go-sdk/v3" "sigs.k8s.io/controller-runtime/pkg/log" @@ -17,6 +15,10 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/internal/connection" ) +const ( + CreateDatabaseTimeoutSeconds = 10 +) + var ErrEmptyReplyFromStorage = errors.New("empty reply from storage") type Tenant struct { @@ -28,31 +30,36 @@ type Tenant struct { SharedDatabasePath string } -func (t *Tenant) Create( +func (t *Tenant) CreateDatabase( ctx context.Context, opts ...ydb.Option, -) (string, error) { +) (*Ydb_Cms.CreateDatabaseResponse, error) { logger := log.FromContext(ctx) - url := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) - conn, err := connection.Open(ctx, url, opts...) + + endpoint := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) + ydbCtx, ydbCtxCancel := context.WithTimeout(ctx, time.Second) + defer ydbCtxCancel() + conn, err := connection.Open(ydbCtx, endpoint, opts...) if err != nil { - logger.Error(err, "Error connecting to YDB storage") - return "", err + return nil, fmt.Errorf("error connecting to YDB: %w", err) } defer func() { - connection.Close(ctx, conn) + connection.Close(ydbCtx, conn) }() + cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, CreateDatabaseTimeoutSeconds*time.Second) + defer cmsCtxCancel() client := Ydb_Cms_V1.NewCmsServiceClient(ydb.GRPCConn(conn)) - logger.Info(fmt.Sprintf("creating tenant, url: %s", url)) request := t.makeCreateDatabaseRequest() - logger.Info(fmt.Sprintf("creating tenant, request: %s", request)) - response, err := client.CreateDatabase(ctx, request) - if err != nil { - return "", err - } - logger.Info(fmt.Sprintf("creating tenant, response: %s", response)) - return processDatabaseCreationOperation(response.Operation) + logger.Info("CMS CreateDatabase", "endpoint", endpoint, "request", request) + return client.CreateDatabase(cmsCtx, request) +} + +func (t *Tenant) CheckCreateDatabaseResponse(ctx context.Context, response *Ydb_Cms.CreateDatabaseResponse) (bool, string, error) { + logger := log.FromContext(ctx) + + logger.Info("CMS CreateDatabase", "response", response) + return CheckOperationStatus(response.GetOperation()) } func (t *Tenant) makeCreateDatabaseRequest() *Ydb_Cms.CreateDatabaseRequest { @@ -87,47 +94,3 @@ func (t *Tenant) makeCreateDatabaseRequest() *Ydb_Cms.CreateDatabaseRequest { } return request } - -func processDatabaseCreationOperation(operation *Ydb_Operations.Operation) (string, error) { - if operation == nil { - return "", ErrEmptyReplyFromStorage - } - if !operation.Ready { - return operation.Id, nil - } - if operation.Status == Ydb.StatusIds_ALREADY_EXISTS || operation.Status == Ydb.StatusIds_SUCCESS { - return "", nil - } - return "", fmt.Errorf("YDB response error: %v %v", operation.Status, operation.Issues) -} - -func (t *Tenant) CheckCreateOperation( - ctx context.Context, - operationID string, - opts ...ydb.Option, -) (bool, error, error) { - logger := log.FromContext(ctx) - url := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) - conn, err := connection.Open(ctx, url, opts...) - if err != nil { - logger.Error(err, "Error connecting to YDB storage") - return false, nil, err - } - defer func() { - connection.Close(ctx, conn) - }() - - client := Ydb_Operation_V1.NewOperationServiceClient(ydb.GRPCConn(conn)) - request := &Ydb_Operations.GetOperationRequest{Id: operationID} - logger.Info(fmt.Sprintf("checking operation, url: %s, operationId: %s, request: %s", url, operationID, request)) - response, err := client.GetOperation(ctx, request) - if err != nil { - return false, nil, err - } - logger.Info(fmt.Sprintf("checking operation, response: %s", response)) - if response.Operation == nil { - return false, nil, ErrEmptyReplyFromStorage - } - oid, err := processDatabaseCreationOperation(response.Operation) - return len(oid) == 0, err, nil -} diff --git a/internal/controllers/constants/constants.go b/internal/controllers/constants/constants.go index e7961197..93b374ea 100644 --- a/internal/controllers/constants/constants.go +++ b/internal/controllers/constants/constants.go @@ -45,6 +45,7 @@ const ( ReasonInProgress = "InProgress" ReasonNotRequired = "NotRequired" ReasonCompleted = "Completed" + ReasonFailed = "Failed" DefaultRequeueDelay = 10 * time.Second StatusUpdateRequeueDelay = 1 * time.Second diff --git a/internal/controllers/database/init.go b/internal/controllers/database/init.go index 6b878266..910f6d6c 100644 --- a/internal/controllers/database/init.go +++ b/internal/controllers/database/init.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/ydb-platform/ydb-go-sdk/v3" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -72,62 +72,86 @@ func (r *Reconciler) setInitDatabaseCompleted( return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } -func (r *Reconciler) checkCreateTenantOperation( +func (r *Reconciler) checkCreateDatabaseOperation( ctx context.Context, database *resources.DatabaseBuilder, tenant *cms.Tenant, ydbOptions ydb.Option, ) (bool, ctrl.Result, error) { condition := meta.FindStatusCondition(database.Status.Conditions, CreateDatabaseOperationCondition) - if condition == nil || len(condition.Message) == 0 { + if len(condition.Message) == 0 { // Something is wrong with the condition where we save operation id // retry create tenant + errMessage := fmt.Sprintf("Something is wrong with the condition, retry creating tenant %s", tenant.Path) + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "InitializingFailed", + errMessage, + ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionTrue, - Reason: ReasonNotRequired, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonFailed, + Message: errMessage, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } - operationID := condition.Message - finished, operationErr, err := tenant.CheckCreateOperation(ctx, operationID, ydbOptions) + + operation := &cms.Operation{ + StorageEndpoint: tenant.StorageEndpoint, + Domain: tenant.Domain, + ID: condition.Message, + } + response, err := operation.GetOperation(ctx, ydbOptions) if err != nil { r.Recorder.Event( database, corev1.EventTypeWarning, "InitializingFailed", - fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, err), + fmt.Sprintf("Failed to check creation operation, operationID %s: %s", operation.ID, err), ) return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, err } - if operationErr != nil { - // Creation operation failed - retry Create Tenant + + finished, operationID, err := operation.CheckGetOperationResponse(ctx, response) + if err != nil { + errMessage := fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, err) r.Recorder.Event( database, corev1.EventTypeWarning, "InitializingFailed", - fmt.Sprintf("Error creating tenant %s: %s", tenant.Path, operationErr), + errMessage, ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionTrue, - Reason: ReasonNotRequired, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonCompleted, + Message: errMessage, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } + if !finished { r.Recorder.Event( database, corev1.EventTypeWarning, - "Pending", + string(DatabaseInitializing), fmt.Sprintf("Tenant creation operation is not completed, operationID: %s", operationID), ) - return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, nil + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + Message: operationID, + }) + return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } + r.Recorder.Event( database, corev1.EventTypeNormal, - "Initialized", + string(DatabaseInitializing), fmt.Sprintf("Tenant %s created", tenant.Path), ) return r.setInitDatabaseCompleted(ctx, database, "Database initialized successfully") @@ -238,10 +262,11 @@ func (r *Reconciler) initializeTenant( } ydbOpts := ydb.MergeOptions(ydb.WithCredentials(creds), tlsOptions) - if meta.IsStatusConditionFalse(database.Status.Conditions, CreateDatabaseOperationCondition) { - return r.checkCreateTenantOperation(ctx, database, tenant, ydbOpts) + if meta.IsStatusConditionPresentAndEqual(database.Status.Conditions, CreateDatabaseOperationCondition, metav1.ConditionUnknown) { + return r.checkCreateDatabaseOperation(ctx, database, tenant, ydbOpts) } - operationID, err := tenant.Create(ctx, ydb.WithCredentials(creds), tlsOptions) + + response, err := tenant.CreateDatabase(ctx, ydbOpts) if err != nil { r.Recorder.Event( database, @@ -251,16 +276,28 @@ func (r *Reconciler) initializeTenant( ) return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, err } - if len(operationID) > 0 { + + finished, operationID, err := tenant.CheckCreateDatabaseResponse(ctx, response) + if err != nil { + r.Recorder.Event( + database, + corev1.EventTypeWarning, + "InitializingFailed", + fmt.Sprintf("Error checking operation for tenant %s: %s", tenant.Path, err), + ) + return Stop, ctrl.Result{RequeueAfter: DatabaseInitializationRequeueDelay}, err + } + + if !finished { r.Recorder.Event( database, corev1.EventTypeWarning, - "Pending", + string(DatabaseInitializing), fmt.Sprintf("Tenant creation operation in progress, operationID: %s", operationID), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionFalse, + Status: metav1.ConditionUnknown, Reason: ReasonInProgress, Message: operationID, }) From 6ced8c6d8002069a5de0ce5a48f469a535ba0f2b Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:10:16 +0300 Subject: [PATCH 22/70] YDBOPS-9692 move encryption config to args (#217) --- api/v1alpha1/configuration.go | 39 ---------- api/v1alpha1/const.go | 15 +++- api/v1alpha1/database_webhook.go | 13 ++-- deploy/ydb-operator/Chart.yaml | 4 +- e2e/tests/smoke_test.go | 48 ++++++++++++ .../controllers/database/controller_test.go | 74 +++++++++++++++++++ internal/controllers/database/sync.go | 7 ++ internal/resources/configmap.go | 66 ++++++++++++++++- internal/resources/database.go | 46 ++++++++++-- internal/resources/database_statefulset.go | 45 ++++++++--- internal/resources/encryption.go | 25 ++++--- internal/resources/resource.go | 18 +---- 12 files changed, 307 insertions(+), 93 deletions(-) diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index 87ddd6bb..ce24eec4 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -2,9 +2,7 @@ package v1alpha1 import ( "bytes" - "crypto/sha256" "fmt" - "path" "strconv" "gopkg.in/yaml.v3" @@ -12,19 +10,6 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/internal/configuration/schema" ) -const ( - DatabaseEncryptionKeyPath = "/opt/ydb/secrets/database_encryption" - DatabaseEncryptionKeyFile = "key" - DatastreamsIAMServiceAccountKeyPath = "/opt/ydb/secrets/datastreams" - DatastreamsIAMServiceAccountKeyFile = "sa_key.json" -) - -func hash(text string) string { - h := sha256.New() - h.Write([]byte(text)) - return fmt.Sprintf("%x", h.Sum(nil)) -} - func generateHosts(cr *Storage) []schema.Host { var hosts []schema.Host @@ -61,24 +46,6 @@ func generateHosts(cr *Storage) []schema.Host { return hosts } -func generateKeyConfig(cr *Storage, crDB *Database) *schema.KeyConfig { - var keyConfig *schema.KeyConfig - if crDB != nil && crDB.Spec.Encryption != nil && crDB.Spec.Encryption.Enabled { - keyConfig = &schema.KeyConfig{ - Keys: []schema.Key{ - { - ContainerPath: path.Join(DatabaseEncryptionKeyPath, DatabaseEncryptionKeyFile), - ID: hash(cr.Name), - Pin: crDB.Spec.Encryption.Pin, - Version: 1, - }, - }, - } - } - - return keyConfig -} - func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { config := make(map[string]interface{}) @@ -113,12 +80,6 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { config["hosts"] = hosts } - // Will be removed by YDBOPS-9692 - keyConfig := generateKeyConfig(cr, crDB) - if keyConfig != nil { - config["key_config"] = keyConfig - } - return yaml.Marshal(config) } diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index f9055fe3..c30d6f96 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -30,12 +30,21 @@ const ( ConfigDir = "/opt/ydb/cfg" ConfigFileName = "config.yaml" + DatabaseEncryptionKeySecretDir = "encryption" + DatabaseEncryptionKeySecretFile = "key.pem" + DatabaseEncryptionKeyConfigFile = "key.txt" + + DatastreamsIAMServiceAccountKeyDir = "datastreams" + DatastreamsIAMServiceAccountKeyFile = "sa_key.json" + BinariesDir = "/opt/ydb/bin" DaemonBinaryName = "ydbd" - DefaultRootUsername = "root" - DefaultRootPassword = "" - DefaultSignAlgorithm = "RS256" + DefaultRootUsername = "root" + DefaultRootPassword = "" + DefaultDatabaseDomain = "Root" + DefaultDatabaseEncryptionPin = "EmptyPin" + DefaultSignAlgorithm = "RS256" LabelDeploymentKey = "deployment" LabelDeploymentValueKubernetes = "kubernetes" diff --git a/api/v1alpha1/database_webhook.go b/api/v1alpha1/database_webhook.go index b2197b9c..bf716115 100644 --- a/api/v1alpha1/database_webhook.go +++ b/api/v1alpha1/database_webhook.go @@ -17,10 +17,6 @@ import ( . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck ) -const ( - DefaultDatabaseDomain = "Root" -) - // log is for logging in this package. var databaselog = logf.Log.WithName("database-resource") @@ -126,6 +122,13 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err database.Spec.Encryption = &EncryptionConfig{Enabled: false} } + if database.Spec.Encryption.Enabled && database.Spec.Encryption.Key == nil { + if database.Spec.Encryption.Pin == nil || len(*database.Spec.Encryption.Pin) == 0 { + encryptionPin := DefaultDatabaseEncryptionPin + database.Spec.Encryption.Pin = &encryptionPin + } + } + if database.Spec.Datastreams == nil { database.Spec.Datastreams = &DatastreamsConfig{Enabled: false} } @@ -149,7 +152,7 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err database.Spec.StorageEndpoint = storage.GetStorageEndpointWithProto() } - if database.Spec.Configuration != "" || (database.Spec.Encryption != nil && database.Spec.Encryption.Enabled) { + if database.Spec.Configuration != "" { configuration, err := BuildConfiguration(storage, database) if err != nil { return err diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 843e10b7..2f631228 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.22 +version: 0.5.23 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.22" +appVersion: "0.5.23" diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index 9aacbcba..a2dc6e20 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -866,6 +866,54 @@ var _ = Describe("Operator smoke test", func() { ) }) + It("Check encryption for Database", func() { + By("create storage...") + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) + }() + By("create database...") + databaseSample.Spec.Encryption = &v1alpha1.EncryptionConfig{ + Enabled: true, + } + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) + }() + + By("waiting until Storage is ready...") + waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + + By("checking that all the storage pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + + By("waiting until database is ready...") + waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + + By("checking that all the database pods are running and ready...") + checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + + database := v1alpha1.Database{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &database)).Should(Succeed()) + storageEndpoint := database.Spec.StorageEndpoint + + databasePods := corev1.PodList{} + Expect(k8sClient.List(ctx, &databasePods, + client.InNamespace(testobjects.YdbNamespace), + client.MatchingLabels{"ydb-cluster": "kind-database"}), + ).Should(Succeed()) + podName := databasePods.Items[0].Name + + By("bring YDB CLI inside ydb database pod...") + bringYdbCliToPod(podName, testobjects.YdbNamespace) + + By("execute simple query inside ydb database pod...") + executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + }) + AfterEach(func() { Expect(uninstallOperatorWithHelm(testobjects.YdbNamespace)).Should(BeTrue()) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index f37b4f26..ff70c105 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -3,7 +3,9 @@ package database_test import ( "context" "errors" + "fmt" "path/filepath" + "reflect" "strings" "testing" @@ -142,5 +144,77 @@ var _ = Describe("Database controller medium tests", func() { } } }) + + By("Check encryption for Database...") + foundDatabase := v1alpha1.Database{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundDatabase)) + + By("Update Database and enable encryption...") + foundDatabase.Spec.Encryption = &v1alpha1.EncryptionConfig{Enabled: true} + Expect(k8sClient.Update(ctx, &foundDatabase)).Should(Succeed()) + + By("Check that encryption secret was created...") + encryptionSecret := corev1.Secret{} + Eventually(func() error { + return k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &encryptionSecret) + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + encryptionData := encryptionSecret.Data + + By("Check that arg `--key-file` was added to StatefulSet...") + databaseStatefulSet = appsv1.StatefulSet{} + Eventually(func() error { + Expect(k8sClient.List(ctx, + &foundStatefulSets, + client.InNamespace(testobjects.YdbNamespace), + )).ShouldNot(HaveOccurred()) + for idx, statefulSet := range foundStatefulSets.Items { + if statefulSet.Name == testobjects.DatabaseName { + databaseStatefulSet = foundStatefulSets.Items[idx] + break + } + } + podContainerArgs := databaseStatefulSet.Spec.Template.Spec.Containers[0].Args + encryptionKeyConfigPath := fmt.Sprintf("%s/%s", v1alpha1.ConfigDir, v1alpha1.DatabaseEncryptionKeyConfigFile) + for idx, arg := range podContainerArgs { + if arg == "--key-file" { + if podContainerArgs[idx+1] == encryptionKeyConfigPath { + return nil + } + return fmt.Errorf( + "Found arg `--key-file=%s` for encryption does not match with expected path: %s", + podContainerArgs[idx+1], + encryptionKeyConfigPath, + ) + } + } + return errors.New("Failed to find arg `--key-file` for encryption in StatefulSet") + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("Update Database encryption pin...") + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundDatabase)) + pin := "Ignore" + foundDatabase.Spec.Encryption = &v1alpha1.EncryptionConfig{ + Enabled: true, + Pin: &pin, + } + Expect(k8sClient.Update(ctx, &foundDatabase)).Should(Succeed()) + + By("Check that Secret for encryption was not changed...") + Consistently(func(g Gomega) bool { + g.Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &encryptionSecret)) + return reflect.DeepEqual(encryptionData, encryptionSecret.Data) + }, test.Timeout, test.Interval).Should(BeTrue()) }) }) diff --git a/internal/controllers/database/sync.go b/internal/controllers/database/sync.go index 466f8f67..6255d521 100644 --- a/internal/controllers/database/sync.go +++ b/internal/controllers/database/sync.go @@ -364,6 +364,13 @@ func shouldIgnoreDatabaseChange(database *resources.DatabaseBuilder) resources.I return true } } + + if sec, ok := oldObj.(*corev1.Secret); ok { + // Do not update already existing secret data for encryption + if (len(sec.StringData) > 0) || (len(sec.Data) > 0) { + return true + } + } return false } } diff --git a/internal/resources/configmap.go b/internal/resources/configmap.go index 39063112..861c4512 100644 --- a/internal/resources/configmap.go +++ b/internal/resources/configmap.go @@ -1,19 +1,42 @@ package resources import ( + "bytes" "errors" + "fmt" + "html/template" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + + api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/configuration/schema" ) +const keyConfigTmpl = `Keys { + ContainerPath: "{{ .ContainerPath }}" + Pin: "{{ .Pin }}" + Id: "{{ .ID }}" + Version: {{ .Version }} +}` + type ConfigMapBuilder struct { client.Object Name string - Data map[string]string Labels map[string]string + + Data map[string]string +} + +type EncryptionConfigBuilder struct { + client.Object + + Name string + Labels map[string]string + + KeyConfig schema.KeyConfig } func (b *ConfigMapBuilder) Build(obj client.Object) error { @@ -23,13 +46,43 @@ func (b *ConfigMapBuilder) Build(obj client.Object) error { } if cm.ObjectMeta.Name == "" { - cm.ObjectMeta.Name = b.GetName() + cm.ObjectMeta.Name = b.Name } cm.ObjectMeta.Namespace = b.GetNamespace() + cm.Labels = b.Labels + cm.Data = b.Data + + return nil +} + +func (b *EncryptionConfigBuilder) Build(obj client.Object) error { + cm, ok := obj.(*v1.ConfigMap) + if !ok { + return errors.New("failed to cast to ConfigMap object") + } + + if cm.ObjectMeta.Name == "" { + cm.ObjectMeta.Name = b.Name + } + cm.ObjectMeta.Namespace = b.GetNamespace() + cm.Labels = b.Labels + t, err := template.New("keyConfig").Parse(keyConfigTmpl) + if err != nil { + return fmt.Errorf("failed to parse keyConfig template: %w", err) + } + + var buf bytes.Buffer + err = t.Execute(&buf, b.KeyConfig.Keys[0]) + if err != nil { + return fmt.Errorf("failed to execute keyConfig template: %w", err) + } + + cm.Data = map[string]string{api.DatabaseEncryptionKeyConfigFile: buf.String()} + return nil } @@ -41,3 +94,12 @@ func (b *ConfigMapBuilder) Placeholder(cr client.Object) client.Object { }, } } + +func (b *EncryptionConfigBuilder) Placeholder(cr client.Object) client.Object { + return &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: b.Name, + Namespace: cr.GetNamespace(), + }, + } +} diff --git a/internal/resources/database.go b/internal/resources/database.go index 4276b3d0..c439c0cf 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -1,11 +1,14 @@ package resources import ( + "fmt" + corev1 "k8s.io/api/core/v1" "k8s.io/client-go/rest" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/configuration/schema" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/metrics" ) @@ -93,20 +96,49 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc ) } - if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled && b.Spec.Encryption.Key == nil { - var pin string + if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { + // backward compatibility if b.Spec.Encryption.Pin == nil || len(*b.Spec.Encryption.Pin) == 0 { - pin = defaultPin - } else { - pin = *b.Spec.Encryption.Pin + encryptionPin := api.DefaultDatabaseEncryptionPin + b.Spec.Encryption.Pin = &encryptionPin + } + + if b.Spec.Encryption.Key == nil { + optionalBuilders = append( + optionalBuilders, + &EncryptionSecretBuilder{ + Object: b, + + Labels: databaseLabels, + Pin: *b.Spec.Encryption.Pin, + }, + ) } + + keyConfig := schema.KeyConfig{ + Keys: []schema.Key{ + { + ContainerPath: fmt.Sprintf("%s/%s/%s", + wellKnownDirForAdditionalSecrets, + api.DatabaseEncryptionKeySecretDir, + api.DatabaseEncryptionKeySecretFile, + ), + ID: b.Name, + Pin: b.Spec.Encryption.Pin, + Version: 1, + }, + }, + } + optionalBuilders = append( optionalBuilders, - &EncryptionSecretBuilder{ + &EncryptionConfigBuilder{ Object: b, - Pin: pin, + Name: fmt.Sprintf(EncryptionKeyConfigNameFormat, b.GetName()), Labels: databaseLabels, + + KeyConfig: keyConfig, }, ) } diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 687ed8e4..2d755b82 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -179,7 +179,7 @@ func (b *DatabaseStatefulSetBuilder) buildVolumes() []corev1.Volume { } if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { - volumes = append(volumes, b.buildEncryptionVolume()) + volumes = append(volumes, b.buildEncryptionVolumes()...) } if b.Spec.Datastreams != nil && b.Spec.Datastreams.Enabled { @@ -346,30 +346,43 @@ func buildTLSVolume(name string, configuration *api.TLSConfiguration) corev1.Vol return volume } -func (b *DatabaseStatefulSetBuilder) buildEncryptionVolume() corev1.Volume { +func (b *DatabaseStatefulSetBuilder) buildEncryptionVolumes() []corev1.Volume { var secretName, secretKey string if b.Spec.Encryption.Key != nil { secretName = b.Spec.Encryption.Key.Name secretKey = b.Spec.Encryption.Key.Key } else { secretName = b.Name - secretKey = defaultEncryptionSecretKey + secretKey = wellKnownNameForEncryptionKeySecret } - return corev1.Volume{ - Name: encryptionVolumeName, + encryptionKeySecret := corev1.Volume{ + Name: encryptionKeySecretVolumeName, VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: secretName, Items: []corev1.KeyToPath{ { Key: secretKey, - Path: api.DatabaseEncryptionKeyFile, + Path: api.DatabaseEncryptionKeySecretFile, }, }, }, }, } + + encryptionKeyConfig := corev1.Volume{ + Name: encryptionKeyConfigVolumeName, + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: fmt.Sprintf(EncryptionKeyConfigNameFormat, b.GetName()), + }, + }, + }, + } + + return []corev1.Volume{encryptionKeySecret, encryptionKeyConfig} } func (b *DatabaseStatefulSetBuilder) buildDatastreamsIAMServiceAccountKeyVolume() corev1.Volume { @@ -482,9 +495,16 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: encryptionVolumeName, + Name: encryptionKeyConfigVolumeName, ReadOnly: true, - MountPath: api.DatabaseEncryptionKeyPath, + MountPath: fmt.Sprintf("%s/%s", api.ConfigDir, api.DatabaseEncryptionKeyConfigFile), + SubPath: api.DatabaseEncryptionKeyConfigFile, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: encryptionKeySecretVolumeName, + ReadOnly: true, + MountPath: fmt.Sprintf("%s/%s", wellKnownDirForAdditionalSecrets, api.DatabaseEncryptionKeySecretDir), }) } @@ -492,7 +512,7 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: datastreamsIAMServiceAccountKeyVolumeName, ReadOnly: true, - MountPath: api.DatastreamsIAMServiceAccountKeyPath, + MountPath: api.DatastreamsIAMServiceAccountKeyDir, }) if b.Spec.Service.Datastreams.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ @@ -569,6 +589,13 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { ) } + if b.Spec.Encryption != nil && b.Spec.Encryption.Enabled { + args = append(args, + "--key-file", + fmt.Sprintf("%s/%s", api.ConfigDir, api.DatabaseEncryptionKeyConfigFile), + ) + } + // hotfix KIKIMR-16728 if b.Spec.Service.GRPC.TLSConfiguration.Enabled { args = append(args, diff --git a/internal/resources/encryption.go b/internal/resources/encryption.go index 276370a8..a3187007 100644 --- a/internal/resources/encryption.go +++ b/internal/resources/encryption.go @@ -2,6 +2,7 @@ package resources import ( "errors" + "fmt" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -13,8 +14,8 @@ import ( type EncryptionSecretBuilder struct { client.Object - Pin string Labels map[string]string + Pin string } func (b *EncryptionSecretBuilder) Build(obj client.Object) error { @@ -28,17 +29,17 @@ func (b *EncryptionSecretBuilder) Build(obj client.Object) error { } sec.ObjectMeta.Namespace = b.GetNamespace() - // Do not update already existing secret data - if (sec.StringData == nil || len(sec.StringData) == 0) && (sec.Data == nil || len(sec.Data) == 0) { - key, err := encryption.GenerateRSAKey(b.Pin) - if err != nil { - return err - } - sec.StringData = map[string]string{ - defaultEncryptionSecretKey: key, - } - } sec.Labels = b.Labels + + key, err := encryption.GenerateRSAKey(b.Pin) + if err != nil { + return fmt.Errorf("failed to generate key for encryption: %w", err) + } + + sec.StringData = map[string]string{ + wellKnownNameForEncryptionKeySecret: key, + } + sec.Type = corev1.SecretTypeOpaque return nil @@ -47,7 +48,7 @@ func (b *EncryptionSecretBuilder) Build(obj client.Object) error { func (b *EncryptionSecretBuilder) Placeholder(cr client.Object) client.Object { return &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Name: cr.GetName(), + Name: b.GetName(), Namespace: cr.GetNamespace(), }, } diff --git a/internal/resources/resource.go b/internal/resources/resource.go index e379ad15..e904327f 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -49,6 +49,7 @@ const ( InitJobNameFormat = "%s-blobstorage-init" OperatorTokenSecretNameFormat = "%s-operator-token" + EncryptionKeyConfigNameFormat = "%s-encryption-key" systemCertsVolumeName = "init-main-shared-certs-volume" localCertsVolumeName = "init-main-shared-source-dir-volume" @@ -60,6 +61,7 @@ const ( wellKnownNameForTLSCertificateAuthority = "ca.crt" wellKnownNameForTLSCertificate = "tls.crt" wellKnownNameForTLSPrivateKey = "tls.key" + wellKnownNameForEncryptionKeySecret = "key.pem" caBundleEnvName = "CA_BUNDLE" caBundleFileName = "userCABundle.crt" @@ -70,10 +72,9 @@ const ( localCertsDir = "/usr/local/share/ca-certificates" systemCertsDir = "/etc/ssl/certs" - encryptionVolumeName = "encryption" + encryptionKeyConfigVolumeName = "encryption-config" + encryptionKeySecretVolumeName = "encryption-key" datastreamsIAMServiceAccountKeyVolumeName = "datastreams-iam-sa-key" - defaultEncryptionSecretKey = "key" - defaultPin = "EmptyPin" ) type ResourceBuilder interface { @@ -581,14 +582,3 @@ func CompareMaps(map1, map2 map[string]string) bool { } return true } - -func PodIsReady(e corev1.Pod) bool { - if e.Status.Phase == corev1.PodRunning { - for _, condition := range e.Status.Conditions { - if condition.Type == corev1.PodReady && condition.Status == corev1.ConditionTrue { - return true - } - } - } - return false -} From e6000255a5cdcfcf75cca04c170e76d5b116d6a5 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:04:51 +0300 Subject: [PATCH 23/70] revert backward compatibility for encryption key secret (#243) * Update resource.go * Update Chart.yaml --- deploy/ydb-operator/Chart.yaml | 4 ++-- internal/resources/resource.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 2f631228..93f27ec1 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.23 +version: 0.5.24 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.23" +appVersion: "0.5.24" diff --git a/internal/resources/resource.go b/internal/resources/resource.go index e904327f..6c40c4d4 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -61,7 +61,7 @@ const ( wellKnownNameForTLSCertificateAuthority = "ca.crt" wellKnownNameForTLSCertificate = "tls.crt" wellKnownNameForTLSPrivateKey = "tls.key" - wellKnownNameForEncryptionKeySecret = "key.pem" + wellKnownNameForEncryptionKeySecret = "key" caBundleEnvName = "CA_BUNDLE" caBundleFileName = "userCABundle.crt" From e0387f4a278f37af9a6a0c487125e5774301bf41 Mon Sep 17 00:00:00 2001 From: Maxim Gorbunov Date: Thu, 22 Aug 2024 09:30:12 +0200 Subject: [PATCH 24/70] Remove datastreams iam sa key (#242) --- api/v1alpha1/const.go | 3 --- api/v1alpha1/database_types.go | 3 --- api/v1alpha1/zz_generated.deepcopy.go | 7 +------ internal/resources/database_statefulset.go | 23 ---------------------- internal/resources/resource.go | 5 ++--- 5 files changed, 3 insertions(+), 38 deletions(-) diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index c30d6f96..c66d193a 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -34,9 +34,6 @@ const ( DatabaseEncryptionKeySecretFile = "key.pem" DatabaseEncryptionKeyConfigFile = "key.txt" - DatastreamsIAMServiceAccountKeyDir = "datastreams" - DatastreamsIAMServiceAccountKeyFile = "sa_key.json" - BinariesDir = "/opt/ydb/bin" DaemonBinaryName = "ydbd" diff --git a/api/v1alpha1/database_types.go b/api/v1alpha1/database_types.go index 9bbe19b9..cf89f0f9 100644 --- a/api/v1alpha1/database_types.go +++ b/api/v1alpha1/database_types.go @@ -249,9 +249,6 @@ type EncryptionConfig struct { type DatastreamsConfig struct { // +required Enabled bool `json:"enabled"` - - // +required - IAMServiceAccountKey *corev1.SecretKeySelector `json:"iam_service_account_key,omitempty"` } type DatabaseServices struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index e0259a21..61a3689f 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -143,7 +143,7 @@ func (in *DatabaseClusterSpec) DeepCopyInto(out *DatabaseClusterSpec) { if in.Datastreams != nil { in, out := &in.Datastreams, &out.Datastreams *out = new(DatastreamsConfig) - (*in).DeepCopyInto(*out) + **out = **in } if in.Monitoring != nil { in, out := &in.Monitoring, &out.Monitoring @@ -613,11 +613,6 @@ func (in *DatabaseStatus) DeepCopy() *DatabaseStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatastreamsConfig) DeepCopyInto(out *DatastreamsConfig) { *out = *in - if in.IAMServiceAccountKey != nil { - in, out := &in.IAMServiceAccountKey, &out.IAMServiceAccountKey - *out = new(v1.SecretKeySelector) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatastreamsConfig. diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 2d755b82..6c4e3fe4 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -183,7 +183,6 @@ func (b *DatabaseStatefulSetBuilder) buildVolumes() []corev1.Volume { } if b.Spec.Datastreams != nil && b.Spec.Datastreams.Enabled { - volumes = append(volumes, b.buildDatastreamsIAMServiceAccountKeyVolume()) if b.Spec.Service.Datastreams.TLSConfiguration.Enabled { volumes = append(volumes, buildTLSVolume(datastreamsTLSVolumeName, b.Spec.Service.Datastreams.TLSConfiguration)) } @@ -385,23 +384,6 @@ func (b *DatabaseStatefulSetBuilder) buildEncryptionVolumes() []corev1.Volume { return []corev1.Volume{encryptionKeySecret, encryptionKeyConfig} } -func (b *DatabaseStatefulSetBuilder) buildDatastreamsIAMServiceAccountKeyVolume() corev1.Volume { - return corev1.Volume{ - Name: datastreamsIAMServiceAccountKeyVolumeName, - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: b.Spec.Datastreams.IAMServiceAccountKey.Name, - Items: []corev1.KeyToPath{ - { - Key: b.Spec.Datastreams.IAMServiceAccountKey.Key, - Path: api.DatastreamsIAMServiceAccountKeyFile, - }, - }, - }, - }, - } -} - func (b *DatabaseStatefulSetBuilder) buildContainer() corev1.Container { command, args := b.buildContainerArgs() imagePullPolicy := corev1.PullIfNotPresent @@ -509,11 +491,6 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { } if b.Spec.Datastreams != nil && b.Spec.Datastreams.Enabled { - volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: datastreamsIAMServiceAccountKeyVolumeName, - ReadOnly: true, - MountPath: api.DatastreamsIAMServiceAccountKeyDir, - }) if b.Spec.Service.Datastreams.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: datastreamsTLSVolumeName, diff --git a/internal/resources/resource.go b/internal/resources/resource.go index 6c40c4d4..c16ecc60 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -72,9 +72,8 @@ const ( localCertsDir = "/usr/local/share/ca-certificates" systemCertsDir = "/etc/ssl/certs" - encryptionKeyConfigVolumeName = "encryption-config" - encryptionKeySecretVolumeName = "encryption-key" - datastreamsIAMServiceAccountKeyVolumeName = "datastreams-iam-sa-key" + encryptionKeyConfigVolumeName = "encryption-config" + encryptionKeySecretVolumeName = "encryption-key" ) type ResourceBuilder interface { From 52154b3cdd02359ef6d384cc6828024c503462dd Mon Sep 17 00:00:00 2001 From: AlexSm Date: Tue, 27 Aug 2024 16:42:08 +0300 Subject: [PATCH 25/70] Update CONTRIBUTING.md (#245) --- CONTRIBUTING.md | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a89a89ec..891a3437 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,37 +1,21 @@ # Notice to external contributors -## How do I start? +## Common -We try to maintain a small but helpful selection of information on how ydb-k8s-operator is developed and released, -as well as some details of its architecture. Please, have a look at the [docs folder](./docs/), its README functions -as a table of content. +YDB is a free and open project and we appreciate to receive contributions from our community. -## A note on legal terms +## Contributing code changes -Hello! In order for us to accept patches and other contributions from you, you will have to adopt our Yandex Contributor License Agreement (the “**CLA**”). The current version of the CLA you may find here https://yandex.ru/legal/cla/?lang=en +If you would like to contribute a new feature or a bug fix, please discuss your idea first on the GitHub issue. +If there is no issue for your idea, please open one. It may be that somebody is already working on it, +or that there are some complex obstacles that you should know about before starting the implementation. +Usually there are several ways to fix a problem and it is important to find the right approach before spending time on a PR +that cannot be merged. -By adopting the CLA, you state the following: +## Provide a contribution -* You obviously wish and are willingly licensing your contributions to us for our open source projects under the terms of the CLA, -* You has read the terms and conditions of the CLA and agree with them in full, -* You are legally able to provide and license your contributions as stated, -* We may use your contributions for our open source projects and for any other our project too, -* We rely on your assurances concerning the rights of third parties in relation to your contributions. - -If you agree with these principles, please read and adopt our CLA. By providing us your contributions, you hereby declare that you has already read and adopt our CLA, and we may freely merge your contributions with our corresponding open source project and use it in further in accordance with terms and conditions of the CLA. - -## How to agree to CLA - -If you are willing to adopt terms and conditions of the CLA, you are able to provide your contributions. When you submit your pull request, please add the following information into it: - -``` -I hereby agree to the terms of the CLA available at: [link]. -``` - -Replace the bracketed text as follows: -* [link] is the link to the current version of the CLA: https://yandex.ru/legal/cla/?lang=en. - -It is enough to provide us such notification once. +To make a contribution you should submit a pull request. There will probably be discussion about the pull request and, +if any changes are needed, we would love to work with you to get your pull request merged. ## Other questions From ada0a421000f5e867e4ee161490eab0363bbb116 Mon Sep 17 00:00:00 2001 From: kobzonega <122476665+kobzonega@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:19:56 +0800 Subject: [PATCH 26/70] fix encryption config ID backward compatibility (#244) * fix encryption config ID backward compatibility * revert database encryption key secret path --- api/v1alpha1/const.go | 4 ++-- deploy/ydb-operator/Chart.yaml | 4 ++-- internal/controllers/storage/controller_test.go | 2 +- internal/resources/database.go | 4 ++-- internal/resources/databasenodeset.go | 2 +- internal/resources/resource.go | 4 ++-- internal/resources/storage.go | 2 +- internal/resources/storage_init_job.go | 2 +- internal/resources/storagenodeset.go | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index c66d193a..293647e7 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -30,8 +30,8 @@ const ( ConfigDir = "/opt/ydb/cfg" ConfigFileName = "config.yaml" - DatabaseEncryptionKeySecretDir = "encryption" - DatabaseEncryptionKeySecretFile = "key.pem" + DatabaseEncryptionKeySecretDir = "database_encryption" + DatabaseEncryptionKeySecretFile = "key" DatabaseEncryptionKeyConfigFile = "key.txt" BinariesDir = "/opt/ydb/bin" diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 93f27ec1..03fa4f92 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.24 +version: 0.5.25 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.24" +appVersion: "0.5.25" diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index 92e74ff3..fb364be3 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -123,7 +123,7 @@ var _ = Describe("Storage controller medium tests", func() { }, &foundStorage)).Should(Succeed()) foundConfigurationChecksumAnnotation := false - if podAnnotations[annotations.ConfigurationChecksum] == resources.GetConfigurationChecksum(foundStorage.Spec.Configuration) { + if podAnnotations[annotations.ConfigurationChecksum] == resources.SHAChecksum(foundStorage.Spec.Configuration) { foundConfigurationChecksumAnnotation = true } Expect(foundConfigurationChecksumAnnotation).To(BeTrue()) diff --git a/internal/resources/database.go b/internal/resources/database.go index c439c0cf..2328207c 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -43,7 +43,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) grpcServiceLabels := databaseLabels.Copy() grpcServiceLabels.Merge(b.Spec.Service.GRPC.AdditionalLabels) @@ -123,7 +123,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc api.DatabaseEncryptionKeySecretDir, api.DatabaseEncryptionKeySecretFile, ), - ID: b.Name, + ID: SHAChecksum(b.Spec.StorageClusterRef.Name), Pin: b.Spec.Encryption.Pin, Version: 1, }, diff --git a/internal/resources/databasenodeset.go b/internal/resources/databasenodeset.go index 5050fbc2..b3e1d041 100644 --- a/internal/resources/databasenodeset.go +++ b/internal/resources/databasenodeset.go @@ -69,7 +69,7 @@ func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [ } statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) var resourceBuilders []ResourceBuilder resourceBuilders = append(resourceBuilders, diff --git a/internal/resources/resource.go b/internal/resources/resource.go index c16ecc60..c48965cf 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -564,9 +564,9 @@ func buildCAStorePatchingCommandArgs( return command, args } -func GetConfigurationChecksum(configuration string) string { +func SHAChecksum(text string) string { hasher := sha256.New() - hasher.Write([]byte(configuration)) + hasher.Write([]byte(text)) return hex.EncodeToString(hasher.Sum(nil)) } diff --git a/internal/resources/storage.go b/internal/resources/storage.go index 38169a60..83f83661 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -36,7 +36,7 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) grpcServiceLabels := storageLabels.Copy() grpcServiceLabels.Merge(b.Spec.Service.GRPC.AdditionalLabels) diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index 0507623e..f5399c20 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -70,7 +70,7 @@ func GetInitJobBuilder(storage *api.Storage) ResourceBuilder { } if storage.Spec.InitJob.AdditionalAnnotations != nil { jobAnnotations = CopyDict(storage.Spec.InitJob.AdditionalAnnotations) - jobAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(storage.Spec.Configuration) + jobAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(storage.Spec.Configuration) } } diff --git a/internal/resources/storagenodeset.go b/internal/resources/storagenodeset.go index efbc446c..7f69425f 100644 --- a/internal/resources/storagenodeset.go +++ b/internal/resources/storagenodeset.go @@ -69,7 +69,7 @@ func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) [] } statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) - statefulSetAnnotations[annotations.ConfigurationChecksum] = GetConfigurationChecksum(b.Spec.Configuration) + statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) var resourceBuilders []ResourceBuilder resourceBuilders = append( From b98fd732d5e4276f3b976067eee445d40bdf6d56 Mon Sep 17 00:00:00 2001 From: AlexSm Date: Thu, 5 Sep 2024 16:45:57 +0200 Subject: [PATCH 27/70] Update PULL_REQUEST_TEMPLATE.md (#246) --- .github/PULL_REQUEST_TEMPLATE.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 784c093c..7a8c08e7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,3 @@ -I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en - ## Pull request type From 56e6f09aac07ee67819ac68654d469e63f7dd217 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 24 Sep 2024 13:50:35 +0200 Subject: [PATCH 28/70] Enable 3 node deployment for testing purposes (#248) --- api/v1alpha1/storage_webhook.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 84ddba19..258b5494 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -208,10 +208,11 @@ func (r *Storage) ValidateCreate() error { } minNodesPerErasure := map[ErasureType]int32{ - ErasureMirror3DC: 9, + ErasureMirror3DC: 3, ErasureBlock42: 8, None: 1, } + if nodesNumber < minNodesPerErasure[r.Spec.Erasure] { return fmt.Errorf("erasure type %v requires at least %v storage nodes", r.Spec.Erasure, minNodesPerErasure[r.Spec.Erasure]) } @@ -305,10 +306,11 @@ func (r *Storage) ValidateUpdate(old runtime.Object) error { } minNodesPerErasure := map[ErasureType]int32{ - ErasureMirror3DC: 9, + ErasureMirror3DC: 3, ErasureBlock42: 8, None: 1, } + if nodesNumber < minNodesPerErasure[r.Spec.Erasure] { return fmt.Errorf("erasure type %v requires at least %v storage nodes", r.Spec.Erasure, minNodesPerErasure[r.Spec.Erasure]) } From d8d4809d47538b037abebccfe3beb5147742a93f Mon Sep 17 00:00:00 2001 From: kobzonega Date: Thu, 26 Sep 2024 19:20:32 +0700 Subject: [PATCH 29/70] YDBOPS-9679 dynconfig CMS ReplaceConfig (#214) --- .gitignore | 21 +- Makefile | 6 +- api/v1alpha1/configuration.go | 84 +++-- api/v1alpha1/storage_webhook.go | 37 +- deploy/ydb-operator/Chart.yaml | 4 +- .../data/storage-block-4-2-dynconfig.yaml | 111 ++++++ e2e/tests/smoke_test.go | 56 +++ internal/cms/dynconfig.go | 113 ++++++ internal/cms/operation.go | 10 +- internal/cms/tenant.go | 10 +- .../configuration/schema/configuration.go | 2 +- internal/configuration/schema/schema_test.go | 117 ++++++- internal/controllers/constants/constants.go | 16 +- internal/controllers/storage/config.go | 327 ++++++++++++++++++ internal/controllers/storage/sync.go | 15 + internal/resources/storage.go | 4 +- 16 files changed, 858 insertions(+), 75 deletions(-) create mode 100644 e2e/tests/data/storage-block-4-2-dynconfig.yaml create mode 100644 internal/cms/dynconfig.go create mode 100644 internal/controllers/storage/config.go diff --git a/.gitignore b/.gitignore index ae53d4ce..e3f63895 100644 --- a/.gitignore +++ b/.gitignore @@ -5,34 +5,15 @@ *.dylib *.test *.out -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf -.idea/**/contentModel.xml -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml -.idea/**/gradle.xml -.idea/**/libraries -cmake-build-*/ -.idea/**/mongoSettings.xml *.iws out/ +.idea/* .idea_modules/ atlassian-ide-plugin.xml -.idea/replstate.xml com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties -.idea/httpRequests -.idea/caches/build_file_checksums.ser bin/ config/ diff --git a/Makefile b/Makefile index 9962da2f..82c10a1e 100644 --- a/Makefile +++ b/Makefile @@ -77,13 +77,15 @@ kind-load: docker tag cr.yandex/yc/ydb-operator:latest kind/ydb-operator:current kind load docker-image kind/ydb-operator:current --name kind-ydb-operator +opts ?= '' + .PHONY: unit-test unit-test: manifests generate fmt vet envtest ## Run unit tests - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 900s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 900s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out $(opts) .PHONY: e2e-test e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests - go test -v -timeout 3600s -p 1 ./e2e/... -ginkgo.v + go test -v -timeout 3600s -p 1 ./e2e/... -ginkgo.v $(opts) .PHONY: test test: unit-test e2e-test ## Run all tests diff --git a/api/v1alpha1/configuration.go b/api/v1alpha1/configuration.go index ce24eec4..cd21274f 100644 --- a/api/v1alpha1/configuration.go +++ b/api/v1alpha1/configuration.go @@ -2,6 +2,7 @@ package v1alpha1 import ( "bytes" + "errors" "fmt" "strconv" @@ -60,19 +61,22 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { rawYamlConfiguration = cr.Spec.Configuration } - dynconfig, err := ParseDynconfig(rawYamlConfiguration) - if err == nil { - if dynconfig.Config["hosts"] == nil { + success, dynConfig, err := ParseDynConfig(rawYamlConfiguration) + if success { + if err != nil { + return nil, fmt.Errorf("failed to parse dynconfig, error: %w", err) + } + if dynConfig.Config["hosts"] == nil { hosts := generateHosts(cr) - dynconfig.Config["hosts"] = hosts + dynConfig.Config["hosts"] = hosts } - return yaml.Marshal(dynconfig) + return yaml.Marshal(dynConfig) } err = yaml.Unmarshal([]byte(rawYamlConfiguration), &config) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to serialize YAML config, error: %w", err) } if config["hosts"] == nil { @@ -84,28 +88,62 @@ func BuildConfiguration(cr *Storage, crDB *Database) ([]byte, error) { } func ParseConfiguration(rawYamlConfiguration string) (schema.Configuration, error) { - configuration := schema.Configuration{} - - dynconfig, err := ParseDynconfig(rawYamlConfiguration) - if err == nil { - config, err := yaml.Marshal(dynconfig.Config) - if err != nil { - return configuration, err - } - rawYamlConfiguration = string(config) - } - dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) dec.KnownFields(false) - err = dec.Decode(&configuration) - return configuration, err + var configuration schema.Configuration + err := dec.Decode(&configuration) + if err != nil { + return schema.Configuration{}, nil + } + + return configuration, nil } -func ParseDynconfig(rawYamlConfiguration string) (schema.Dynconfig, error) { - dynconfig := schema.Dynconfig{} +func ParseDynConfig(rawYamlConfiguration string) (bool, schema.DynConfig, error) { dec := yaml.NewDecoder(bytes.NewReader([]byte(rawYamlConfiguration))) dec.KnownFields(true) - err := dec.Decode(&dynconfig) - return dynconfig, err + + var dynConfig schema.DynConfig + err := dec.Decode(&dynConfig) + if err != nil { + return false, schema.DynConfig{}, fmt.Errorf("error unmarshal yaml to dynconfig: %w", err) + } + + err = validateDynConfig(dynConfig) + if err != nil { + return true, dynConfig, fmt.Errorf("error validate dynconfig: %w", err) + } + + return true, dynConfig, err +} + +func validateDynConfig(dynConfig schema.DynConfig) error { + if _, exist := dynConfig.Config["yaml_config_enabled"]; !exist { + return errors.New("failed to find mandatory `yaml_config_enabled` field inside config") + } + + if _, exist := dynConfig.Config["static_erasure"]; !exist { + return errors.New("failed to find mandatory `static_erasure` field inside config") + } + + if _, exist := dynConfig.Config["host_configs"]; !exist { + return errors.New("failed to find mandatory `host_configs` field inside config") + } + + if _, exist := dynConfig.Config["blob_storage_config"]; !exist { + return errors.New("failed to find mandatory `blob_storage_config` field inside config") + } + + return nil +} + +func GetConfigForCMS(dynConfig schema.DynConfig) ([]byte, error) { + delete(dynConfig.Config, "static_erasure") + delete(dynConfig.Config, "host_configs") + delete(dynConfig.Config, "nameservice_config") + delete(dynConfig.Config, "blob_storage_config") + delete(dynConfig.Config, "hosts") + + return yaml.Marshal(dynConfig) } diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 258b5494..3a4119f3 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -8,6 +8,7 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/strings/slices" @@ -195,7 +196,23 @@ func isSignAlgorithmSupported(alg string) bool { func (r *Storage) ValidateCreate() error { storagelog.Info("validate create", "name", r.Name) - configuration, err := ParseConfiguration(r.Spec.Configuration) + var rawYamlConfiguration string + success, dynConfig, err := ParseDynConfig(r.Spec.Configuration) + if success { + if err != nil { + return fmt.Errorf("failed to parse dynconfig, error: %w", err) + } + config, err := yaml.Marshal(dynConfig.Config) + if err != nil { + return fmt.Errorf("failed to serialize YAML config, error: %w", err) + } + rawYamlConfiguration = string(config) + } else { + rawYamlConfiguration = r.Spec.Configuration + } + + var configuration schema.Configuration + configuration, err = ParseConfiguration(rawYamlConfiguration) if err != nil { return fmt.Errorf("failed to parse configuration, error: %w", err) } @@ -293,7 +310,23 @@ func hasUpdatesBesidesFrozen(oldStorage, newStorage *Storage) (bool, string) { func (r *Storage) ValidateUpdate(old runtime.Object) error { storagelog.Info("validate update", "name", r.Name) - configuration, err := ParseConfiguration(r.Spec.Configuration) + var rawYamlConfiguration string + success, dynConfig, err := ParseDynConfig(r.Spec.Configuration) + if success { + if err != nil { + return fmt.Errorf("failed to parse dynconfig, error: %w", err) + } + config, err := yaml.Marshal(dynConfig.Config) + if err != nil { + return fmt.Errorf("failed to serialize YAML config, error: %w", err) + } + rawYamlConfiguration = string(config) + } else { + rawYamlConfiguration = r.Spec.Configuration + } + + var configuration schema.Configuration + configuration, err = ParseConfiguration(rawYamlConfiguration) if err != nil { return fmt.Errorf("failed to parse configuration, error: %w", err) } diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 03fa4f92..8c23d714 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.25 +version: 0.5.26 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.25" +appVersion: "0.5.26" diff --git a/e2e/tests/data/storage-block-4-2-dynconfig.yaml b/e2e/tests/data/storage-block-4-2-dynconfig.yaml new file mode 100644 index 00000000..d45e523c --- /dev/null +++ b/e2e/tests/data/storage-block-4-2-dynconfig.yaml @@ -0,0 +1,111 @@ +metadata: + kind: MainConfig + cluster: "" + version: 0 +allowed_labels: {} +selector_config: [] +config: + yaml_config_enabled: true + static_erasure: block-4-2 + host_configs: + - drive: + - path: SectorMap:1:1 + type: SSD + host_config_id: 1 + domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: block-4-2 + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: [1, 2, 3, 4, 5, 6, 7, 8] + nto_select: 5 + ssid: 1 + table_service_config: + sql_version: 1 + actor_system_config: + executor: + - name: System + threads: 1 + type: BASIC + - name: User + threads: 1 + type: BASIC + - name: Batch + threads: 1 + type: BASIC + - name: IO + threads: 1 + time_per_mailbox_micro_secs: 100 + type: IO + - name: IC + spin_threshold: 10 + threads: 4 + time_per_mailbox_micro_secs: 100 + type: BASIC + scheduler: + progress_threshold: 10000 + resolution: 256 + spin_threshold: 0 + blob_storage_config: + service_set: + groups: + - erasure_species: block-4-2 + rings: + - fail_domains: + - vdisk_locations: + - node_id: storage-0 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-1 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-2 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-3 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-4 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-5 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-6 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-7 + pdisk_category: SSD + path: SectorMap:1:1 + channel_profile_config: + profile: + - channel: + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + profile_id: 0 + grpc_config: + port: 2135 diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index a2dc6e20..0af88c3a 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -764,6 +764,62 @@ var _ = Describe("Operator smoke test", func() { }, test.Timeout, test.Interval).Should(BeTrue()) }) + It("check storage with dynconfig", func() { + By("create storage...") + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-dynconfig.yaml")) + + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) + }() + + storage := v1alpha1.Storage{} + By("waiting until StorageInitialized condition is true...") + Eventually(func(g Gomega) bool { + g.Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &storage)).Should(Succeed()) + + condition := meta.FindStatusCondition(storage.Status.Conditions, StorageInitializedCondition) + if condition != nil { + return condition.Status == metav1.ConditionTrue + } + + return false + }, Timeout, Interval).Should(BeTrue()) + + By("waiting until ReplaceConfig condition is true...") + Eventually(func(g Gomega) bool { + g.Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &storage)).Should(Succeed()) + + condition := meta.FindStatusCondition(storage.Status.Conditions, ReplaceConfigOperationCondition) + if condition != nil && condition.ObservedGeneration == storage.Generation { + return condition.Status == metav1.ConditionTrue + } + + return false + }, Timeout, Interval).Should(BeTrue()) + + By("waiting until ConfigurationSynced condition is true...") + Eventually(func(g Gomega) bool { + g.Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &storage)).Should(Succeed()) + + condition := meta.FindStatusCondition(storage.Status.Conditions, ConfigurationSyncedCondition) + if condition != nil && condition.ObservedGeneration == storage.Generation { + return condition.Status == metav1.ConditionTrue + } + + return false + }, Timeout, Interval).Should(BeTrue()) + }) + It("TLS for status service", func() { tlsHTTPCheck := func(port int) error { url := fmt.Sprintf("https://localhost:%d/", port) diff --git a/internal/cms/dynconfig.go b/internal/cms/dynconfig.go new file mode 100644 index 00000000..5f4f8711 --- /dev/null +++ b/internal/cms/dynconfig.go @@ -0,0 +1,113 @@ +package cms + +import ( + "context" + "fmt" + "time" + + "github.com/ydb-platform/ydb-go-genproto/draft/Ydb_DynamicConfig_V1" + "github.com/ydb-platform/ydb-go-genproto/draft/protos/Ydb_DynamicConfig" + "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Operations" + "github.com/ydb-platform/ydb-go-sdk/v3" + "google.golang.org/protobuf/types/known/durationpb" + "sigs.k8s.io/controller-runtime/pkg/log" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/connection" +) + +const ( + GetConfigTimeoutSeconds = 10 + ReplaceConfigTimeoutSeconds = 30 +) + +type Config struct { + StorageEndpoint string + Domain string + Config string + Version uint64 + DryRun bool + AllowUnknownFields bool +} + +func (c *Config) GetConfig( + ctx context.Context, + opts ...ydb.Option, +) (*Ydb_DynamicConfig.GetConfigResponse, error) { + logger := log.FromContext(ctx) + + endpoint := fmt.Sprintf("%s/%s", c.StorageEndpoint, c.Domain) + conn, err := connection.Open(ctx, endpoint, ydb.MergeOptions(opts...)) + if err != nil { + return nil, fmt.Errorf("error connecting to YDB: %w", err) + } + defer func() { + connection.Close(ctx, conn) + }() + + cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, GetConfigTimeoutSeconds*time.Second) + defer cmsCtxCancel() + client := Ydb_DynamicConfig_V1.NewDynamicConfigServiceClient(ydb.GRPCConn(conn)) + request := c.makeGetConfigRequest() + + logger.Info("CMS GetConfig request", "endpoint", endpoint, "request", request) + return client.GetConfig(cmsCtx, request) +} + +func (c *Config) ProcessConfigResponse(ctx context.Context, response *Ydb_DynamicConfig.GetConfigResponse) error { + logger := log.FromContext(ctx) + logger.Info("CMS GetConfig response", "response", response) + + configResult := &Ydb_DynamicConfig.GetConfigResult{} + err := response.GetOperation().GetResult().UnmarshalTo(configResult) + if err != nil { + return err + } + + c.Config = configResult.GetConfig() + c.Version = configResult.GetIdentity().GetVersion() + return nil +} + +func (c *Config) ReplaceConfig( + ctx context.Context, + opts ...ydb.Option, +) (*Ydb_DynamicConfig.ReplaceConfigResponse, error) { + logger := log.FromContext(ctx) + + endpoint := fmt.Sprintf("%s/%s", c.StorageEndpoint, c.Domain) + conn, err := connection.Open(ctx, endpoint, ydb.MergeOptions(opts...)) + if err != nil { + return nil, fmt.Errorf("error connecting to YDB: %w", err) + } + defer func() { + connection.Close(ctx, conn) + }() + + cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, ReplaceConfigTimeoutSeconds*time.Second) + defer cmsCtxCancel() + client := Ydb_DynamicConfig_V1.NewDynamicConfigServiceClient(ydb.GRPCConn(conn)) + request := &Ydb_DynamicConfig.ReplaceConfigRequest{ + Config: c.Config, + DryRun: c.DryRun, + AllowUnknownFields: c.AllowUnknownFields, + } + + logger.Info("CMS ReplaceConfig request", "endpoint", endpoint, "request", request) + return client.ReplaceConfig(cmsCtx, request) +} + +func (c *Config) CheckReplaceConfigResponse(ctx context.Context, response *Ydb_DynamicConfig.ReplaceConfigResponse) (bool, string, error) { + logger := log.FromContext(ctx) + + logger.Info("CMS ReplaceConfig response", "response", response) + return CheckOperationStatus(response.GetOperation()) +} + +func (c *Config) makeGetConfigRequest() *Ydb_DynamicConfig.GetConfigRequest { + request := &Ydb_DynamicConfig.GetConfigRequest{} + request.OperationParams = &Ydb_Operations.OperationParams{ + OperationTimeout: &durationpb.Duration{Seconds: GetConfigTimeoutSeconds}, + } + + return request +} diff --git a/internal/cms/operation.go b/internal/cms/operation.go index 5865a50c..7f023c47 100644 --- a/internal/cms/operation.go +++ b/internal/cms/operation.go @@ -31,14 +31,12 @@ func (op *Operation) GetOperation( logger := log.FromContext(ctx) endpoint := fmt.Sprintf("%s/%s", op.StorageEndpoint, op.Domain) - ydbCtx, ydbCtxCancel := context.WithTimeout(ctx, time.Second) - defer ydbCtxCancel() - conn, err := connection.Open(ydbCtx, endpoint, ydb.MergeOptions(opts...)) + conn, err := connection.Open(ctx, endpoint, ydb.MergeOptions(opts...)) if err != nil { return nil, fmt.Errorf("error connecting to YDB: %w", err) } defer func() { - connection.Close(ydbCtx, conn) + connection.Close(ctx, conn) }() cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, GetOperationTimeoutSeconds*time.Second) @@ -46,14 +44,14 @@ func (op *Operation) GetOperation( client := Ydb_Operation_V1.NewOperationServiceClient(ydb.GRPCConn(conn)) request := &Ydb_Operations.GetOperationRequest{Id: op.ID} - logger.Info("CMS GetOperation", "endpoint", endpoint, "request", request) + logger.Info("CMS GetOperation request", "endpoint", endpoint, "request", request) return client.GetOperation(cmsCtx, request) } func (op *Operation) CheckGetOperationResponse(ctx context.Context, response *Ydb_Operations.GetOperationResponse) (bool, string, error) { logger := log.FromContext(ctx) - logger.Info("CMS GetOperation", "response", response) + logger.Info("CMS GetOperation response", "response", response) return CheckOperationStatus(response.GetOperation()) } diff --git a/internal/cms/tenant.go b/internal/cms/tenant.go index ad5b57d6..f403e944 100644 --- a/internal/cms/tenant.go +++ b/internal/cms/tenant.go @@ -37,28 +37,26 @@ func (t *Tenant) CreateDatabase( logger := log.FromContext(ctx) endpoint := fmt.Sprintf("%s/%s", t.StorageEndpoint, t.Domain) - ydbCtx, ydbCtxCancel := context.WithTimeout(ctx, time.Second) - defer ydbCtxCancel() - conn, err := connection.Open(ydbCtx, endpoint, opts...) + conn, err := connection.Open(ctx, endpoint, opts...) if err != nil { return nil, fmt.Errorf("error connecting to YDB: %w", err) } defer func() { - connection.Close(ydbCtx, conn) + connection.Close(ctx, conn) }() cmsCtx, cmsCtxCancel := context.WithTimeout(ctx, CreateDatabaseTimeoutSeconds*time.Second) defer cmsCtxCancel() client := Ydb_Cms_V1.NewCmsServiceClient(ydb.GRPCConn(conn)) request := t.makeCreateDatabaseRequest() - logger.Info("CMS CreateDatabase", "endpoint", endpoint, "request", request) + logger.Info("CMS CreateDatabase request", "endpoint", endpoint, "request", request) return client.CreateDatabase(cmsCtx, request) } func (t *Tenant) CheckCreateDatabaseResponse(ctx context.Context, response *Ydb_Cms.CreateDatabaseResponse) (bool, string, error) { logger := log.FromContext(ctx) - logger.Info("CMS CreateDatabase", "response", response) + logger.Info("CMS CreateDatabase response", "response", response) return CheckOperationStatus(response.GetOperation()) } diff --git a/internal/configuration/schema/configuration.go b/internal/configuration/schema/configuration.go index 8847af52..086c2d16 100644 --- a/internal/configuration/schema/configuration.go +++ b/internal/configuration/schema/configuration.go @@ -1,6 +1,6 @@ package schema -type Dynconfig struct { +type DynConfig struct { Metadata *Metadata `yaml:"metadata"` Config map[string]interface{} `yaml:"config"` AllowedLabels map[string]interface{} `yaml:"allowed_labels"` diff --git a/internal/configuration/schema/schema_test.go b/internal/configuration/schema/schema_test.go index 2203845c..e8221bf6 100644 --- a/internal/configuration/schema/schema_test.go +++ b/internal/configuration/schema/schema_test.go @@ -14,7 +14,6 @@ import ( //nolint:all var configurationExample = ` --- -yaml_config_enabled: true domains_config: domain: - name: Root @@ -73,6 +72,7 @@ key_config: version: 1 ` +//nolint:all var dynconfigExample = ` --- metadata: @@ -80,6 +80,111 @@ metadata: version: 0 cluster: "unknown" # comment1 +config: + yaml_config_enabled: true + static_erasure: block-4-2 + host_configs: + - drive: + - path: SectorMap:1:1 + type: SSD + host_config_id: 1 + domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: block-4-2 + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: [1, 2, 3, 4, 5, 6, 7, 8] + nto_select: 5 + ssid: 1 + table_service_config: + sql_version: 1 + actor_system_config: + executor: + - name: System + threads: 1 + type: BASIC + - name: User + threads: 1 + type: BASIC + - name: Batch + threads: 1 + type: BASIC + - name: IO + threads: 1 + time_per_mailbox_micro_secs: 100 + type: IO + - name: IC + spin_threshold: 10 + threads: 4 + time_per_mailbox_micro_secs: 100 + type: BASIC + scheduler: + progress_threshold: 10000 + resolution: 256 + spin_threshold: 0 + blob_storage_config: + service_set: + groups: + - erasure_species: block-4-2 + rings: + - fail_domains: + - vdisk_locations: + - node_id: storage-0 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-1 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-2 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-3 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-4 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-5 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-6 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: storage-7 + pdisk_category: SSD + path: SectorMap:1:1 + channel_profile_config: + profile: + - channel: + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + - erasure_species: block-4-2 + pdisk_category: 1 + storage_pool_kind: ssd + profile_id: 0 + grpc_config: + port: 2135 selector_config: - description: actor system config for dynnodes selector: @@ -96,8 +201,6 @@ allowed_labels: type: string tenant: type: string -config: - yaml_config_enabled: true ` func TestSchema(t *testing.T) { @@ -107,18 +210,22 @@ func TestSchema(t *testing.T) { var _ = Describe("Testing schema", func() { It("Parse dynconfig", func() { - dynconfig, err := v1alpha1.ParseDynconfig(dynconfigExample) + success, dynconfig, err := v1alpha1.ParseDynConfig(dynconfigExample) + Expect(success).Should(BeTrue()) Expect(err).ShouldNot(HaveOccurred()) Expect(*dynconfig.Metadata).Should(BeEquivalentTo(schema.Metadata{ Kind: "MainConfig", Version: 0, Cluster: "unknown", })) + Expect(dynconfig.AllowedLabels).ShouldNot(BeNil()) + Expect(dynconfig.SelectorConfig).ShouldNot(BeNil()) Expect(dynconfig.Config["yaml_config_enabled"]).Should(BeTrue()) }) It("Try parse static config as dynconfig", func() { - _, err := v1alpha1.ParseDynconfig(configurationExample) + success, _, err := v1alpha1.ParseDynConfig(configurationExample) + Expect(success).ShouldNot(BeTrue()) Expect(err).Should(HaveOccurred()) }) diff --git a/internal/controllers/constants/constants.go b/internal/controllers/constants/constants.go index 93b374ea..ed995638 100644 --- a/internal/controllers/constants/constants.go +++ b/internal/controllers/constants/constants.go @@ -25,18 +25,21 @@ const ( StoragePausedCondition = "StoragePaused" StorageReadyCondition = "StorageReady" - DatabasePreparedCondition = "DatabasePrepared" - DatabaseInitializedCondition = "DatabaseInitialized" - DatabaseProvisionedCondition = "DatabaseProvisioned" - DatabasePausedCondition = "DatabasePaused" - DatabaseReadyCondition = "DatabaseReady" - CreateDatabaseOperationCondition = "CreateDatabaseOperation" + DatabasePreparedCondition = "DatabasePrepared" + DatabaseInitializedCondition = "DatabaseInitialized" + DatabaseProvisionedCondition = "DatabaseProvisioned" + DatabasePausedCondition = "DatabasePaused" + DatabaseReadyCondition = "DatabaseReady" NodeSetPreparedCondition = "NodeSetPrepared" NodeSetProvisionedCondition = "NodeSetProvisioned" NodeSetReadyCondition = "NodeSetReady" NodeSetPausedCondition = "NodeSetPaused" + CreateDatabaseOperationCondition = "CreateDatabaseOperation" + ReplaceConfigOperationCondition = "ReplaceConfigOperation" + + ConfigurationSyncedCondition = "ConfigurationSynced" RemoteResourceSyncedCondition = "ResourceSynced" Stop = true @@ -49,6 +52,7 @@ const ( DefaultRequeueDelay = 10 * time.Second StatusUpdateRequeueDelay = 1 * time.Second + ReplaceConfigOperationRequeueDelay = 15 * time.Second SelfCheckRequeueDelay = 30 * time.Second StorageInitializationRequeueDelay = 30 * time.Second DatabaseInitializationRequeueDelay = 30 * time.Second diff --git a/internal/controllers/storage/config.go b/internal/controllers/storage/config.go new file mode 100644 index 00000000..ea8f5f1d --- /dev/null +++ b/internal/controllers/storage/config.go @@ -0,0 +1,327 @@ +package storage + +import ( + "context" + "fmt" + + "github.com/ydb-platform/ydb-go-sdk/v3" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/cms" + . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck + "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" +) + +func (r *Reconciler) replaceConfig( + ctx context.Context, + storage *resources.StorageClusterBuilder, + cmsConfig *cms.Config, + ydbOptions ydb.Option, +) (bool, ctrl.Result, error) { + response, err := cmsConfig.ReplaceConfig(ctx, ydbOptions) + if err != nil { + r.Log.Error(err, "failed to request CMS ReplaceConfig") + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionFalse, + ObservedGeneration: storage.Generation, + Reason: ReasonFailed, + Message: fmt.Sprintf("Failed to request CMS ReplaceConfig: %s", err), + }) + return Stop, ctrl.Result{RequeueAfter: ReplaceConfigOperationRequeueDelay}, err + } + + finished, operationID, err := cmsConfig.CheckReplaceConfigResponse(ctx, response) + if err != nil { + r.Log.Error(err, "failed response CMS ReplaceConfig") + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionFalse, + ObservedGeneration: storage.Generation, + Reason: ReasonFailed, + Message: fmt.Sprintf("Failed response CMS ReplaceConfig: %s", err), + }) + return r.updateStatus(ctx, storage, DefaultRequeueDelay) + } + + if !finished { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + string(StoragePreparing), + fmt.Sprintf("CMS ReplaceConfig operation in progress, operationID: %s", operationID), + ) + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionUnknown, + ObservedGeneration: storage.Generation, + Reason: ReasonInProgress, + Message: operationID, + }) + return r.updateStatus(ctx, storage, ReplaceConfigOperationRequeueDelay) + } + + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionTrue, + ObservedGeneration: storage.Generation, + Reason: ReasonCompleted, + Message: fmt.Sprintf("Config replaced to version: %d", cmsConfig.Version), + }) + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) +} + +func (r *Reconciler) checkReplaceConfigOperation( + ctx context.Context, + storage *resources.StorageClusterBuilder, + cmsConfig *cms.Config, + ydbOptions ydb.Option, +) (bool, ctrl.Result, error) { + condition := meta.FindStatusCondition(storage.Status.Conditions, ReplaceConfigOperationCondition) + if len(condition.Message) == 0 { + // retry replace config + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonFailed, + Message: "Something is wrong with the condition", + }) + return r.updateStatus(ctx, storage, ReplaceConfigOperationRequeueDelay) + } + + operation := &cms.Operation{ + StorageEndpoint: cmsConfig.StorageEndpoint, + Domain: cmsConfig.Domain, + ID: condition.Message, + } + response, err := operation.GetOperation(ctx, ydbOptions) + if err != nil { + r.Log.Error(err, "request CMS GetOperation error") + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to request CMS GetOperation: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + finished, operationID, err := operation.CheckGetOperationResponse(ctx, response) + if err != nil { + errMessage := fmt.Sprintf("Error replacing config to version %d: %s", cmsConfig.Version, err) + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "PreparingFailed", + errMessage, + ) + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonFailed, + Message: errMessage, + }) + return Stop, ctrl.Result{RequeueAfter: ReplaceConfigOperationRequeueDelay}, err + } + + if !finished { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + string(StoragePreparing), + fmt.Sprintf("Config replacing operation is not completed, operationID: %s", operationID), + ) + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionUnknown, + ObservedGeneration: storage.Generation, + Reason: ReasonInProgress, + Message: operationID, + }) + return r.updateStatus(ctx, storage, ReplaceConfigOperationRequeueDelay) + } + + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ReplaceConfigOperationCondition, + Status: metav1.ConditionTrue, + ObservedGeneration: storage.Generation, + Reason: ReasonCompleted, + Message: fmt.Sprintf("Config replaced to version: %d", cmsConfig.Version), + }) + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) +} + +func (r *Reconciler) setConfigPipelineStatus( + ctx context.Context, + storage *resources.StorageClusterBuilder, +) (bool, ctrl.Result, error) { + r.Log.Info("running step setConfigPipelineStatus") + isDynConfig, dynConfig, _ := v1alpha1.ParseDynConfig(storage.Spec.Configuration) + if !isDynConfig { + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ConfigurationSyncedCondition, + Status: metav1.ConditionTrue, + ObservedGeneration: storage.Generation, + Reason: ReasonNotRequired, + Message: "Sync static configuration does not supported", + }) + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) + } + + yamlConfig, err := v1alpha1.GetConfigForCMS(dynConfig) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to get configuration for CMS: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + cmsConfig := &cms.Config{ + StorageEndpoint: storage.GetStorageEndpointWithProto(), + Domain: storage.Spec.Domain, + Config: string(yamlConfig), + DryRun: true, + AllowUnknownFields: true, + } + + creds, err := resources.GetYDBCredentials(ctx, storage.Unwrap(), r.Config) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to get YDB credentials: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + tlsOptions, err := resources.GetYDBTLSOption(ctx, storage.Unwrap(), r.Config) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to get YDB TLS options: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + ydbOpts := ydb.MergeOptions(ydb.WithCredentials(creds), tlsOptions) + + response, err := cmsConfig.GetConfig(ctx, ydbOpts) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + string(StorageProvisioning), + fmt.Sprintf("Failed to request CMS GetConfig: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + err = cmsConfig.ProcessConfigResponse(ctx, response) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + string(StorageProvisioning), + fmt.Sprintf("Failed to process config response: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + if cmsConfig.Version > dynConfig.Metadata.Version { + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ConfigurationSyncedCondition, + Status: metav1.ConditionTrue, + ObservedGeneration: storage.Generation, + Reason: ReasonNotRequired, + Message: fmt.Sprintf("Configuration already synced to version %d", cmsConfig.Version), + }) + r.Log.Info("complete step setConfigPipelineStatus") + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) + } + + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ConfigurationSyncedCondition, + Status: metav1.ConditionUnknown, + ObservedGeneration: storage.Generation, + Reason: ReasonInProgress, + Message: fmt.Sprintf("Sync configuration in progress to version %d", dynConfig.Metadata.Version), + }) + r.Log.Info("complete step setConfigPipelineStatus") + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) +} + +func (r *Reconciler) handleConfigurationSync( + ctx context.Context, + storage *resources.StorageClusterBuilder, +) (bool, ctrl.Result, error) { + r.Log.Info("running step handleConfigurationSync") + + _, dynConfig, err := v1alpha1.ParseDynConfig(storage.Spec.Configuration) + if err != nil { + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + yamlConfig, err := v1alpha1.GetConfigForCMS(dynConfig) + if err != nil { + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + creds, err := resources.GetYDBCredentials(ctx, storage.Unwrap(), r.Config) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to get YDB credentials: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + + tlsOptions, err := resources.GetYDBTLSOption(ctx, storage.Unwrap(), r.Config) + if err != nil { + r.Recorder.Event( + storage, + corev1.EventTypeWarning, + "ControllerError", + fmt.Sprintf("Failed to get YDB credentials: %s", err), + ) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + } + ydbOpts := ydb.MergeOptions(ydb.WithCredentials(creds), tlsOptions) + + cmsConfig := &cms.Config{ + StorageEndpoint: storage.GetStorageEndpointWithProto(), + Domain: storage.Spec.Domain, + Config: string(yamlConfig), + DryRun: false, + AllowUnknownFields: true, + } + + condition := meta.FindStatusCondition(storage.Status.Conditions, ReplaceConfigOperationCondition) + if condition != nil && condition.ObservedGeneration == storage.Generation && condition.Status == metav1.ConditionUnknown { + return r.checkReplaceConfigOperation(ctx, storage, cmsConfig, ydbOpts) + } + + if condition == nil || condition.ObservedGeneration < storage.Generation || condition.Status == metav1.ConditionFalse { + return r.replaceConfig(ctx, storage, cmsConfig, ydbOpts) + } + + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: ConfigurationSyncedCondition, + Status: metav1.ConditionTrue, + ObservedGeneration: storage.Generation, + Reason: ReasonCompleted, + Message: fmt.Sprintf("Configuration synced successfully to version %d", cmsConfig.Version), + }) + r.Log.Info("complete step handleConfigurationSync") + return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) +} diff --git a/internal/controllers/storage/sync.go b/internal/controllers/storage/sync.go index 91a3593b..ebf833ec 100644 --- a/internal/controllers/storage/sync.go +++ b/internal/controllers/storage/sync.go @@ -50,6 +50,21 @@ func (r *Reconciler) Sync(ctx context.Context, cr *v1alpha1.Storage) (ctrl.Resul return r.handleBlobstorageInit(ctx, &storage) } + configSyncCondition := meta.FindStatusCondition(storage.Status.Conditions, ConfigurationSyncedCondition) + if configSyncCondition == nil || configSyncCondition.ObservedGeneration < storage.Generation { + stop, result, err = r.setConfigPipelineStatus(ctx, &storage) + if stop { + return result, err + } + } + + if !meta.IsStatusConditionTrue(storage.Status.Conditions, ConfigurationSyncedCondition) { + stop, result, err = r.handleConfigurationSync(ctx, &storage) + if stop { + return result, err + } + } + if storage.Spec.NodeSets != nil { stop, result, err = r.waitForNodeSetsToProvisioned(ctx, &storage) if stop { diff --git a/internal/resources/storage.go b/internal/resources/storage.go index 83f83661..9eaef577 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -52,8 +52,8 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R var optionalBuilders []ResourceBuilder - dynconfig, err := api.ParseDynconfig(b.Spec.Configuration) - if err != nil { + success, dynconfig, _ := api.ParseDynConfig(b.Spec.Configuration) + if !success { // YDBOPS-9722 backward compatibility cfg, _ := api.BuildConfiguration(b.Unwrap(), nil) optionalBuilders = append( From a6b15015fa344abb1a3c08271f5a2b2827c4d665 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Mon, 30 Sep 2024 13:44:15 +0200 Subject: [PATCH 30/70] Enable 3 node deployment (#249) --- .github/workflows/check-pr.yml | 95 ------------ .github/workflows/run-tests.yml | 145 +++++------------- .github/workflows/upload-artifacts.yml | 3 - .golangci.yml | 33 ---- Makefile | 4 +- docs/tests.md | 4 +- e2e/kind-cluster-config.yaml | 19 --- .../data/storage-block-4-2-config-tls.yaml | 115 -------------- ... storage-mirror-3-dc-config-nodeSets.yaml} | 81 ++++++---- ...orage-mirror-3-dc-config-staticCreds.yaml} | 81 ++++++---- .../data/storage-mirror-3-dc-config-tls.yaml | 130 ++++++++++++++++ ...s.yaml => storage-mirror-3-dc-config.yaml} | 81 ++++++---- ...aml => storage-mirror-3-dc-dynconfig.yaml} | 67 ++++---- e2e/tests/smoke_test.go | 45 +++--- e2e/tests/test-objects/objects.go | 8 +- .../controllers/database/controller_test.go | 2 +- .../databasenodeset/controller_test.go | 8 +- .../controllers/monitoring/monitoring_test.go | 2 +- .../remotedatabasenodeset/controller_test.go | 18 +-- .../remotestoragenodeset/controller_test.go | 12 +- .../controllers/storage/controller_test.go | 2 +- .../storagenodeset/controller_test.go | 15 +- samples/minikube/database.yaml | 2 +- samples/minikube/storage.yaml | 2 +- samples/storage-mirror-3dc.yaml | 2 +- 25 files changed, 420 insertions(+), 556 deletions(-) delete mode 100644 .github/workflows/check-pr.yml delete mode 100644 e2e/tests/data/storage-block-4-2-config-tls.yaml rename e2e/tests/data/{storage-block-4-2-config.yaml => storage-mirror-3-dc-config-nodeSets.yaml} (54%) rename e2e/tests/data/{storage-block-4-2-config-staticCreds.yaml => storage-mirror-3-dc-config-staticCreds.yaml} (55%) create mode 100644 e2e/tests/data/storage-mirror-3-dc-config-tls.yaml rename e2e/tests/data/{storage-block-4-2-config-nodeSets.yaml => storage-mirror-3-dc-config.yaml} (54%) rename e2e/tests/data/{storage-block-4-2-dynconfig.yaml => storage-mirror-3-dc-dynconfig.yaml} (60%) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml deleted file mode 100644 index 7dfb9dec..00000000 --- a/.github/workflows/check-pr.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: check-pr -on: - pull_request_target: - branches: - - 'master' - paths-ignore: - - 'docs/**' - types: - - 'opened' - - 'synchronize' - - 'reopened' - - 'labeled' -jobs: - check-running-allowed: - runs-on: ubuntu-latest - outputs: - result: ${{ steps.check-ownership-membership.outputs.result }} - steps: - - id: check-ownership-membership - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - script: | - // This is used primarily in forks. Repository owner - // should be allowed to run anything. - const userLogin = context.payload.pull_request.user.login; - - // How to interpret membership status code: - // https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#check-organization-membership-for-a-user - const isOrgMember = async function () { - try { - const response = await github.rest.orgs.checkMembershipForUser({ - org: context.payload.organization.login, - username: userLogin, - }); - return response.status == 204; - } catch (error) { - if (error.status && error.status == 404) { - return false; - } - throw error; - } - } - - if (context.payload.repository.owner.login == userLogin) { - return true; - } - - if (await isOrgMember()) { - return true; - } - - const labels = context.payload.pull_request.labels; - const okToTestLabel = labels.find( - label => label.name == 'ok-to-test' - ); - return okToTestLabel !== undefined; - - name: comment-if-waiting-on-ok - if: steps.check-ownership-membership.outputs.result == 'false' && - github.event.action == 'opened' - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Hi! Thank you for contributing!\nThe tests on this PR will run after a maintainer adds an `ok-to-test` label to this PR manually. Thank you for your patience!' - }); - - name: cleanup-test-label - uses: actions/github-script@v6 - with: - script: | - const { owner, repo } = context.repo; - const prNumber = context.payload.pull_request.number; - const labelToRemove = 'ok-to-test'; - try { - const result = await github.rest.issues.removeLabel({ - owner, - repo, - issue_number: prNumber, - name: labelToRemove - }); - } catch(e) { - // ignore the 404 error that arises - // when the label did not exist for the - // organization member - console.log(e); - } - run-tests: - needs: - - check-running-allowed - if: needs.check-running-allowed.outputs.result == 'true' - uses: ./.github/workflows/run-tests.yml - secrets: inherit diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index dd847b36..683976dd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,61 +1,18 @@ -# Implicit requirements -# runner must have `docker` and `curl` installed (true on github-runners) - name: run-tests on: - workflow_call: - workflow_dispatch: + - pull_request + - workflow_dispatch jobs: - start-runner: - runs-on: ubuntu-latest - outputs: - runner-label: ${{ steps.start-yc-runner.outputs.label }} - instance-id: ${{ steps.start-yc-runner.outputs.instance-id }} - steps: - - name: start-yc-runner - id: start-yc-runner - uses: yc-actions/yc-github-runner@v1 - with: - mode: start - yc-sa-json-credentials: ${{ secrets.CI_RUNNER_CREATOR_KEY }} - github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - folder-id: b1gmgbhccra2qca8v5g6 - image-id: fd80o2eikcn22b229tsa - cores: 16 - disk-type: network-ssd-nonreplicated - disk-size: 465GB - memory: 32GB - core-fraction: 100 - subnet-id: e9bu12i8ocv6q8kl83ru - user: yc-admin - ssh-public-key: ${{ secrets.CI_RUNNER_DEBUG_SHH_PUBLIC_KEY }} - smart-checkout: - needs: - - start-runner - runs-on: ${{ needs.start-runner.outputs.runner-label }} - steps: - - name: checkout-when-fork-source - uses: actions/checkout@v3 - if: github.event.pull_request.head.sha != '' - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: checkout-when-this-repo-source - uses: actions/checkout@v3 - if: github.event.pull_request.head.sha == '' lint: concurrency: group: lint-golangci-${{ github.head_ref || github.ref_name }} cancel-in-progress: true - needs: - - start-runner - - smart-checkout - runs-on: ${{ needs.start-runner.outputs.runner-label }} + runs-on: ubuntu-latest steps: - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV + - name: checkout + uses: actions/checkout@v3 - name: setup-go uses: actions/setup-go@v3 with: @@ -63,47 +20,35 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.52.2 + version: v1.58.1 code-format-check: concurrency: group: lint-autoformat-${{ github.head_ref || github.ref_name }} cancel-in-progress: true - needs: - - start-runner - - smart-checkout - runs-on: ${{ needs.start-runner.outputs.runner-label }} + runs-on: ubuntu-latest steps: - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV + - name: checkout + uses: actions/checkout@v3 - name: setup-go uses: actions/setup-go@v3 with: go-version: '1.20' - - name: Install utilities + - name: install-utilities run: | go install mvdan.cc/gofumpt@v0.5.0 go install github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8 - name: format all files with auto-formatter run: bash ./.github/scripts/format-all-go-code.sh "$PWD" - - name: Check repository diff + - name: check-repository-diff run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken" run-unit-tests: concurrency: group: run-unit-tests-${{ github.head_ref || github.ref_name }} cancel-in-progress: true - needs: - - start-runner - - smart-checkout - - lint - - code-format-check - runs-on: ${{ needs.start-runner.outputs.runner-label }} - outputs: - result: ${{ steps.run-unit-tests.outputs.result }} + runs-on: ubuntu-latest steps: - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV + - name: checkout + uses: actions/checkout@v3 - name: setup-go uses: actions/setup-go@v3 with: @@ -139,18 +84,19 @@ jobs: group: run-e2e-tests-${{ github.head_ref || github.ref_name }} cancel-in-progress: true needs: - - start-runner - - smart-checkout - - lint - - code-format-check - run-unit-tests - runs-on: ${{ needs.start-runner.outputs.runner-label }} - outputs: - result: ${{ steps.run-e2e-tests.outputs.result }} + runs-on: ubuntu-latest steps: - - name: set-env-vars - run: | - echo "HOME=/actions-runner" >> $GITHUB_ENV + - name: maximize-build-space + uses: AdityaGarg8/remove-unwanted-software@v4.1 + with: + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-dotnet: 'true' + remove-swapfile: 'true' + - name: checkout + uses: actions/checkout@v3 - name: setup-go uses: actions/setup-go@v3 with: @@ -175,10 +121,6 @@ jobs: echo "$(pwd)" >> $GITHUB_PATH echo "$HOME/ydb/bin" >> $GITHUB_PATH echo "$HOME/go/bin" >> $GITHUB_PATH - - name: configure-system - run: | - sudo sysctl fs.inotify.max_user_instances=1280 - sudo sysctl fs.inotify.max_user_watches=655360 - name: check-dependencies run: | gcc --version @@ -192,7 +134,12 @@ jobs: kind create cluster \ --image=kindest/node:v1.25.3@sha256:cd248d1438192f7814fbca8fede13cfe5b9918746dfa12583976158a834fd5c5 \ --config=./e2e/kind-cluster-config.yaml + kubectl wait --timeout=5m --for=condition=ready node -l worker=true + + kubectl label --overwrite node kind-worker topology.kubernetes.io/zone=fakeZone1 + kubectl label --overwrite node kind-worker2 topology.kubernetes.io/zone=fakeZone2 + kubectl label --overwrite node kind-worker3 topology.kubernetes.io/zone=fakeZone3 - name: build-operator-image uses: docker/build-push-action@v3 with: @@ -203,7 +150,7 @@ jobs: tags: kind/ydb-operator:current - name: load-and-deploy-operator run: | - kind load docker-image kind/ydb-operator:current + kind load docker-image kind/ydb-operator:current --nodes kind-worker,kind-worker2,kind-worker3 - name: pull-and-load-kube-webhook-certgen-image uses: nick-fields/retry@v3 with: @@ -212,12 +159,13 @@ jobs: max_attempts: 3 command: | docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 - kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 + kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --nodes kind-worker,kind-worker2,kind-worker3 - name: pull-and-load-ydb-image run: | - # TODO would be cool to parse YDB image from manifests to avoid duplicating information - docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 - kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 + YDB_IMAGE=$(grep "anchor_for_fetching_image_from_workflow" ./e2e/tests/**/*.go | grep -o -E '"cr\.yandex.*"') + YDB_IMAGE=${YDB_IMAGE:1:-1} # strip "" + docker pull $YDB_IMAGE + kind load docker-image $YDB_IMAGE --nodes kind-worker,kind-worker2,kind-worker3 - name: setup-gotestsum run: | go install gotest.tools/gotestsum@v1.12.0 @@ -225,7 +173,7 @@ jobs: id: run-e2e-tests run: | gotestsum --format pkgname --jsonfile log.json -- -v -timeout 3600s -p 1 ./e2e/... -ginkgo.vv - - name: convert-to-human-readable + - name: convert-json-log-to-human-readable run: jq -r '.Output| gsub("[\\n]"; "")' log.json 2>/dev/null 1>log.txt || true - name: artifact-upload-step uses: actions/upload-artifact@v4 @@ -240,21 +188,4 @@ jobs: - name: teardown-k8s-cluster run: | kind delete cluster - stop-runner: - needs: - - start-runner - - lint - - code-format-check - - run-unit-tests - - run-e2e-tests - runs-on: ubuntu-latest - if: always() - steps: - - name: stop-yc-runner - uses: yc-actions/yc-github-runner@v1 - with: - mode: stop - yc-sa-json-credentials: ${{ secrets.CI_RUNNER_CREATOR_KEY }} - github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - label: ${{ needs.start-runner.outputs.runner-label }} - instance-id: ${{ needs.start-runner.outputs.instance-id }} + diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index e636e988..6979673c 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -1,6 +1,3 @@ -# Implicit requirements -# runner must have `docker` and `curl` installed (true on github-runners) - name: upload-artifacts on: push: diff --git a/.golangci.yml b/.golangci.yml index c605df0f..ba5d9180 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -129,67 +129,34 @@ linters-settings: linters: disable-all: true enable: -# - cyclop - - deadcode - - depguard - dogsled -# - dupl - errcheck - errorlint -# - exhaustive -# - exhaustivestruct -# - forbidigo -# - funlen -# - gci -# - gocognit - goconst - gocritic - gocyclo -# - godot -# - godox # tmp disable due to FIXME & XXX - gofmt # On why gofmt when goimports is enabled - https://github.com/golang/go/issues/21476 - gofumpt - goheader - goimports -# - gomnd -# - gomoddirectives -# - gomodguard - gosec - gosimple - govet - - depguard -# - ifshort -# - ireturn -# - lll # disable due to kubebuilder comments - makezero - misspell - ineffassign - misspell - nakedret - nestif -# - nilnil -# - nlreturn -# - nolintlint -# - prealloc - predeclared - rowserrcheck - - revive - staticcheck - stylecheck - - structcheck -# - tagliatelle -# - testpackage -# - thelper -# - tenv - typecheck - unconvert - unparam - unused -# - varnamelen - - varcheck - whitespace -# - wrapcheck -# - wsl issues: # List of regexps of issue texts to exclude, empty list by default. diff --git a/Makefile b/Makefile index 82c10a1e..1b34ec1a 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,8 @@ kind-init: kind create cluster --config e2e/kind-cluster-config.yaml --name kind-ydb-operator; \ docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0; \ kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator; \ - docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17; \ - kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 --name kind-ydb-operator + docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7; \ + kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 --name kind-ydb-operator kind-load: docker tag cr.yandex/yc/ydb-operator:latest kind/ydb-operator:current diff --git a/docs/tests.md b/docs/tests.md index 6996f97f..028cdfc8 100644 --- a/docs/tests.md +++ b/docs/tests.md @@ -88,14 +88,14 @@ kind create cluster \ kubectl config use-context kind-local-kind # Within tests, the following two images are used: -# cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 +# cr.yandex/crptqonuodf51kdj7a7d/ydb: # kind/ydb-operator:current # You have to download the ydb image and build the operator image yourself. Then, explicitly # upload them into the kind cluster. Refer to `./github/e2e.yaml` github workflow which essentially # does the same thing. kind --name local-kind load docker-image kind/ydb-operator:current -kind --name local-kind load docker-image ydb:23.3.17 +kind --name local-kind load docker-image ydb: # Run all tests with disabled concurrency, because there is only one cluster to run tests against go test -p 1 -v ./... diff --git a/e2e/kind-cluster-config.yaml b/e2e/kind-cluster-config.yaml index be227cf7..0a1f7068 100644 --- a/e2e/kind-cluster-config.yaml +++ b/e2e/kind-cluster-config.yaml @@ -1,9 +1,5 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 -containerdConfigPatches: -- |- - [plugins."io.containerd.grpc.v1.cri".containerd] - snapshotter = "native" nodes: - role: control-plane - role: worker @@ -15,18 +11,3 @@ nodes: - role: worker labels: worker: true -- role: worker - labels: - worker: true -- role: worker - labels: - worker: true -- role: worker - labels: - worker: true -- role: worker - labels: - worker: true -- role: worker - labels: - worker: true diff --git a/e2e/tests/data/storage-block-4-2-config-tls.yaml b/e2e/tests/data/storage-block-4-2-config-tls.yaml deleted file mode 100644 index 2fcd115e..00000000 --- a/e2e/tests/data/storage-block-4-2-config-tls.yaml +++ /dev/null @@ -1,115 +0,0 @@ -static_erasure: block-4-2 -host_configs: - - drive: - - path: SectorMap:1:1 - type: SSD - host_config_id: 1 -domains_config: - domain: - - name: Root - storage_pool_types: - - kind: ssd - pool_config: - box_id: 1 - erasure_species: block-4-2 - kind: ssd - pdisk_filter: - - property: - - type: SSD - vdisk_kind: Default - state_storage: - - ring: - node: [1, 2, 3, 4, 5, 6, 7, 8] - nto_select: 5 - ssid: 1 -table_service_config: - sql_version: 1 -actor_system_config: - executor: - - name: System - threads: 1 - type: BASIC - - name: User - threads: 1 - type: BASIC - - name: Batch - threads: 1 - type: BASIC - - name: IO - threads: 1 - time_per_mailbox_micro_secs: 100 - type: IO - - name: IC - spin_threshold: 10 - threads: 4 - time_per_mailbox_micro_secs: 100 - type: BASIC - scheduler: - progress_threshold: 10000 - resolution: 256 - spin_threshold: 0 -blob_storage_config: - service_set: - groups: - - erasure_species: block-4-2 - rings: - - fail_domains: - - vdisk_locations: - - node_id: 1 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 2 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 3 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 4 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 5 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 6 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 7 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 8 - pdisk_category: SSD - path: SectorMap:1:1 -channel_profile_config: - profile: - - channel: - - erasure_species: block-4-2 - pdisk_category: 1 - storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 - storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 - storage_pool_kind: ssd - profile_id: 0 -grpc_config: - start_grpc_proxy: true - ssl_port: 2135 - ca: /etc/ssl/certs/ca-certificates.crt - cert: /tls/grpc/tls.crt - key: /tls/grpc/tls.key - grpc_memory_quota_bytes: '1073741824' - host: '[::]' - keep_alive_enable: true - keep_alive_idle_timeout_trigger_sec: 90 - keep_alive_max_probe_count: 3 - keep_alive_probe_interval_sec: 10 - services: [legacy, yql, scripting, cms, discovery, monitoring, import, export, locking, maintenance] - streaming_config: {enable_output_streams: true} diff --git a/e2e/tests/data/storage-block-4-2-config.yaml b/e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml similarity index 54% rename from e2e/tests/data/storage-block-4-2-config.yaml rename to e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml index 831fa5f5..0384fb6b 100644 --- a/e2e/tests/data/storage-block-4-2-config.yaml +++ b/e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml @@ -1,8 +1,12 @@ -static_erasure: block-4-2 +static_erasure: mirror-3-dc host_configs: - drive: - path: SectorMap:1:1 type: SSD + - path: SectorMap:2:1 + type: SSD + - path: SectorMap:3:1 + type: SSD host_config_id: 1 domains_config: domain: @@ -11,47 +15,52 @@ domains_config: - kind: ssd pool_config: box_id: 1 - erasure_species: block-4-2 + erasure_species: mirror-3-dc kind: ssd + geometry: + realm_level_begin: 10 + realm_level_end: 20 + domain_level_begin: 10 + domain_level_end: 256 pdisk_filter: - property: - - type: SSD + - type: SSD # device type to match host_configs.drive.type vdisk_kind: Default state_storage: - ring: - node: [1, 2, 3, 4, 5, 6, 7, 8] - nto_select: 5 + node: [1, 2, 3] + nto_select: 3 ssid: 1 table_service_config: sql_version: 1 actor_system_config: - executor: - - name: System + executor: + - name: System threads: 1 type: BASIC - - name: User + - name: User threads: 1 type: BASIC - - name: Batch - threads: 1 + - name: Batch + threads: 1 type: BASIC - - name: IO + - name: IO threads: 1 time_per_mailbox_micro_secs: 100 type: IO - - name: IC + - name: IC spin_threshold: 10 - threads: 4 + threads: 4 time_per_mailbox_micro_secs: 100 type: BASIC scheduler: progress_threshold: 10000 resolution: 256 spin_threshold: 0 -blob_storage_config: +blob_storage_config: # configuration of static blobstorage group. service_set: groups: - - erasure_species: block-4-2 + - erasure_species: mirror-3-dc rings: - fail_domains: - vdisk_locations: @@ -59,44 +68,50 @@ blob_storage_config: pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 2 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 3 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 4 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 5 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 6 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 7 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 8 + - node_id: 3 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:1 channel_profile_config: profile: - channel: - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd profile_id: 0 grpc_config: diff --git a/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml b/e2e/tests/data/storage-mirror-3-dc-config-staticCreds.yaml similarity index 55% rename from e2e/tests/data/storage-block-4-2-config-staticCreds.yaml rename to e2e/tests/data/storage-mirror-3-dc-config-staticCreds.yaml index f6cc762b..b6f5ea20 100644 --- a/e2e/tests/data/storage-block-4-2-config-staticCreds.yaml +++ b/e2e/tests/data/storage-mirror-3-dc-config-staticCreds.yaml @@ -1,8 +1,12 @@ -static_erasure: block-4-2 +static_erasure: mirror-3-dc host_configs: - drive: - path: SectorMap:1:1 type: SSD + - path: SectorMap:2:1 + type: SSD + - path: SectorMap:3:1 + type: SSD host_config_id: 1 domains_config: security_config: @@ -13,47 +17,52 @@ domains_config: - kind: ssd pool_config: box_id: 1 - erasure_species: block-4-2 + erasure_species: mirror-3-dc kind: ssd + geometry: + realm_level_begin: 10 + realm_level_end: 20 + domain_level_begin: 10 + domain_level_end: 256 pdisk_filter: - property: - - type: SSD + - type: SSD # device type to match host_configs.drive.type vdisk_kind: Default state_storage: - ring: - node: [1, 2, 3, 4, 5, 6, 7, 8] - nto_select: 5 + node: [1, 2, 3] + nto_select: 3 ssid: 1 table_service_config: sql_version: 1 actor_system_config: - executor: - - name: System + executor: + - name: System threads: 1 type: BASIC - - name: User + - name: User threads: 1 type: BASIC - - name: Batch - threads: 1 + - name: Batch + threads: 1 type: BASIC - - name: IO + - name: IO threads: 1 time_per_mailbox_micro_secs: 100 type: IO - - name: IC + - name: IC spin_threshold: 10 - threads: 4 + threads: 4 time_per_mailbox_micro_secs: 100 type: BASIC scheduler: progress_threshold: 10000 resolution: 256 spin_threshold: 0 -blob_storage_config: +blob_storage_config: # configuration of static blobstorage group. service_set: groups: - - erasure_species: block-4-2 + - erasure_species: mirror-3-dc rings: - fail_domains: - vdisk_locations: @@ -61,44 +70,50 @@ blob_storage_config: pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 2 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 3 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 4 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 5 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 6 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 7 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 8 + - node_id: 3 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:1 channel_profile_config: profile: - channel: - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd profile_id: 0 grpc_config: diff --git a/e2e/tests/data/storage-mirror-3-dc-config-tls.yaml b/e2e/tests/data/storage-mirror-3-dc-config-tls.yaml new file mode 100644 index 00000000..2d9093e2 --- /dev/null +++ b/e2e/tests/data/storage-mirror-3-dc-config-tls.yaml @@ -0,0 +1,130 @@ +static_erasure: mirror-3-dc +host_configs: + - drive: + - path: SectorMap:1:1 + type: SSD + - path: SectorMap:2:1 + type: SSD + - path: SectorMap:3:1 + type: SSD + host_config_id: 1 +domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: mirror-3-dc + kind: ssd + geometry: + realm_level_begin: 10 + realm_level_end: 20 + domain_level_begin: 10 + domain_level_end: 256 + pdisk_filter: + - property: + - type: SSD # device type to match host_configs.drive.type + vdisk_kind: Default + state_storage: + - ring: + node: [1, 2, 3] + nto_select: 3 + ssid: 1 +table_service_config: + sql_version: 1 +actor_system_config: + executor: + - name: System + threads: 1 + type: BASIC + - name: User + threads: 1 + type: BASIC + - name: Batch + threads: 1 + type: BASIC + - name: IO + threads: 1 + time_per_mailbox_micro_secs: 100 + type: IO + - name: IC + spin_threshold: 10 + threads: 4 + time_per_mailbox_micro_secs: 100 + type: BASIC + scheduler: + progress_threshold: 10000 + resolution: 256 + spin_threshold: 0 +blob_storage_config: # configuration of static blobstorage group. + service_set: + groups: + - erasure_species: mirror-3-dc + rings: + - fail_domains: + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:3:1 + - fail_domains: + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:3:1 + - fail_domains: + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:1:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:1 +channel_profile_config: + profile: + - channel: + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + profile_id: 0 +grpc_config: + start_grpc_proxy: true + ssl_port: 2135 + ca: /etc/ssl/certs/ca-certificates.crt + cert: /tls/grpc/tls.crt + key: /tls/grpc/tls.key + grpc_memory_quota_bytes: '1073741824' + host: '[::]' + keep_alive_enable: true + keep_alive_idle_timeout_trigger_sec: 90 + keep_alive_max_probe_count: 3 + keep_alive_probe_interval_sec: 10 + services: [legacy, yql, scripting, cms, discovery, monitoring, import, export, locking, maintenance] + streaming_config: {enable_output_streams: true} diff --git a/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml b/e2e/tests/data/storage-mirror-3-dc-config.yaml similarity index 54% rename from e2e/tests/data/storage-block-4-2-config-nodeSets.yaml rename to e2e/tests/data/storage-mirror-3-dc-config.yaml index 831fa5f5..0384fb6b 100644 --- a/e2e/tests/data/storage-block-4-2-config-nodeSets.yaml +++ b/e2e/tests/data/storage-mirror-3-dc-config.yaml @@ -1,8 +1,12 @@ -static_erasure: block-4-2 +static_erasure: mirror-3-dc host_configs: - drive: - path: SectorMap:1:1 type: SSD + - path: SectorMap:2:1 + type: SSD + - path: SectorMap:3:1 + type: SSD host_config_id: 1 domains_config: domain: @@ -11,47 +15,52 @@ domains_config: - kind: ssd pool_config: box_id: 1 - erasure_species: block-4-2 + erasure_species: mirror-3-dc kind: ssd + geometry: + realm_level_begin: 10 + realm_level_end: 20 + domain_level_begin: 10 + domain_level_end: 256 pdisk_filter: - property: - - type: SSD + - type: SSD # device type to match host_configs.drive.type vdisk_kind: Default state_storage: - ring: - node: [1, 2, 3, 4, 5, 6, 7, 8] - nto_select: 5 + node: [1, 2, 3] + nto_select: 3 ssid: 1 table_service_config: sql_version: 1 actor_system_config: - executor: - - name: System + executor: + - name: System threads: 1 type: BASIC - - name: User + - name: User threads: 1 type: BASIC - - name: Batch - threads: 1 + - name: Batch + threads: 1 type: BASIC - - name: IO + - name: IO threads: 1 time_per_mailbox_micro_secs: 100 type: IO - - name: IC + - name: IC spin_threshold: 10 - threads: 4 + threads: 4 time_per_mailbox_micro_secs: 100 type: BASIC scheduler: progress_threshold: 10000 resolution: 256 spin_threshold: 0 -blob_storage_config: +blob_storage_config: # configuration of static blobstorage group. service_set: groups: - - erasure_species: block-4-2 + - erasure_species: mirror-3-dc rings: - fail_domains: - vdisk_locations: @@ -59,44 +68,50 @@ blob_storage_config: pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 2 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 3 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 4 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 5 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: 6 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: 7 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: 8 + - node_id: 3 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:1 channel_profile_config: profile: - channel: - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd profile_id: 0 grpc_config: diff --git a/e2e/tests/data/storage-block-4-2-dynconfig.yaml b/e2e/tests/data/storage-mirror-3-dc-dynconfig.yaml similarity index 60% rename from e2e/tests/data/storage-block-4-2-dynconfig.yaml rename to e2e/tests/data/storage-mirror-3-dc-dynconfig.yaml index d45e523c..f4f7c06f 100644 --- a/e2e/tests/data/storage-block-4-2-dynconfig.yaml +++ b/e2e/tests/data/storage-mirror-3-dc-dynconfig.yaml @@ -6,11 +6,15 @@ allowed_labels: {} selector_config: [] config: yaml_config_enabled: true - static_erasure: block-4-2 + static_erasure: mirror-3-dc host_configs: - drive: - path: SectorMap:1:1 type: SSD + - path: SectorMap:2:1 + type: SSD + - path: SectorMap:3:1 + type: SSD host_config_id: 1 domains_config: domain: @@ -19,16 +23,21 @@ config: - kind: ssd pool_config: box_id: 1 - erasure_species: block-4-2 + erasure_species: mirror-3-dc kind: ssd + geometry: + realm_level_begin: 10 + realm_level_end: 20 + domain_level_begin: 10 + domain_level_end: 256 pdisk_filter: - property: - - type: SSD + - type: SSD # device type to match host_configs.drive.type vdisk_kind: Default state_storage: - ring: - node: [1, 2, 3, 4, 5, 6, 7, 8] - nto_select: 5 + node: [1, 2, 3] + nto_select: 3 ssid: 1 table_service_config: sql_version: 1 @@ -56,55 +65,61 @@ config: progress_threshold: 10000 resolution: 256 spin_threshold: 0 - blob_storage_config: + blob_storage_config: # configuration of static blobstorage group. service_set: groups: - - erasure_species: block-4-2 + - erasure_species: mirror-3-dc rings: - fail_domains: - vdisk_locations: - - node_id: storage-0 + - node_id: 1 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-1 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: storage-2 + - node_id: 1 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: storage-3 + - node_id: 2 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-4 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 - vdisk_locations: - - node_id: storage-5 + - node_id: 2 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:3:1 + - fail_domains: - vdisk_locations: - - node_id: storage-6 + - node_id: 3 pdisk_category: SSD path: SectorMap:1:1 - vdisk_locations: - - node_id: storage-7 + - node_id: 3 pdisk_category: SSD - path: SectorMap:1:1 + path: SectorMap:2:1 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:1 channel_profile_config: profile: - channel: - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: block-4-2 - pdisk_category: 1 + - erasure_species: mirror-3-dc + pdisk_category: 0 storage_pool_kind: ssd profile_id: 0 grpc_config: diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index 0af88c3a..c0ac3c29 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -37,7 +37,7 @@ import ( const ( Timeout = time.Second * 600 - Interval = time.Second * 5 + Interval = time.Second * 2 ) func podIsReady(conditions []corev1.PodCondition) bool { @@ -143,7 +143,7 @@ func checkPodsRunningAndReady(ctx context.Context, podLabelKey, podLabelValue st g.Expect(podIsReady(pod.Status.Conditions)).Should(BeTrue()) } return true - }, 30*time.Second, Interval).Should(BeTrue()) + }, test.Timeout, test.Interval).Should(BeTrue()) } func bringYdbCliToPod(podName, podNamespace string) { @@ -152,6 +152,7 @@ func bringYdbCliToPod(podName, podNamespace string) { "-n", podNamespace, "cp", + // This implicitly relies on 'ydb' cli binary installed in your system fmt.Sprintf("%v/ydb/bin/ydb", os.ExpandEnv("$HOME")), fmt.Sprintf("%v:/tmp/ydb", podName), } @@ -248,7 +249,7 @@ func portForward(ctx context.Context, svcName string, svcNamespace string, port return fmt.Errorf("kubectl port-forward stderr: %s", content) } return nil - }, 60*time.Second, Interval).Should(BeNil()) + }, Timeout, test.Interval).Should(BeNil()) } var _ = Describe("Operator smoke test", func() { @@ -259,7 +260,7 @@ var _ = Describe("Operator smoke test", func() { var databaseSample *v1alpha1.Database BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config.yaml")) databaseSample = testobjects.DefaultDatabase() ctx = context.Background() @@ -431,7 +432,7 @@ var _ = Describe("Operator smoke test", func() { })).Should(Succeed()) return len(storagePods.Items) == int(storageSample.Spec.Nodes) - }, 20*time.Second, Interval).Should(BeTrue()) + }, test.Timeout, test.Interval).Should(BeTrue()) By("deleting a StatefulSet...") statefulSet := v1.StatefulSet{} @@ -458,7 +459,7 @@ var _ = Describe("Operator smoke test", func() { })).Should(Succeed()) return len(storagePods.Items) == 0 - }, 20*time.Second, Interval).Should(BeTrue()) + }, test.Timeout, test.Interval).Should(BeTrue()) By("setting storage freeze back to Running...") storage = v1alpha1.Storage{} @@ -493,19 +494,19 @@ var _ = Describe("Operator smoke test", func() { It("create storage and database with nodeSets", func() { By("issuing create commands...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-config-nodeSets.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-nodeSets.yaml")) testNodeSetName := "nodeset" - for idx := 1; idx <= 2; idx++ { + for idx := 1; idx <= 3; idx++ { storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ Name: testNodeSetName + "-" + strconv.Itoa(idx), StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ Name: testNodeSetName + "-" + strconv.Itoa(idx), DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) } @@ -532,18 +533,24 @@ var _ = Describe("Operator smoke test", func() { database := v1alpha1.Database{} databasePods := corev1.PodList{} - By("delete nodeSetSpec inline to check inheritance...") + By("modify nodeSetSpec inline to check inheritance...") Eventually(func(g Gomega) error { g.Expect(k8sClient.Get(ctx, types.NamespacedName{ Name: databaseSample.Name, Namespace: testobjects.YdbNamespace, }, &database)).Should(Succeed()) - database.Spec.Nodes = 4 + database.Spec.Nodes = 2 database.Spec.NodeSets = []v1alpha1.DatabaseNodeSetSpecInline{ { Name: testNodeSetName + "-" + strconv.Itoa(1), DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, + }, + }, + { + Name: testNodeSetName + "-" + strconv.Itoa(2), + DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ + Nodes: 1, }, }, } @@ -578,7 +585,7 @@ var _ = Describe("Operator smoke test", func() { It("operatorConnection check, create storage with default staticCredentials", func() { By("issuing create commands...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-config-staticCreds.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-staticCreds.yaml")) storageSample.Spec.OperatorConnection = &v1alpha1.ConnectionOptions{ StaticCredentials: &v1alpha1.StaticCredentialsAuth{ Username: "root", @@ -639,7 +646,7 @@ var _ = Describe("Operator smoke test", func() { }() By("create storage...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-config-tls.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-tls.yaml")) storageSample.Spec.Service.GRPC.TLSConfiguration.Enabled = true storageSample.Spec.Service.GRPC.TLSConfiguration.Certificate = corev1.SecretKeySelector{ LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, @@ -738,7 +745,7 @@ var _ = Describe("Operator smoke test", func() { return false } return !foundStorage.DeletionTimestamp.IsZero() - }, test.Timeout, test.Interval).Should(BeTrue()) + }, Timeout, test.Interval).Should(BeTrue()) By("checking that Storage is present in cluster...") Consistently(func() error { @@ -761,12 +768,12 @@ var _ = Describe("Operator smoke test", func() { Namespace: testobjects.YdbNamespace, }, &foundStorage) return apierrors.IsNotFound(err) - }, test.Timeout, test.Interval).Should(BeTrue()) + }, Timeout, test.Interval).Should(BeTrue()) }) It("check storage with dynconfig", func() { By("create storage...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-block-4-2-dynconfig.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-dynconfig.yaml")) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) defer func() { @@ -839,7 +846,7 @@ var _ = Describe("Operator smoke test", func() { transport := &http.Transport{TLSClientConfig: tlsConfig} client := &http.Client{ Transport: transport, - Timeout: 10 * time.Second, + Timeout: test.Timeout, } resp, err := client.Get(url) if err != nil { diff --git a/e2e/tests/test-objects/objects.go b/e2e/tests/test-objects/objects.go index 17d30094..c369d4cc 100644 --- a/e2e/tests/test-objects/objects.go +++ b/e2e/tests/test-objects/objects.go @@ -11,7 +11,7 @@ import ( ) const ( - YdbImage = "cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17" + YdbImage = "cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7" // anchor_for_fetching_image_from_workflow YdbNamespace = "ydb" StorageName = "storage" DatabaseName = "database" @@ -59,7 +59,7 @@ func DefaultStorage(storageYamlConfigPath string) *v1alpha1.Storage { StorageClusterSpec: v1alpha1.StorageClusterSpec{ Domain: DefaultDomain, OperatorSync: true, - Erasure: "block-4-2", + Erasure: "mirror-3-dc", Image: &v1alpha1.PodImage{ Name: YdbImage, PullPolicyName: &defaultPolicy, @@ -90,7 +90,7 @@ func DefaultStorage(storageYamlConfigPath string) *v1alpha1.Storage { }, }, StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 8, + Nodes: 3, DataStore: []corev1.PersistentVolumeClaimSpec{}, Resources: &corev1.ResourceRequirements{}, @@ -156,7 +156,7 @@ func DefaultDatabase() *v1alpha1.Database { }, }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 8, + Nodes: 3, Resources: &v1alpha1.DatabaseResources{ StorageUnits: []v1alpha1.StorageUnit{ { diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index ff70c105..15333aec 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -62,7 +62,7 @@ var _ = Describe("Database controller medium tests", func() { }, } Expect(k8sClient.Create(ctx, &namespace)).Should(Succeed()) - storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, &storageSample)).Should(Succeed()) By("checking that Storage created on local cluster...") diff --git a/internal/controllers/databasenodeset/controller_test.go b/internal/controllers/databasenodeset/controller_test.go index 819c7ba6..47beb813 100644 --- a/internal/controllers/databasenodeset/controller_test.go +++ b/internal/controllers/databasenodeset/controller_test.go @@ -71,7 +71,7 @@ var _ = Describe("DatabaseNodeSet controller medium tests", func() { } Expect(k8sClient.Create(ctx, &namespace)).Should(Succeed()) - storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, &storageSample)).Should(Succeed()) By("checking that Storage created on local cluster...") @@ -103,7 +103,7 @@ var _ = Describe("DatabaseNodeSet controller medium tests", func() { databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ Name: testNodeSetName, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) @@ -160,7 +160,7 @@ var _ = Describe("DatabaseNodeSet controller medium tests", func() { testNodeSetLabel: "true", }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 2, + Nodes: 1, }, }) @@ -170,7 +170,7 @@ var _ = Describe("DatabaseNodeSet controller medium tests", func() { v1alpha1.AnnotationDataCenter: "envtest", }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 2, + Nodes: 1, }, }) diff --git a/internal/controllers/monitoring/monitoring_test.go b/internal/controllers/monitoring/monitoring_test.go index edc049e0..5a31d55c 100644 --- a/internal/controllers/monitoring/monitoring_test.go +++ b/internal/controllers/monitoring/monitoring_test.go @@ -119,7 +119,7 @@ func createMockDBAndSvc() { func createMockStorageAndSvc() { GinkgoHelper() - stor := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + stor := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, stor)).Should(Succeed()) stor.Status.State = StorageReady diff --git a/internal/controllers/remotedatabasenodeset/controller_test.go b/internal/controllers/remotedatabasenodeset/controller_test.go index 2e7ca0a8..c401b4f9 100644 --- a/internal/controllers/remotedatabasenodeset/controller_test.go +++ b/internal/controllers/remotedatabasenodeset/controller_test.go @@ -206,12 +206,12 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { var databaseSample *v1alpha1.Database BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) databaseSample = testobjects.DefaultDatabase() databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ Name: testNodeSetName + "-local", DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ @@ -220,7 +220,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { Cluster: testRemoteCluster, }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ @@ -229,7 +229,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { Cluster: testRemoteCluster, }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) @@ -445,7 +445,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { Cluster: testRemoteCluster, }, StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) @@ -570,7 +570,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { { Name: testNodeSetName + "-local", DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 2, }, }, { @@ -579,7 +579,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { Cluster: testRemoteCluster, }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }, } @@ -823,7 +823,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { { Name: testNodeSetName + "-local", DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 2, }, }, { @@ -832,7 +832,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { Cluster: testRemoteCluster, }, DatabaseNodeSpec: v1alpha1.DatabaseNodeSpec{ - Nodes: 4, + Nodes: 1, }, }, } diff --git a/internal/controllers/remotestoragenodeset/controller_test.go b/internal/controllers/remotestoragenodeset/controller_test.go index 28882efe..e1195aff 100644 --- a/internal/controllers/remotestoragenodeset/controller_test.go +++ b/internal/controllers/remotestoragenodeset/controller_test.go @@ -179,11 +179,11 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { var storageSample *v1alpha1.Storage BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ Name: testNodeSetName + "-local", StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 4, + Nodes: 1, }, }) storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ @@ -192,7 +192,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { Cluster: testRemoteCluster, }, StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 2, + Nodes: 1, }, }) storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ @@ -201,7 +201,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { Cluster: testRemoteCluster, }, StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 2, + Nodes: 1, }, }) @@ -569,7 +569,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { { Name: testNodeSetName + "-local", StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 6, + Nodes: 2, }, }, { @@ -578,7 +578,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { Cluster: testRemoteCluster, }, StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 2, + Nodes: 1, }, }, } diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index fb364be3..ded230bb 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -62,7 +62,7 @@ var _ = Describe("Storage controller medium tests", func() { }) It("Checking field propagation to objects", func() { - storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) tmpFilesDir := "/tmp/mounted_volume" testVolumeName := "sample-volume" diff --git a/internal/controllers/storagenodeset/controller_test.go b/internal/controllers/storagenodeset/controller_test.go index 230fc2f0..c93149e6 100644 --- a/internal/controllers/storagenodeset/controller_test.go +++ b/internal/controllers/storagenodeset/controller_test.go @@ -62,15 +62,16 @@ var _ = Describe("StorageNodeSet controller medium tests", func() { }) It("Check controller operation through nodeSetSpec inline spec in Storage object", func() { - storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-block-4-2-config.yaml")) + storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) // Test create inline nodeSetSpec in Storage object testNodeSetName := "nodeset" - for idx := 1; idx <= 4; idx++ { + storageNodeSetAmount := 3 + for idx := 1; idx <= storageNodeSetAmount; idx++ { storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ Name: testNodeSetName + "-" + strconv.Itoa(idx), StorageNodeSpec: v1alpha1.StorageNodeSpec{ - Nodes: 2, + Nodes: 1, }, }) } @@ -84,14 +85,14 @@ var _ = Describe("StorageNodeSet controller medium tests", func() { ))).Should(Succeed()) foundStorageNodeSet := make(map[int]bool) for _, storageNodeSet := range storageNodeSets.Items { - for idxNodeSet := 1; idxNodeSet <= 4; idxNodeSet++ { + for idxNodeSet := 1; idxNodeSet <= storageNodeSetAmount; idxNodeSet++ { if storageNodeSet.Name == testobjects.StorageName+"-"+testNodeSetName+"-"+strconv.Itoa(idxNodeSet) { foundStorageNodeSet[idxNodeSet] = true break } } } - for idxNodeSet := 1; idxNodeSet <= 4; idxNodeSet++ { + for idxNodeSet := 1; idxNodeSet <= storageNodeSetAmount; idxNodeSet++ { if !foundStorageNodeSet[idxNodeSet] { return false } @@ -107,14 +108,14 @@ var _ = Describe("StorageNodeSet controller medium tests", func() { ))).Should(Succeed()) foundStatefulSet := make(map[int]bool) for _, statefulSet := range storageStatefulSets.Items { - for idxNodeSet := 1; idxNodeSet <= 4; idxNodeSet++ { + for idxNodeSet := 1; idxNodeSet <= storageNodeSetAmount; idxNodeSet++ { if statefulSet.Name == testobjects.StorageName+"-"+testNodeSetName+"-"+strconv.Itoa(idxNodeSet) { foundStatefulSet[idxNodeSet] = true break } } } - for idxNodeSet := 1; idxNodeSet <= 4; idxNodeSet++ { + for idxNodeSet := 1; idxNodeSet <= storageNodeSetAmount; idxNodeSet++ { if !foundStatefulSet[idxNodeSet] { return false } diff --git a/samples/minikube/database.yaml b/samples/minikube/database.yaml index 0eab7436..af2c61f1 100644 --- a/samples/minikube/database.yaml +++ b/samples/minikube/database.yaml @@ -4,7 +4,7 @@ metadata: name: database-minikube-sample spec: image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 nodes: 1 domain: Root service: diff --git a/samples/minikube/storage.yaml b/samples/minikube/storage.yaml index 43d2db5a..0c407115 100644 --- a/samples/minikube/storage.yaml +++ b/samples/minikube/storage.yaml @@ -5,7 +5,7 @@ metadata: spec: dataStore: [] image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 nodes: 1 domain: Root erasure: none diff --git a/samples/storage-mirror-3dc.yaml b/samples/storage-mirror-3dc.yaml index 7b1d42d3..b4d0801a 100644 --- a/samples/storage-mirror-3dc.yaml +++ b/samples/storage-mirror-3dc.yaml @@ -11,7 +11,7 @@ spec: requests: storage: 80Gi image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:23.3.17 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 nodes: 9 erasure: mirror-3-dc configuration: |- From 170361a1f63751d1fadfacc5865e0f60167969f7 Mon Sep 17 00:00:00 2001 From: kobzonega Date: Wed, 2 Oct 2024 12:59:10 +0700 Subject: [PATCH 31/70] fix dynconfig with nodeSets panic error (#252) --- api/v1alpha1/storage_webhook.go | 13 +- deploy/ydb-operator/Chart.yaml | 4 +- .../storage-mirror-3-dc-config-nodeSets.yaml | 118 ------------------ e2e/tests/smoke_test.go | 55 +++++--- 4 files changed, 53 insertions(+), 137 deletions(-) delete mode 100644 e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 3a4119f3..425f6c03 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -63,10 +63,17 @@ func (r *Storage) GetGRPCServiceEndpoint() string { } func (r *Storage) GetHostFromConfigEndpoint() string { - var configuration schema.Configuration - + var rawYamlConfiguration string // skip handle error because we already checked in webhook - configuration, _ = ParseConfiguration(r.Spec.Configuration) + success, dynConfig, _ := ParseDynConfig(r.Spec.Configuration) + if success { + config, _ := yaml.Marshal(dynConfig.Config) + rawYamlConfiguration = string(config) + } else { + rawYamlConfiguration = r.Spec.Configuration + } + + configuration, _ := ParseConfiguration(rawYamlConfiguration) randNum := rand.Intn(len(configuration.Hosts)) // #nosec G404 return fmt.Sprintf("%s:%d", configuration.Hosts[randNum].Host, GRPCPort) } diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 8c23d714..95ef2f11 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.26 +version: 0.5.27 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.26" +appVersion: "0.5.27" diff --git a/e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml b/e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml deleted file mode 100644 index 0384fb6b..00000000 --- a/e2e/tests/data/storage-mirror-3-dc-config-nodeSets.yaml +++ /dev/null @@ -1,118 +0,0 @@ -static_erasure: mirror-3-dc -host_configs: - - drive: - - path: SectorMap:1:1 - type: SSD - - path: SectorMap:2:1 - type: SSD - - path: SectorMap:3:1 - type: SSD - host_config_id: 1 -domains_config: - domain: - - name: Root - storage_pool_types: - - kind: ssd - pool_config: - box_id: 1 - erasure_species: mirror-3-dc - kind: ssd - geometry: - realm_level_begin: 10 - realm_level_end: 20 - domain_level_begin: 10 - domain_level_end: 256 - pdisk_filter: - - property: - - type: SSD # device type to match host_configs.drive.type - vdisk_kind: Default - state_storage: - - ring: - node: [1, 2, 3] - nto_select: 3 - ssid: 1 -table_service_config: - sql_version: 1 -actor_system_config: - executor: - - name: System - threads: 1 - type: BASIC - - name: User - threads: 1 - type: BASIC - - name: Batch - threads: 1 - type: BASIC - - name: IO - threads: 1 - time_per_mailbox_micro_secs: 100 - type: IO - - name: IC - spin_threshold: 10 - threads: 4 - time_per_mailbox_micro_secs: 100 - type: BASIC - scheduler: - progress_threshold: 10000 - resolution: 256 - spin_threshold: 0 -blob_storage_config: # configuration of static blobstorage group. - service_set: - groups: - - erasure_species: mirror-3-dc - rings: - - fail_domains: - - vdisk_locations: - - node_id: 1 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 1 - pdisk_category: SSD - path: SectorMap:2:1 - - vdisk_locations: - - node_id: 1 - pdisk_category: SSD - path: SectorMap:3:1 - - fail_domains: - - vdisk_locations: - - node_id: 2 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 2 - pdisk_category: SSD - path: SectorMap:2:1 - - vdisk_locations: - - node_id: 2 - pdisk_category: SSD - path: SectorMap:3:1 - - fail_domains: - - vdisk_locations: - - node_id: 3 - pdisk_category: SSD - path: SectorMap:1:1 - - vdisk_locations: - - node_id: 3 - pdisk_category: SSD - path: SectorMap:2:1 - - vdisk_locations: - - node_id: 3 - pdisk_category: SSD - path: SectorMap:3:1 -channel_profile_config: - profile: - - channel: - - erasure_species: mirror-3-dc - pdisk_category: 0 - storage_pool_kind: ssd - - erasure_species: mirror-3-dc - pdisk_category: 0 - storage_pool_kind: ssd - - erasure_species: mirror-3-dc - pdisk_category: 0 - storage_pool_kind: ssd - profile_id: 0 -grpc_config: - port: 2135 diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index c0ac3c29..f612a4b2 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -252,6 +252,25 @@ func portForward(ctx context.Context, svcName string, svcNamespace string, port }, Timeout, test.Interval).Should(BeNil()) } +func emptyStorageDefaultFields(storage *v1alpha1.Storage) { + storage.Spec.Image = nil + storage.Spec.Resources = nil + storage.Spec.Service = nil + storage.Spec.Monitoring = nil +} + +func emptyDatabaseDefaultFields(database *v1alpha1.Database) { + database.Spec.StorageClusterRef.Namespace = "" + database.Spec.Image = nil + database.Spec.Service = nil + database.Spec.Domain = "" + database.Spec.Path = "" + database.Spec.Encryption = nil + database.Spec.Datastreams = nil + database.Spec.Monitoring = nil + database.Spec.StorageEndpoint = "" +} + var _ = Describe("Operator smoke test", func() { var ctx context.Context var namespace corev1.Namespace @@ -284,30 +303,38 @@ var _ = Describe("Operator smoke test", func() { }) It("Check webhook defaulter", func() { - storageSample.Spec.Image = nil - storageSample.Spec.Resources = nil - storageSample.Spec.Service = nil - storageSample.Spec.Monitoring = nil + emptyStorageDefaultFields(storageSample) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) }() - databaseSample.Spec.StorageClusterRef.Namespace = "" - databaseSample.Spec.Image = nil - databaseSample.Spec.Service = nil - databaseSample.Spec.Domain = "" - databaseSample.Spec.Path = "" - databaseSample.Spec.Encryption = nil - databaseSample.Spec.Datastreams = nil - databaseSample.Spec.Monitoring = nil - databaseSample.Spec.StorageEndpoint = "" + emptyDatabaseDefaultFields(databaseSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() }) + It("Check webhook defaulter with dynconfig and nodeSets", func() { + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-dynconfig.yaml")) + emptyStorageDefaultFields(storageSample) + storageSample.Spec.NodeSets = []v1alpha1.StorageNodeSetSpecInline{ + { + Name: "storage-nodeset-1", + StorageNodeSpec: v1alpha1.StorageNodeSpec{Nodes: 1}, + }, + { + Name: "storage-nodeset-2", + StorageNodeSpec: v1alpha1.StorageNodeSpec{Nodes: 2}, + }, + } + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) + }() + }) + It("general smoke pipeline, create storage + database", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) @@ -494,7 +521,7 @@ var _ = Describe("Operator smoke test", func() { It("create storage and database with nodeSets", func() { By("issuing create commands...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-nodeSets.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config.yaml")) testNodeSetName := "nodeset" for idx := 1; idx <= 3; idx++ { storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ From 3404f2ba19b3a535c798dd92ab6d46574078d403 Mon Sep 17 00:00:00 2001 From: kobzonega Date: Thu, 3 Oct 2024 22:01:38 +0700 Subject: [PATCH 32/70] operatorToken field compatibility with disabled token requirement option (#251) --- api/v1alpha1/storage_webhook.go | 4 ++-- deploy/ydb-operator/Chart.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 425f6c03..353d9e2f 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -248,7 +248,7 @@ func (r *Storage) ValidateCreate() error { } } - if (authEnabled && r.Spec.OperatorConnection == nil) || (!authEnabled && r.Spec.OperatorConnection != nil) { + if authEnabled && r.Spec.OperatorConnection == nil { return fmt.Errorf("field 'spec.operatorConnection' does not satisfy with config option `enforce_user_token_requirement: %t`", authEnabled) } @@ -362,7 +362,7 @@ func (r *Storage) ValidateUpdate(old runtime.Object) error { } } - if (authEnabled && r.Spec.OperatorConnection == nil) || (!authEnabled && r.Spec.OperatorConnection != nil) { + if authEnabled && r.Spec.OperatorConnection == nil { return fmt.Errorf("field 'spec.operatorConnection' does not align with config option `enforce_user_token_requirement: %t`", authEnabled) } diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 95ef2f11..1213173b 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.27 +version: 0.5.28 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.27" +appVersion: "0.5.28" From fb2ebe48c985f128a9cc5a79f16891f113a2a08c Mon Sep 17 00:00:00 2001 From: nikita kozlovsky Date: Thu, 10 Oct 2024 11:05:36 +0200 Subject: [PATCH 33/70] add grpc ip discovery support (#253) --- api/v1alpha1/service_types.go | 7 ++ api/v1alpha1/zz_generated.deepcopy.go | 20 +++ deploy/ydb-operator/Chart.yaml | 4 +- deploy/ydb-operator/crds/database.yaml | 68 +++++----- deploy/ydb-operator/crds/databasenodeset.yaml | 64 ++++++---- .../crds/remotedatabasenodeset.yaml | 64 ++++++---- .../crds/remotestoragenodeset.yaml | 46 +++++-- deploy/ydb-operator/crds/storage.yaml | 55 +++++++-- deploy/ydb-operator/crds/storagenodeset.yaml | 46 +++++-- .../controllers/database/controller_test.go | 89 +++++++++++++- .../remotedatabasenodeset/controller_test.go | 112 +---------------- .../remotestoragenodeset/controller_test.go | 113 +---------------- internal/resources/database_statefulset.go | 50 ++++++-- internal/test/k8s_helpers.go | 116 +++++++++++++++++- 14 files changed, 509 insertions(+), 345 deletions(-) diff --git a/api/v1alpha1/service_types.go b/api/v1alpha1/service_types.go index 7eb2b35f..981cce60 100644 --- a/api/v1alpha1/service_types.go +++ b/api/v1alpha1/service_types.go @@ -22,6 +22,7 @@ type GRPCService struct { TLSConfiguration *TLSConfiguration `json:"tls,omitempty"` ExternalHost string `json:"externalHost,omitempty"` // TODO implementation + IPDiscovery *IPDiscovery `json:"ipDiscovery,omitempty"` } type InterconnectService struct { @@ -41,3 +42,9 @@ type DatastreamsService struct { TLSConfiguration *TLSConfiguration `json:"tls,omitempty"` } + +type IPDiscovery struct { + Enabled bool `json:"enabled"` + TargetNameOverride string `json:"targetNameOverride,omitempty"` + IPFamily corev1.IPFamily `json:"ipFamily,omitempty"` +} diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 61a3689f..fd2ad4a1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -680,6 +680,11 @@ func (in *GRPCService) DeepCopyInto(out *GRPCService) { *out = new(TLSConfiguration) (*in).DeepCopyInto(*out) } + if in.IPDiscovery != nil { + in, out := &in.IPDiscovery, &out.IPDiscovery + *out = new(IPDiscovery) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCService. @@ -692,6 +697,21 @@ func (in *GRPCService) DeepCopy() *GRPCService { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPDiscovery) DeepCopyInto(out *IPDiscovery) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPDiscovery. +func (in *IPDiscovery) DeepCopy() *IPDiscovery { + if in == nil { + return nil + } + out := new(IPDiscovery) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InterconnectService) DeepCopyInto(out *InterconnectService) { *out = *in diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 1213173b..75e65550 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.28 +version: 0.5.29 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.28" +appVersion: "0.5.29" diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index e0b1976e..1bee889b 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -886,24 +886,6 @@ spec: properties: enabled: type: boolean - iam_service_account_key: - description: SecretKeySelector selects a key of a Secret. - properties: - key: - description: The key of the secret to select from. Must be - a valid secret key. - 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 - optional: - description: Specify whether the Secret or its key must be - defined - type: boolean - required: - - key - type: object required: - enabled type: object @@ -1208,7 +1190,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1304,7 +1288,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1417,7 +1403,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1619,7 +1607,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1716,7 +1706,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2000,7 +1991,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -3204,7 +3197,7 @@ spec: in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field - is immutable." + is immutable. It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -3280,7 +3273,7 @@ spec: in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field - is immutable." + is immutable. It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -3614,7 +3607,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -3811,6 +3805,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -4072,7 +4080,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -4925,7 +4934,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index bbbc2cf7..74aebcac 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -901,24 +901,6 @@ spec: properties: enabled: type: boolean - iam_service_account_key: - description: SecretKeySelector selects a key of a Secret. - properties: - key: - description: The key of the secret to select from. Must be - a valid secret key. - 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 - optional: - description: Specify whether the Secret or its key must be - defined - type: boolean - required: - - key - type: object required: - enabled type: object @@ -1223,7 +1205,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1319,7 +1303,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1432,7 +1418,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1634,7 +1622,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1731,7 +1721,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2015,7 +2006,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -2319,7 +2312,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2516,6 +2510,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -2777,7 +2785,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -3630,7 +3639,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index 706fa1ef..bc84fb0f 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -902,24 +902,6 @@ spec: properties: enabled: type: boolean - iam_service_account_key: - description: SecretKeySelector selects a key of a Secret. - properties: - key: - description: The key of the secret to select from. Must be - a valid secret key. - 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 - optional: - description: Specify whether the Secret or its key must be - defined - type: boolean - required: - - key - type: object required: - enabled type: object @@ -1224,7 +1206,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1320,7 +1304,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1433,7 +1419,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1635,7 +1623,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1732,7 +1722,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2016,7 +2007,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -2320,7 +2313,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2517,6 +2511,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -2778,7 +2786,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -3631,7 +3640,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index e8053cc3..f514a2ac 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -986,7 +986,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -1373,7 +1374,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1469,7 +1472,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1582,7 +1587,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1784,7 +1791,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1881,7 +1890,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2165,7 +2175,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -2459,7 +2471,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be set + for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2527,6 +2540,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -3565,7 +3592,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index a7dc0b0c..9d0a1805 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -985,7 +985,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -1372,7 +1373,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1468,7 +1471,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1581,7 +1586,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1783,7 +1790,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1880,7 +1889,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2164,7 +2174,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -3253,7 +3265,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be + set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -4405,7 +4418,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - \n This field is immutable." + \n This field is immutable. It can only be set for + containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -4553,7 +4567,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -4960,7 +4975,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be set + for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -5028,6 +5044,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -6052,7 +6082,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index 0c797170..870a29d2 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -985,7 +985,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -1372,7 +1373,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1468,7 +1471,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1581,7 +1586,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1783,7 +1790,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -1880,7 +1889,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only + be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2164,7 +2174,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string value: description: The header field value @@ -2458,7 +2470,8 @@ spec: description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. It can only be set + for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: @@ -2526,6 +2539,20 @@ spec: type: object externalHost: type: string + ipDiscovery: + properties: + enabled: + type: boolean + ipFamily: + description: IPFamily represents the IP Family (IPv4 or + IPv6). This type is used to express the family of an + IP expressed by a type (e.g. service.spec.ipFamilies). + type: string + targetNameOverride: + type: string + required: + - enabled + type: object ipFamilies: items: description: IPFamily represents the IP Family (IPv4 or @@ -3564,7 +3591,8 @@ spec: defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." + feature gate. \n This field is immutable. + It can only be set for containers." items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index 15333aec..747d070c 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -17,6 +17,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" @@ -30,12 +31,13 @@ import ( var ( k8sClient client.Client ctx context.Context + env *envtest.Environment ) func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) - test.SetupK8STestManager(&ctx, &k8sClient, func(mgr *manager.Manager) []test.Reconciler { + env = test.SetupK8STestManager(&ctx, &k8sClient, func(mgr *manager.Manager) []test.Reconciler { return []test.Reconciler{ &storage.Reconciler{ Client: k8sClient, @@ -94,6 +96,7 @@ var _ = Describe("Database controller medium tests", func() { AfterEach(func() { Expect(k8sClient.Delete(ctx, &storageSample)).Should(Succeed()) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) + test.DeleteAllObjects(env, k8sClient, &namespace) }) It("Checking field propagation to objects", func() { @@ -217,4 +220,88 @@ var _ = Describe("Database controller medium tests", func() { return reflect.DeepEqual(encryptionData, encryptionSecret.Data) }, test.Timeout, test.Interval).Should(BeTrue()) }) + + It("Check iPDiscovery flag works", func() { + getDBSts := func(generation int64) appsv1.StatefulSet { + sts := appsv1.StatefulSet{} + + Eventually( + func() error { + objectKey := types.NamespacedName{ + Name: testobjects.DatabaseName, + Namespace: testobjects.YdbNamespace, + } + err := k8sClient.Get(ctx, objectKey, &sts) + if err != nil { + return err + } + + if sts.Generation <= generation { + return fmt.Errorf("sts is too old (generation=%d)", sts.Generation) + } + return nil + }, + ).WithTimeout(test.Timeout).WithPolling(test.Interval).Should(Succeed()) + + return sts + } + getDB := func() v1alpha1.Database { + found := v1alpha1.Database{} + Eventually(func() error { + return k8sClient.Get(ctx, + types.NamespacedName{ + Name: testobjects.DatabaseName, + Namespace: testobjects.YdbNamespace, + }, + &found, + ) + }, test.Timeout, test.Interval).Should(Succeed()) + return found + } + + By("Create test database") + db := *testobjects.DefaultDatabase() + Expect(k8sClient.Create(ctx, &db)).Should(Succeed()) + + By("Check container args") + sts := getDBSts(0) + args := sts.Spec.Template.Spec.Containers[0].Args + + Expect(args).To(ContainElements([]string{"--grpc-public-host"})) + Expect(args).ToNot(ContainElements([]string{"--grpc-public-address-v6", "--grpc-public-address-v4", "--grpc-public-target-name-override"})) + + By("Enabling ip discovery using ipv6") + db = getDB() + db.Spec.Service.GRPC.IPDiscovery = &v1alpha1.IPDiscovery{ + Enabled: true, + IPFamily: corev1.IPv6Protocol, + } + + Expect(k8sClient.Update(ctx, &db)).Should(Succeed()) + + By("Check container args") + sts = getDBSts(sts.Generation) + args = sts.Spec.Template.Spec.Containers[0].Args + + Expect(args).To(ContainElements([]string{"--grpc-public-address-v6"})) + Expect(args).ToNot(ContainElements([]string{"--grpc-public-target-name-override"})) + + db = getDB() + + By("Enabling ip discovery using ipv4 and target name override") + db.Spec.Service.GRPC.IPDiscovery = &v1alpha1.IPDiscovery{ + Enabled: true, + IPFamily: corev1.IPv4Protocol, + TargetNameOverride: "a.b.c.d", + } + + Expect(k8sClient.Update(ctx, &db)).Should(Succeed()) + + By("Check container args") + + sts = getDBSts(sts.Generation) + args = sts.Spec.Template.Spec.Containers[0].Args + + Expect(args).To(ContainElements([]string{"--grpc-public-address-v4", "--grpc-public-target-name-override"})) + }) }) diff --git a/internal/controllers/remotedatabasenodeset/controller_test.go b/internal/controllers/remotedatabasenodeset/controller_test.go index c401b4f9..25252795 100644 --- a/internal/controllers/remotedatabasenodeset/controller_test.go +++ b/internal/controllers/remotedatabasenodeset/controller_test.go @@ -14,10 +14,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" "k8s.io/kubectl/pkg/scheme" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" @@ -349,8 +346,8 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { AfterEach(func() { Expect(localClient.Delete(ctx, databaseSample)).Should(Succeed()) Expect(localClient.Delete(ctx, storageSample)).Should(Succeed()) - deleteAll(localEnv, localClient, &localNamespace) - deleteAll(remoteEnv, remoteClient, &localNamespace) + test.DeleteAllObjects(localEnv, localClient, &localNamespace) + test.DeleteAllObjects(remoteEnv, remoteClient, &localNamespace) }) When("Created RemoteDatabaseNodeSet in k8s-mgmt-cluster", func() { @@ -892,108 +889,3 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { }) }) }) - -func deleteAll(env *envtest.Environment, k8sClient client.Client, objs ...client.Object) { - for _, obj := range objs { - ctx := context.Background() - clientGo, err := kubernetes.NewForConfig(env.Config) - Expect(err).ShouldNot(HaveOccurred()) - Expect(client.IgnoreNotFound(k8sClient.Delete(ctx, obj))).Should(Succeed()) - - //nolint:nestif - if ns, ok := obj.(*corev1.Namespace); ok { - // Normally the kube-controller-manager would handle finalization - // and garbage collection of namespaces, but with envtest, we aren't - // running a kube-controller-manager. Instead we're gonna approximate - // (poorly) the kube-controller-manager by explicitly deleting some - // resources within the namespace and then removing the `kubernetes` - // finalizer from the namespace resource so it can finish deleting. - // Note that any resources within the namespace that we don't - // successfully delete could reappear if the namespace is ever - // recreated with the same name. - - // Look up all namespaced resources under the discovery API - _, apiResources, err := clientGo.Discovery().ServerGroupsAndResources() - Expect(err).ShouldNot(HaveOccurred()) - namespacedGVKs := make(map[string]schema.GroupVersionKind) - for _, apiResourceList := range apiResources { - defaultGV, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) - Expect(err).ShouldNot(HaveOccurred()) - for _, r := range apiResourceList.APIResources { - if !r.Namespaced || strings.Contains(r.Name, "/") { - // skip non-namespaced and subresources - continue - } - gvk := schema.GroupVersionKind{ - Group: defaultGV.Group, - Version: defaultGV.Version, - Kind: r.Kind, - } - if r.Group != "" { - gvk.Group = r.Group - } - if r.Version != "" { - gvk.Version = r.Version - } - namespacedGVKs[gvk.String()] = gvk - } - } - - // Delete all namespaced resources in this namespace - for _, gvk := range namespacedGVKs { - var u unstructured.Unstructured - u.SetGroupVersionKind(gvk) - err := k8sClient.DeleteAllOf(ctx, &u, client.InNamespace(ns.Name)) - Expect(client.IgnoreNotFound(ignoreMethodNotAllowed(err))).ShouldNot(HaveOccurred()) - } - - // Delete all Services in this namespace - serviceList := corev1.ServiceList{} - err = k8sClient.List(ctx, &serviceList, client.InNamespace(ns.Name)) - Expect(err).ShouldNot(HaveOccurred()) - for idx := range serviceList.Items { - policy := metav1.DeletePropagationForeground - err = k8sClient.Delete(ctx, &serviceList.Items[idx], &client.DeleteOptions{PropagationPolicy: &policy}) - Expect(err).ShouldNot(HaveOccurred()) - } - - Eventually(func() error { - key := client.ObjectKeyFromObject(ns) - if err := k8sClient.Get(ctx, key, ns); err != nil { - return client.IgnoreNotFound(err) - } - // remove `kubernetes` finalizer - const kubernetes = "kubernetes" - finalizers := []corev1.FinalizerName{} - for _, f := range ns.Spec.Finalizers { - if f != kubernetes { - finalizers = append(finalizers, f) - } - } - ns.Spec.Finalizers = finalizers - - // We have to use the k8s.io/client-go library here to expose - // ability to patch the /finalize subresource on the namespace - _, err = clientGo.CoreV1().Namespaces().Finalize(ctx, ns, metav1.UpdateOptions{}) - return err - }, test.Timeout, test.Interval).Should(Succeed()) - } - - Eventually(func() metav1.StatusReason { - key := client.ObjectKeyFromObject(obj) - if err := k8sClient.Get(ctx, key, obj); err != nil { - return apierrors.ReasonForError(err) - } - return "" - }, test.Timeout, test.Interval).Should(Equal(metav1.StatusReasonNotFound)) - } -} - -func ignoreMethodNotAllowed(err error) error { - if err != nil { - if apierrors.ReasonForError(err) == metav1.StatusReasonMethodNotAllowed { - return nil - } - } - return err -} diff --git a/internal/controllers/remotestoragenodeset/controller_test.go b/internal/controllers/remotestoragenodeset/controller_test.go index e1195aff..0c5666c6 100644 --- a/internal/controllers/remotestoragenodeset/controller_test.go +++ b/internal/controllers/remotestoragenodeset/controller_test.go @@ -5,7 +5,6 @@ import ( "fmt" "path/filepath" "reflect" - "strings" "testing" . "github.com/onsi/ginkgo/v2" @@ -14,10 +13,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" "k8s.io/kubectl/pkg/scheme" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" @@ -280,8 +276,8 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { AfterEach(func() { Expect(localClient.Delete(ctx, storageSample)).Should(Succeed()) - deleteAll(localEnv, localClient, &localNamespace) - deleteAll(remoteEnv, remoteClient, &localNamespace) + test.DeleteAllObjects(localEnv, localClient, &localNamespace) + test.DeleteAllObjects(remoteEnv, remoteClient, &localNamespace) }) When("Created RemoteStorageNodeSet in k8s-mgmt-cluster", func() { @@ -635,108 +631,3 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { }) }) }) - -func deleteAll(env *envtest.Environment, k8sClient client.Client, objs ...client.Object) { - for _, obj := range objs { - ctx := context.Background() - clientGo, err := kubernetes.NewForConfig(env.Config) - Expect(err).ShouldNot(HaveOccurred()) - Expect(client.IgnoreNotFound(k8sClient.Delete(ctx, obj))).Should(Succeed()) - - //nolint:nestif - if ns, ok := obj.(*corev1.Namespace); ok { - // Normally the kube-controller-manager would handle finalization - // and garbage collection of namespaces, but with envtest, we aren't - // running a kube-controller-manager. Instead we're gonna approximate - // (poorly) the kube-controller-manager by explicitly deleting some - // resources within the namespace and then removing the `kubernetes` - // finalizer from the namespace resource so it can finish deleting. - // Note that any resources within the namespace that we don't - // successfully delete could reappear if the namespace is ever - // recreated with the same name. - - // Look up all namespaced resources under the discovery API - _, apiResources, err := clientGo.Discovery().ServerGroupsAndResources() - Expect(err).ShouldNot(HaveOccurred()) - namespacedGVKs := make(map[string]schema.GroupVersionKind) - for _, apiResourceList := range apiResources { - defaultGV, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) - Expect(err).ShouldNot(HaveOccurred()) - for _, r := range apiResourceList.APIResources { - if !r.Namespaced || strings.Contains(r.Name, "/") { - // skip non-namespaced and subresources - continue - } - gvk := schema.GroupVersionKind{ - Group: defaultGV.Group, - Version: defaultGV.Version, - Kind: r.Kind, - } - if r.Group != "" { - gvk.Group = r.Group - } - if r.Version != "" { - gvk.Version = r.Version - } - namespacedGVKs[gvk.String()] = gvk - } - } - - // Delete all namespaced resources in this namespace - for _, gvk := range namespacedGVKs { - var u unstructured.Unstructured - u.SetGroupVersionKind(gvk) - err := k8sClient.DeleteAllOf(ctx, &u, client.InNamespace(ns.Name)) - Expect(client.IgnoreNotFound(ignoreMethodNotAllowed(err))).ShouldNot(HaveOccurred()) - } - - // Delete all Services in this namespace - serviceList := corev1.ServiceList{} - err = k8sClient.List(ctx, &serviceList, client.InNamespace(ns.Name)) - Expect(err).ShouldNot(HaveOccurred()) - for idx := range serviceList.Items { - policy := metav1.DeletePropagationForeground - err = k8sClient.Delete(ctx, &serviceList.Items[idx], &client.DeleteOptions{PropagationPolicy: &policy}) - Expect(err).ShouldNot(HaveOccurred()) - } - - Eventually(func() error { - key := client.ObjectKeyFromObject(ns) - if err := k8sClient.Get(ctx, key, ns); err != nil { - return client.IgnoreNotFound(err) - } - // remove `kubernetes` finalizer - const kubernetes = "kubernetes" - finalizers := []corev1.FinalizerName{} - for _, f := range ns.Spec.Finalizers { - if f != kubernetes { - finalizers = append(finalizers, f) - } - } - ns.Spec.Finalizers = finalizers - - // We have to use the k8s.io/client-go library here to expose - // ability to patch the /finalize subresource on the namespace - _, err = clientGo.CoreV1().Namespaces().Finalize(ctx, ns, metav1.UpdateOptions{}) - return err - }, test.Timeout, test.Interval).Should(Succeed()) - } - - Eventually(func() metav1.StatusReason { - key := client.ObjectKeyFromObject(obj) - if err := k8sClient.Get(ctx, key, obj); err != nil { - return apierrors.ReasonForError(err) - } - return "" - }, test.Timeout, test.Interval).Should(Equal(metav1.StatusReasonNotFound)) - } -} - -func ignoreMethodNotAllowed(err error) error { - if err != nil { - if apierrors.ReasonForError(err) == metav1.StatusReasonMethodNotAllowed { - return nil - } - } - return err -} diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 6c4e3fe4..5d9c63c9 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -75,15 +75,26 @@ func (b *DatabaseStatefulSetBuilder) Build(obj client.Object) error { func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar { var envVars []corev1.EnvVar - envVars = append(envVars, corev1.EnvVar{ - Name: "NODE_NAME", // for `--grpc-public-host` flag - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{ - APIVersion: "v1", - FieldPath: "metadata.name", + envVars = append(envVars, + corev1.EnvVar{ + Name: "NODE_NAME", // for `--grpc-public-host` flag + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ + APIVersion: "v1", + FieldPath: "metadata.name", + }, }, }, - }) + corev1.EnvVar{ + Name: "POD_IP", // for `--grpc-public-address-` flag + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ + APIVersion: "v1", + FieldPath: "status.podIP", + }, + }, + }, + ) return envVars } @@ -623,12 +634,37 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { publicHostOption := "--grpc-public-host" publicHost := fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Database.Name, b.GetNamespace()) // FIXME .svc.cluster.local + if b.Spec.Service.GRPC.ExternalHost != "" { publicHost = b.Spec.Service.GRPC.ExternalHost } if value, ok := b.ObjectMeta.Annotations[api.AnnotationGRPCPublicHost]; ok { publicHost = value } + + if b.Spec.Service.GRPC.IPDiscovery != nil && b.Spec.Service.GRPC.IPDiscovery.Enabled { + targetNameOverride := b.Spec.Service.GRPC.IPDiscovery.TargetNameOverride + ipFamilyArg := "--grpc-public-address-v4" + + if b.Spec.Service.GRPC.IPDiscovery.IPFamily == corev1.IPv6Protocol { + ipFamilyArg = "--grpc-public-address-v6" + } + + args = append( + args, + + ipFamilyArg, + "$(POD_IP)", + ) + if targetNameOverride != "" { + args = append( + args, + "--grpc-public-target-name-override", + fmt.Sprintf("%s.%s", "$(NODE_NAME)", targetNameOverride), + ) + } + } + publicPortOption := "--grpc-public-port" publicPort := api.GRPCPort diff --git a/internal/test/k8s_helpers.go b/internal/test/k8s_helpers.go index a574dd9e..b135bd05 100644 --- a/internal/test/k8s_helpers.go +++ b/internal/test/k8s_helpers.go @@ -4,11 +4,18 @@ import ( "context" "path/filepath" "runtime" + "strings" "time" . "github.com/onsi/ginkgo/v2" //nolint:revive,stylecheck . "github.com/onsi/gomega" //nolint:revive,stylecheck monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/kubernetes" "k8s.io/kubectl/pkg/scheme" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -29,7 +36,112 @@ type Reconciler interface { SetupWithManager(manager ctrl.Manager) error } -func SetupK8STestManager(testCtx *context.Context, k8sClient *client.Client, controllers func(mgr *manager.Manager) []Reconciler) { +func DeleteAllObjects(env *envtest.Environment, k8sClient client.Client, objs ...client.Object) { + for _, obj := range objs { + ctx := context.Background() + clientGo, err := kubernetes.NewForConfig(env.Config) + Expect(err).ShouldNot(HaveOccurred()) + Expect(client.IgnoreNotFound(k8sClient.Delete(ctx, obj))).Should(Succeed()) + + //nolint:nestif + if ns, ok := obj.(*corev1.Namespace); ok { + // Normally the kube-controller-manager would handle finalization + // and garbage collection of namespaces, but with envtest, we aren't + // running a kube-controller-manager. Instead we're gonna approximate + // (poorly) the kube-controller-manager by explicitly deleting some + // resources within the namespace and then removing the `kubernetes` + // finalizer from the namespace resource so it can finish deleting. + // Note that any resources within the namespace that we don't + // successfully delete could reappear if the namespace is ever + // recreated with the same name. + + // Look up all namespaced resources under the discovery API + _, apiResources, err := clientGo.Discovery().ServerGroupsAndResources() + Expect(err).ShouldNot(HaveOccurred()) + namespacedGVKs := make(map[string]schema.GroupVersionKind) + for _, apiResourceList := range apiResources { + defaultGV, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) + Expect(err).ShouldNot(HaveOccurred()) + for _, r := range apiResourceList.APIResources { + if !r.Namespaced || strings.Contains(r.Name, "/") { + // skip non-namespaced and subresources + continue + } + gvk := schema.GroupVersionKind{ + Group: defaultGV.Group, + Version: defaultGV.Version, + Kind: r.Kind, + } + if r.Group != "" { + gvk.Group = r.Group + } + if r.Version != "" { + gvk.Version = r.Version + } + namespacedGVKs[gvk.String()] = gvk + } + } + + // Delete all namespaced resources in this namespace + for _, gvk := range namespacedGVKs { + var u unstructured.Unstructured + u.SetGroupVersionKind(gvk) + err := k8sClient.DeleteAllOf(ctx, &u, client.InNamespace(ns.Name)) + Expect(client.IgnoreNotFound(ignoreMethodNotAllowed(err))).ShouldNot(HaveOccurred()) + } + + // Delete all Services in this namespace + serviceList := corev1.ServiceList{} + err = k8sClient.List(ctx, &serviceList, client.InNamespace(ns.Name)) + Expect(err).ShouldNot(HaveOccurred()) + for idx := range serviceList.Items { + policy := metav1.DeletePropagationForeground + err = k8sClient.Delete(ctx, &serviceList.Items[idx], &client.DeleteOptions{PropagationPolicy: &policy}) + Expect(err).ShouldNot(HaveOccurred()) + } + + Eventually(func() error { + key := client.ObjectKeyFromObject(ns) + if err := k8sClient.Get(ctx, key, ns); err != nil { + return client.IgnoreNotFound(err) + } + // remove `kubernetes` finalizer + const kubernetes = "kubernetes" + finalizers := []corev1.FinalizerName{} + for _, f := range ns.Spec.Finalizers { + if f != kubernetes { + finalizers = append(finalizers, f) + } + } + ns.Spec.Finalizers = finalizers + + // We have to use the k8s.io/client-go library here to expose + // ability to patch the /finalize subresource on the namespace + _, err = clientGo.CoreV1().Namespaces().Finalize(ctx, ns, metav1.UpdateOptions{}) + return err + }, Timeout, Interval).Should(Succeed()) + } + + Eventually(func() metav1.StatusReason { + key := client.ObjectKeyFromObject(obj) + if err := k8sClient.Get(ctx, key, obj); err != nil { + return apierrors.ReasonForError(err) + } + return "" + }, Timeout, Interval).Should(Equal(metav1.StatusReasonNotFound)) + } +} + +func ignoreMethodNotAllowed(err error) error { + if err != nil { + if apierrors.ReasonForError(err) == metav1.StatusReasonMethodNotAllowed { + return nil + } + } + return err +} + +func SetupK8STestManager(testCtx *context.Context, k8sClient *client.Client, controllers func(mgr *manager.Manager) []Reconciler) *envtest.Environment { ctx, cancel := context.WithCancel(context.TODO()) *testCtx = ctx @@ -83,4 +195,6 @@ func SetupK8STestManager(testCtx *context.Context, k8sClient *client.Client, con err := testEnv.Stop() Expect(err).NotTo(HaveOccurred()) }) + + return testEnv } From 8125bbaef78c904581d527c8871817d0586cf67c Mon Sep 17 00:00:00 2001 From: Mikhail Babich Date: Thu, 24 Oct 2024 14:30:12 +0200 Subject: [PATCH 34/70] Timeout for getting ydb token increased from 1s to 10s (#256) --- deploy/ydb-operator/Chart.yaml | 4 ++-- internal/connection/connection.go | 2 +- internal/controllers/storage/init.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 75e65550..5bea41d9 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.29 +version: 0.5.30 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.29" +appVersion: "0.5.30" diff --git a/internal/connection/connection.go b/internal/connection/connection.go index 5c99c6c0..d7240ea2 100644 --- a/internal/connection/connection.go +++ b/internal/connection/connection.go @@ -16,7 +16,7 @@ import ( ) func Open(ctx context.Context, endpoint string, opts ...ydb.Option) (*ydb.Driver, error) { - ctx, cancel := context.WithTimeout(ctx, time.Second) + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() db, err := ydb.Open( diff --git a/internal/controllers/storage/init.go b/internal/controllers/storage/init.go index d92f6c88..a9dc1b17 100644 --- a/internal/controllers/storage/init.go +++ b/internal/controllers/storage/init.go @@ -328,7 +328,7 @@ func (r *Reconciler) createOrUpdateOperatorTokenSecret( storage *resources.StorageClusterBuilder, creds ydbCredentials.Credentials, ) error { - ydbCtx, cancel := context.WithTimeout(ctx, time.Second) + ydbCtx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() token, err := creds.Token( metadata.AppendToOutgoingContext(ydbCtx, "x-ydb-database", storage.Spec.Domain), From 5744c879d41cf42142036826be769425a11bfae2 Mon Sep 17 00:00:00 2001 From: Vladislav Polyakov Date: Thu, 31 Oct 2024 13:20:17 +0300 Subject: [PATCH 35/70] feat: add kind deployments examples (#258) Signed-off-by: Vladislav Polyakov --- samples/kind/database-3dc.yaml | 24 ++++++ samples/kind/database.yaml | 14 ++++ samples/kind/kind-3dc-config.yaml | 13 +++ samples/kind/kind-config.yaml | 7 ++ samples/kind/storage-mirror-3dc.yaml | 113 +++++++++++++++++++++++++++ samples/kind/storage.yaml | 65 +++++++++++++++ 6 files changed, 236 insertions(+) create mode 100644 samples/kind/database-3dc.yaml create mode 100644 samples/kind/database.yaml create mode 100644 samples/kind/kind-3dc-config.yaml create mode 100644 samples/kind/kind-config.yaml create mode 100644 samples/kind/storage-mirror-3dc.yaml create mode 100644 samples/kind/storage.yaml diff --git a/samples/kind/database-3dc.yaml b/samples/kind/database-3dc.yaml new file mode 100644 index 00000000..51646414 --- /dev/null +++ b/samples/kind/database-3dc.yaml @@ -0,0 +1,24 @@ +apiVersion: ydb.tech/v1alpha1 +kind: Database +metadata: + name: database-kind-sample +spec: + image: + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - storage-node + topologyKey: "kubernetes.io/hostname" + nodes: 3 + resources: + storageUnits: + - count: 1 + unitKind: ssd + storageClusterRef: + name: storage-kind-sample diff --git a/samples/kind/database.yaml b/samples/kind/database.yaml new file mode 100644 index 00000000..15b607bb --- /dev/null +++ b/samples/kind/database.yaml @@ -0,0 +1,14 @@ +apiVersion: ydb.tech/v1alpha1 +kind: Database +metadata: + name: database-kind-sample +spec: + image: + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + nodes: 1 + resources: + storageUnits: + - count: 1 + unitKind: ssd + storageClusterRef: + name: storage-kind-sample diff --git a/samples/kind/kind-3dc-config.yaml b/samples/kind/kind-3dc-config.yaml new file mode 100644 index 00000000..c21201fc --- /dev/null +++ b/samples/kind/kind-3dc-config.yaml @@ -0,0 +1,13 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + - role: worker + labels: + topology.kubernetes.io/zone: az-1 + - role: worker + labels: + topology.kubernetes.io/zone: az-2 + - role: worker + labels: + topology.kubernetes.io/zone: az-3 diff --git a/samples/kind/kind-config.yaml b/samples/kind/kind-config.yaml new file mode 100644 index 00000000..33738683 --- /dev/null +++ b/samples/kind/kind-config.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + - role: worker + labels: + topology.kubernetes.io/zone: az-1 diff --git a/samples/kind/storage-mirror-3dc.yaml b/samples/kind/storage-mirror-3dc.yaml new file mode 100644 index 00000000..cfe42a77 --- /dev/null +++ b/samples/kind/storage-mirror-3dc.yaml @@ -0,0 +1,113 @@ +apiVersion: ydb.tech/v1alpha1 +kind: Storage +metadata: + name: storage-kind-sample +spec: + image: + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - storage-node + topologyKey: "kubernetes.io/hostname" + dataStore: [] + nodes: 3 + domain: Root + erasure: mirror-3-dc + configuration: |- + actor_system_config: + cpu_count: 1 + node_type: STORAGE + use_auto_config: true + blob_storage_config: + service_set: + groups: + - erasure_species: mirror-3-dc + rings: + - fail_domains: + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:1:64 + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:2:64 + - vdisk_locations: + - node_id: 1 + pdisk_category: SSD + path: SectorMap:3:64 + - fail_domains: + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:1:64 + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:2:64 + - vdisk_locations: + - node_id: 2 + pdisk_category: SSD + path: SectorMap:3:64 + - fail_domains: + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:1:64 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:2:64 + - vdisk_locations: + - node_id: 3 + pdisk_category: SSD + path: SectorMap:3:64 + channel_profile_config: + profile: + - channel: + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: mirror-3-dc + pdisk_category: 0 + storage_pool_kind: ssd + profile_id: 0 + domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: mirror-3-dc + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: [1, 2, 3] + nto_select: 3 + ssid: 1 + grpc_config: + port: 2135 + host_configs: + - drive: + - path: SectorMap:1:64 + type: SSD + - path: SectorMap:2:64 + type: SSD + - path: SectorMap:3:64 + type: SSD + host_config_id: 1 + static_erasure: mirror-3-dc diff --git a/samples/kind/storage.yaml b/samples/kind/storage.yaml new file mode 100644 index 00000000..84874e1f --- /dev/null +++ b/samples/kind/storage.yaml @@ -0,0 +1,65 @@ +apiVersion: ydb.tech/v1alpha1 +kind: Storage +metadata: + name: storage-kind-sample +spec: + dataStore: [] + image: + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + nodes: 1 + domain: Root + erasure: none + configuration: |- + actor_system_config: + cpu_count: 1 + node_type: STORAGE + use_auto_config: true + blob_storage_config: + service_set: + groups: + - erasure_species: none + rings: + - fail_domains: + - vdisk_locations: + - node_id: 1 + path: SectorMap:1:64 + pdisk_category: SSD + channel_profile_config: + profile: + - channel: + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + profile_id: 0 + domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: none + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: [1] + nto_select: 1 + ssid: 1 + grpc_config: + port: 2135 + host_configs: + - drive: + - path: SectorMap:1:64 + type: SSD + host_config_id: 1 + static_erasure: none From 3a88507402932c1e8e7914a92b80e1a95f895cd1 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 21:31:20 +0100 Subject: [PATCH 36/70] New release pipeline in operator (#260) --- .changes/header.tpl.md | 1 + .changes/unreleased/.gitkeep | 0 .changes/v0.5.31.md | 3 + .changie.yaml | 26 ++++++++ .../check-work-copy-equals-to-committed.sh | 11 ---- .github/scripts/format-all-go-code.sh | 22 ------- .github/scripts/format-go-code.sh | 13 ---- .github/scripts/is_autogenerated_file.sh | 10 --- .github/workflows/create-release-pr.yml | 58 ++++++++++++++++++ .github/workflows/run-tests.yml | 30 +-------- .github/workflows/upload-artifacts.yml | 50 ++++++++++----- .golangci.yml | 5 +- CHANGELOG.md | 6 ++ README.md | 2 +- deploy/ydb-operator/Chart.yaml | 4 +- docs/README.md | 16 ++--- docs/release-flow.md | 43 ++++--------- docs/storage-state-machine-schema.drawio.png | Bin 34423 -> 0 bytes docs/storage-state-machine-schema.md | 3 - internal/exec/exec.go | 1 + 20 files changed, 154 insertions(+), 150 deletions(-) create mode 100644 .changes/header.tpl.md create mode 100644 .changes/unreleased/.gitkeep create mode 100644 .changes/v0.5.31.md create mode 100644 .changie.yaml delete mode 100644 .github/scripts/check-work-copy-equals-to-committed.sh delete mode 100644 .github/scripts/format-all-go-code.sh delete mode 100644 .github/scripts/format-go-code.sh delete mode 100644 .github/scripts/is_autogenerated_file.sh create mode 100644 .github/workflows/create-release-pr.yml create mode 100644 CHANGELOG.md delete mode 100644 docs/storage-state-machine-schema.drawio.png delete mode 100644 docs/storage-state-machine-schema.md diff --git a/.changes/header.tpl.md b/.changes/header.tpl.md new file mode 100644 index 00000000..825c32f0 --- /dev/null +++ b/.changes/header.tpl.md @@ -0,0 +1 @@ +# Changelog diff --git a/.changes/unreleased/.gitkeep b/.changes/unreleased/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/.changes/v0.5.31.md b/.changes/v0.5.31.md new file mode 100644 index 00000000..0bf49300 --- /dev/null +++ b/.changes/v0.5.31.md @@ -0,0 +1,3 @@ +## v0.5.31 - 2024-11-04 +### Added +* Initialized a changelog diff --git a/.changie.yaml b/.changie.yaml new file mode 100644 index 00000000..78ab6e36 --- /dev/null +++ b/.changie.yaml @@ -0,0 +1,26 @@ +changesDir: .changes +unreleasedDir: unreleased +headerPath: header.tpl.md +changelogPath: CHANGELOG.md +versionExt: md +versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' +kindFormat: '### {{.Kind}}' +changeFormat: '* {{.Body}}' +kinds: + - label: Added + auto: minor + - label: Changed + auto: major + - label: Deprecated + auto: minor + - label: Removed + auto: major + - label: Fixed + auto: patch + - label: Security + auto: patch +newlines: + afterChangelogHeader: 1 + beforeChangelogVersion: 1 + endOfVersion: 1 +envPrefix: CHANGIE_ diff --git a/.github/scripts/check-work-copy-equals-to-committed.sh b/.github/scripts/check-work-copy-equals-to-committed.sh deleted file mode 100644 index 9d4b455a..00000000 --- a/.github/scripts/check-work-copy-equals-to-committed.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -MESSAGE="$1" - -CODE_DIFF="$(git diff)" -if [ -n "$CODE_DIFF" ]; then - echo "$MESSAGE" - echo - echo "$CODE_DIFF" - exit 1; -fi diff --git a/.github/scripts/format-all-go-code.sh b/.github/scripts/format-all-go-code.sh deleted file mode 100644 index 6057a36f..00000000 --- a/.github/scripts/format-all-go-code.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -DIR="$1" - -cd "$DIR" - -export PATH="$(go env GOPATH)/bin:$PATH" -for FILE in $(find . -name '*.go'); do - if [ "YES" == "$(bash ./.github/scripts/is_autogenerated_file.sh "$FILE")" ]; then - echo "Skip autogenerated file: $FILE" >&2 - continue - fi - - if [[ "$FILE" == *"allocator_go1.18.go"* ]]; then - echo "Skip allocator_go1.18.go rule: $FILE" >&2 - continue - fi - - bash ./.github/scripts/format-go-code.sh "$FILE" -done diff --git a/.github/scripts/format-go-code.sh b/.github/scripts/format-go-code.sh deleted file mode 100644 index b1ed4cf9..00000000 --- a/.github/scripts/format-go-code.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -FILEPATH="$1" - -gofmt -s -w "$FILEPATH" - -# https://github.com/rinchsan/gosimports -gosimports -local github.com/ydb-platform/ydb-kubernetes-operator -w "$FILEPATH" - -# https://github.com/mvdan/gofumpt -gofumpt -w "$FILEPATH" diff --git a/.github/scripts/is_autogenerated_file.sh b/.github/scripts/is_autogenerated_file.sh deleted file mode 100644 index 04a5d4b1..00000000 --- a/.github/scripts/is_autogenerated_file.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -FILEPATH="$1" - -grep -q "Code generated by gtrace. DO NOT EDIT." "$FILEPATH" && echo YES && exit 0 -grep -q "Code generated by MockGen. DO NOT EDIT." "$FILEPATH" && echo YES && exit 0 -grep -q "Code generated by controller-gen. DO NOT EDIT." "$FILEPATH" && echo YES && exit 0 - -echo NO -exit 0 diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml new file mode 100644 index 00000000..de6a1270 --- /dev/null +++ b/.github/workflows/create-release-pr.yml @@ -0,0 +1,58 @@ +name: create-release-pr + +on: + workflow_dispatch: + +jobs: + create-release-pr: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: batch-changes + uses: miniscruff/changie-action@v2 + with: + version: latest + args: batch patch + + - name: merge-changes + uses: miniscruff/changie-action@v2 + with: + version: latest + args: merge + + - name: print the latest version + id: latest + uses: miniscruff/changie-action@v2 + with: + version: latest + args: latest + + - name: print the latest version without "v" + id: latest-no-v + uses: miniscruff/changie-action@v2 + with: + version: latest + args: latest --remove-prefix + + - name: check-chart-version + run: | + VERSION=${{ steps.latest-no-v.outputs.output }} + APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') + CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') + + if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then + echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so." + exit 1 + else + echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION." + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + title: Release ${{ steps.latest.outputs.output }} + branch: release/${{ steps.latest.outputs.output }} + commit-message: Release ${{ steps.latest.outputs.output }} + token: ${{ github.token }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 683976dd..413a31a1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,35 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 - - name: setup-go - uses: actions/setup-go@v3 - with: - go-version: '1.20' + uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.58.1 - code-format-check: - concurrency: - group: lint-autoformat-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup-go - uses: actions/setup-go@v3 + uses: golangci/golangci-lint-action@v6 with: - go-version: '1.20' - - name: install-utilities - run: | - go install mvdan.cc/gofumpt@v0.5.0 - go install github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8 - - name: format all files with auto-formatter - run: bash ./.github/scripts/format-all-go-code.sh "$PWD" - - name: check-repository-diff - run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken" + version: v1.61.0 run-unit-tests: concurrency: group: run-unit-tests-${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 6979673c..7483dce2 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -1,29 +1,45 @@ name: upload-artifacts + on: push: branches: - master + paths: + - 'CHANGELOG.md' + workflow_dispatch: + jobs: - tag-job: + tag-and-release: runs-on: ubuntu-latest - outputs: - tagcreated: ${{steps.tag-step.outputs.tagcreated}} steps: - - uses: actions/checkout@v3 - - id: tag-step - uses: butlerlogic/action-autotag@1.1.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + + - name: get-latest-version + uses: miniscruff/changie-action@v2 with: - strategy: regex - root: "./deploy/ydb-operator/Chart.yaml" - regex_pattern: 'version:[\s]*(["]?[0-9\.]{3,}["]?)' - upload-artifacts: - runs-on: ubuntu-latest - needs: tag-job - if: ${{ needs.tag-job.outputs.tagcreated == 'yes' }} - steps: - - uses: actions/checkout@v3 + version: latest + args: latest + - name: get-latest-no-v-version + uses: miniscruff/changie-action@v2 + with: + version: latest + # Echoes the same version as previous step, but without "v" prefix. + # Is used as a docker image tag in the release step. + # E.g. "v0.5.31" -> "0.5.31" + args: latest --remove-prefix + + - name: update-chart-version-with-release-version + run: | + RELEASE_VERSION=${{ steps.get-latest-no-v-version.outputs.output }} + sed -i 's//'"$RELEASE_VERSION"'/g' ./deploy/ydb-operator/Chart.yaml + + - name: create-tag + uses: mathieudutour/github-tag-action@v6.2 + with: + tag_prefix: "" + custom_tag: ${{ steps.get-latest-version.outputs.output }} + github_token: ${{ github.token }} + - name: install-dependencies run: | HELM_PKG="helm-v3.10.3-linux-amd64.tar.gz" diff --git a/.golangci.yml b/.golangci.yml index ba5d9180..54552669 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -56,7 +56,7 @@ linters-settings: check-blank: false govet: # report about shadowed variables - check-shadowing: true + shadow: true fieldalignment: true golint: # minimal confidence for issues, default is 0.8 @@ -76,6 +76,7 @@ linters-settings: gosec: excludes: - G101 + - G115 fieldalignment: # print struct with more effective memory layout or not, false by default suggest-new: true @@ -129,6 +130,8 @@ linters-settings: linters: disable-all: true enable: +# - cyclop + # - depguardgolang - dogsled - errcheck - errorlint diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..004c0c1b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + + +## v0.5.31 - 2024-11-04 +### Added +* Initialized a changelog diff --git a/README.md b/README.md index 6cf94a4c..63c0b890 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![check-pr](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/check-pr.yml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/check-pr.yml) +[![run-tests](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/run-tests.yml) [![upload-artifacts](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/upload-artifacts.yml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/upload-artifacts.yml) # YDB Kubernetes Operator diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 5bea41d9..44c76e98 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.30 +version: "0.5.31" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.30" +appVersion: "0.5.31" diff --git a/docs/README.md b/docs/README.md index 2091a780..2415570d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,16 +1,8 @@ This document attempts to be some sort of a table of contents: -## Operator release flow -See [here](./release-flow.md). +## Working on a feature -## Writing and running tests - -See [here](./tests.md). - -## Storage - -#### [Storage state machine schema](./storage-state-machine-schema.md) - -This describes which states the Storage object has and in what order they are -traversed. +- don't forget to use `changie` to generate a changelog entry, whenever you complete a feature +- see [here](./tests.md) to learn how to run tests +- see [here](./tests.md) to learn how to release a new version diff --git a/docs/release-flow.md b/docs/release-flow.md index c3381069..e796f9da 100644 --- a/docs/release-flow.md +++ b/docs/release-flow.md @@ -2,34 +2,15 @@ #### How and when the operator version is changed -The single source of truth is the version number in -[Chart.yaml](https://github.com/ydb-platform/ydb-kubernetes-operator/blob/master/deploy/ydb-operator/Chart.yaml#L18) -file. - -It is incremented according to semver practices. Essentially, it is incremented every -time any change is made into either chart or the operator code. - -For the contrast, changing some details of Github workflows or rewriting the docs -does not initiate a new release. - -#### What the CI does - -When you increment the version in `Chart.yaml` and your PR is merged into master, tag -is automatically extracted from the Chart like this: - -``` -"version: 0.4.22" -> "0.4.22" -``` - -If the version is new (no previous commit was tagged with this version), then: - -- this merge commit gets tagged with version extracted from `Chart.yaml`; -- new docker image is built and uploaded to `cr.yandex/yc/ydb-kubernetes-operator`; -- new chart version is uploaded to https://charts.ydb.tech. - -#### What if I forget to bump up the chart version? - -Then these changes won't get automatically tagged, new version won't be built and -uploaded and you most likely will notice it immediately when you'll want to use an -updated version. Then you make another PR with a chart version bump and get your -changes rebuilt. +The single source of truth is the changelog. + +Currently, version is updated when a developer decides to release a new version by manually invoking +`create-release-pr` workflow in Github Actions: + +- invoke `create-release-pr` workflow +- `changie` tool automatically bumps the version and generates an updated CHANGELOG.md +- if a generated `CHANGELOG.md` looks okay, just merge it +- the `upload-artifacts` workflow will: + - substitute the latest version in `Chart.yaml` + - build artifacts (docker image and helm chart) and upload them to all configured registries + - create a new Github release diff --git a/docs/storage-state-machine-schema.drawio.png b/docs/storage-state-machine-schema.drawio.png deleted file mode 100644 index 201a990542e153fb58c1009dd20ab8ad263462a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34423 zcmdqIbzD@@+BR&U5=tvdcXxM7hYW*=lr#ej14E9KNK3a2r80m65(3gCC@CN&htJ0!0ffxT6?Ygy6)U-hdj_wyoF7Qed*GrTgpoEpi7so!~?%K zFs}oDk-2IOz`x5*AVt|r`JLnomoAZbI^Tcf40X4J*jZd+;FJ6Hi-GSx@Y@_>Vg)yW zGVpRk%o+IP8F+aeWUO7EBFrD?I=MP3*;)&TILlfB%|H)(6R5?nJ`YT+EI4@1TYpXh zbytL&I9RL0%q{GIe&+7KdI|7y{~BnH_|?EKDEzCz3jX_PKPTbkK5x*5JiVBn=VF|d z3&h;Q>DSncj?OTcoioJYZyU{E_VyNL&VSR<1P+I}{cSf(nBB!5FD7#Uw(&QE&KtDN zOzi%#RTpCJY<d`z@DW;}rhI-M_3KZef4%?Em)x0DR{Nx|-OzTnNTCU*D#+A8~332_6`_-h|E7z_~4PqEopI6EUQ zh-~8G4EtND0bs!qkASY{<9}Z0onLSY{JxYwm(5>p%AZT-{OVsy+X?0Z|A`RL<3f7Q zCU7f@3r-0B8hE}lU?$+=UmyavurqOnxc=FRm;3)jx)*EtgKiHj?9CzeR=*bX2kZU| zo|!l~{8DU7i2FG=|FtOo8^ja-TjKHa{3G#%{|WDYxBZ_8M&KU=@c(z(U2yDA+Fcm= ze?RRm*77Iq;1&)h@c$vi`wP*2yTgAY@h%+GADZ{?BpwGhCpX_;tlWjspf5FIK)*G-We+j!T!k#}J@o%R64f`(o{rlPXdo_R1?*Sa<3UPwK?Ei<* zPf+MT=a6|WfcZl_APW;9Vfh&^|G~=tK%gQFSjeBt_z$Qh&p*o;1nq#pQq~;e%D^jV zb^cS+!2)jL41)tvJ>0^~0tg|^fm=U&0Ri|Q9e=m}(FC`+P@0PYrob$}X8qmy@23Ek z#Qg^%K%Q~FhCi|rCuca!)h==>1M5H4B7ZM?!i%jSb z1^6xhKfw9}XeS`M`2P&qKQP7_ZenKp)9!EsS-Uyl2VwS3zvugVzy(d94gd)DrcUSo zOzZ)2ahqE>*ul=zNNr~mXA4UgJ8cVRU;^%+B-8*Z5WlYfw{nF~N^Ss|t_ z&gT{b&}ta`ycTl-qq&K*iK&Ux`L)A&CFSpJ@&6jl7vTL*qWO>MlAb(}U~|JvZO)T! z0I_rI05x?2%5d0`&2pMtJ{|(D?@^d9Lw)7hV6$3ZkIEzYiV2HT|_(3taq7 z$@}LDe>$&U#q{6Te<`#J;c3AxU826EEH49gH(D9HQOJ+s1h!Z5SWSKq1MQsau!J-Hi)`ofHfdF4$o9qW_&chqk@ zy9%V1PLn%Uy(+uVPKPO?xoPteUur(&deqpu^y}N^J^la^P}47+L)uE3WX3;yI=Yx! zP>YnxeOJ`Rs%z-de>D)1>TW}gkBM=`SNi8a96VnJ)r8~kS;_W?p``Z*KRHg4IVkE!Y4EHUxJ?nueW<>Ib!FF=}y`enwhOYyN_ zPJOFXmvNsikMXTEv6Yfu30#qxD0>)w&2ORp+Wy?l%amVc+Y@z1?5kEntkS)9-Ewmt zr%g}lDb3!|w{!e*jl^KRy1;XmO$b_dvYR{W{{AlApKFnRvWqV~6D4=*`pqOLuln;H zeb43RIGo=+vNVwd=+P&Bx6(YfI)v)nRz3_G&5t^D8JcBr5!K=S1>Ey>ywt}qI$6{` zTSUcb9CoO%7Cd7nCuTR%p@Q(XosoNIOl^w*Lnj^|Rdx4!PH|H&%f`eV5#XD54StszWl z`y;jmHM=xk6Zt~u>NT%5kI(s4t53ViYIpM77LE#kQ2mvSz=FB!2;4htjkc1BG=wMT zr2qs3m$$NNlxAZXRP#MMozk4r8}X#Xai_OsL=Lb2vC_h4_`*M4`Pm=OFi9Qsp6}7u z(71{ZeN%SmcFzxzKOR!wp!of}AKqy@ljKH7ZWUp>1`5>T5h<}-ZtTuXQtRuF@e9CT zlRMvk*1TCh9Z^-O%Iv8ET6oY&>9PFYe&&H|fYjliqI!UP1?Sd*w(;bVJZKyU;yev>Ow$>XRA$QF!7BTRZfJ=$l7D&%!av%v(r7z zirEDHLvg;p*(E+Ead16=A{biK%BWej-J>ccrBVG5gg85zIJ@BiFd?SAu}V4@Gy2ab z{RpW~vP#oiso5LXJy{Qu@|3m$EpVbGn}83!{oDhd~#HG=HZflG-@?)|7a`y%)o1kDE+PL2()aG>U5II@&vJPSx&;O z6JvSf)%jEVag6sH7Gu+oXI>a{=oO(vcfXnCDoQMBNhlz_2fMs?i~9kq`&i=pWivc+ z4WIA(7QZa=UEjL-hxy-Q*iOxU8p7W6)9tZ|{U)Jt$II;`1xEN+28}$RA0`9I9s*=D z+ZiaU{qWdr%*9r--}`7q*U)`3pdZhB-ET3%Eyd93q`$yhXKcmZEw=`hCZ!8~JKq`a zX_!uTd%io;+u5b@mJqm^+(}J++52c@;vo#tu5XjPKPObD2mR3h&@d?3wa(|b+2`H( zdY}-v>*+vomW0AF_fIR;gYVv#LFv+a?kXY;U56~VX!U!w?-{lAl+@JEMhE&Tc>>53 z*aP4dM9n4E9b33WdW>d>Znn_bc6DbfkO$hoTV zo%|PNOBG#S_AXy#Zs@o^9I-1_SJ#+0-7V7v0GMZ;+!3l-Q12I+PtlHz)2%z~7f2cc zn8E5&5tY=dDOIz%Oj5W1x&Pe8EPllEc97VmqdI6o&eU#%!`_`Pq@SWiPxq&D&xutg zo1VQ?v*ramsmcae)DP&<>0+l_t&JGVtB#Sm zoHg4$kIT>uMXmZLX?xY#!-)CRTr2VEd;LL@+pjCz#l|-x7FjeADkl@c^K8ZkZHq71 z^53Sd`!n^47HjQ)YnFTn1KHhusAmyBoHl+uCp36ibugEl3s|q#{<@QqI-T}Ju7U{R zsbCwx(&qX!GH&-8D|zpYxfQt74cp|7HRTI_d*XL{P5e+?a0l>zm5jNh$@|k(XOBi2 zOGoVWJ**}UI^7-$jk}xe3=h_p4!ccwkz`=`e>u0ZkpzXVNkl~HYAE>7xsFkh7`dDD zWu`Q@>Dv|TqL?Jmov+p8U$dNmC6-PBGgRsBlA zwskR96jBE52Cr(z~`iHF24T)s@ zaXSSG-0F_TY$>Q*`m{czxid&4cMcJx4n6or{guYF^-ffq&*{8RzTI<$6`Kx$L4%Fq zjIOP5yXg$76YH^gfdYhjO$CjgI-x%8jVh7D9~rhVsFTx&yDK#2xPX5?2&z910Zsx) zjLM6ziV2`c9U5;*mA7+NiJuiV;)e3dZfP2a?uG+VR*+7l&++uqXOEH<;LeA6Oe|?u zgwsP~ubstasZ+-fr-w^}lvIc)To=^+ihj<3$a^Zb4lwo|EV?B${!L4eUE=N#7I zQ3<%9f$^fFu{H18Yh+ip0bME_Ke$EUnht9UTuyatx+l;|33YC*+LJolk`h2~*Wvl> zH`MvCzI^0b7+5epNM3_B-WZ5qY{jJchm!WTR=a=twU?Th?0}Og z7&LSni=F`Nz7Z(44S@8l%44l&FVJz(LlVt0e*fjZmDG`*`W>Wt3xRLRTRJ=?D{P^& z6_`)1y<62tf8C_sA>cCHawlm0lu|#R6}5BbO1vbc4Z3@LJTFy1ex+hDC)Zw%6<~eW zAnFo}dWQ@FB{#<1%QC{v0-pkP!M&Q8yKh1{b6kh+3k2#5rRn)lp^9=s_S*rTiAEB> zw-F@6xq*xT%rp{AYt7wjhmYbiaOw~c*dT`{8o-rn5KpdFry_5)0_uDCw7LZHJ(`>$ zeq4^KqLvh|xTE8ot|Q-cwknh?wh$Sp&1Y9}-_9zhwas0>Mq|m<0xkI&#Lp33k^O$| z`fmf^?f7Z$i*2&Z#|BOr+F(T8H<@G9Ti*kwA6(L|1LD?)>ZJb31Xot7CQj_ti33yv z7!o-RA5(a)f843tkZm<7;iijk-OAvCFY@#71_dwjEux9%60)txKgBDmxo?FUADiwB z)}4Nc2V*xL-kNe+t(YI6|Lj9oBW^U#5`7otr`x+P!+MsUPjDDVr<~|K&0iaSZH-Gj znbPbKb`@V2~Vn{7TyMOG-%9W0Ri)&szsO(`?H<7Ca}>~P{axCwO^i0-!T`8s2hqYVI! zkytK1&n^t-ws4xOI3zLLi30+tHi8xV#u;%WWS_|F?TO1{K3m^|WT!qPQW{Su(iDHs zNF*M)*?mmbv-_N+`c=MTYkMDkylk#)nzvs|Yuyo$G=PG>BJR%)BJ#(4yR~^b-@B z!v2T)C%ea6T|S2@=K*Q5@gXqcIG8TtWfiR_4on7M{p>9J%tqpcPj0lK zvV(UJl!_nNeYTP(z+Ikmd~6jEQqV?HmuD8|Er0N)jVMFs^nPEqSm+4hh_Ys5ui%&jMC z9g{>eO16@2obC5+yM-(bKl1ijEs*E*xzjFeQbnuy1l{ZjzbcF?1(E%x zp=G1fp4GQF|3oey%Xjwu7uU?&*wI z8vMnkFl_e91)xBZp#RMY38G{mH;&R3@=G&RlrfAJH)K6d2dfD|s zOO{Ec8M|v0=D}58=_l?O^4HHDmyd0x$Jmk)NxDM=7T)c&&^wsy{1}92ayL=;*R6zW zViG?uURph+Ybv-%4GyWPVP0ipu2tp?Om#r|^X--&c-NQfu#*JC|1&`wnAEzqTDQ7+ zl&0Q~MM^7e)--Qk#Lc=n_UG_&jw=fo`zopl>=m0oG9taDquRJ*f7KLzXHT`5)bU3^ z_KcTu8UdH}>JB~it>-6jI7w%_oN?_+v9I*ELAzI^X4kKr;axuHLyj(5mnldaxkt4X zzR;7aSB7NkjCD!$G8%Wjz8A#M<9pAna--=Z(otyW%XU(QPr;|~-WpuI3eDk~kc3&Y(gprN8y-gm ziKA)>)FC4NJciA=H&ZJM&r^WK@ETQto`9=uAudoTim>(em4~eMC5Q5f?+w>qrKGkC zBcU{TjxwxO)}n`MIKFrpRym@NMN5;a_NuNO-D-A5*BF-8+b|5 zT+{t=;Lv}0d(U27i!m^p5b)ym-CCwC!i!irY-r*zWx4kbRUiSZ+m)_VC3r@u(p^r| z5r*%qSQ5tV#y@*hG0d*I)p?vyE`kng_IAWAd`AbS1Bt1kr$%3xvO!TdqeWwnR;yqV z?1DtJKDc%qx9xvT0ko~mAaRfvm4WX2xuqErTizfW(5 za}}SO^a)di*@pA&J(9z>p;TLn5V5L_qr(AJtk)GI*e>%vTdsJ4&r?*+ zsuWKBXoi52DjLsl|9SgF{^oh?W*CHDQOI_mKU&WJYEns+{2Xzu>nzP1nq#Q1VvDCI zBW0I-e&0KBK>gUNq~-As9&C^Hhrf86?U7CtHBMxrLp{>4Y8rT$Ej6L{%n>X1>=8WON&BM-)1}1ItY0I**s0V*jQ)%oP3wC~?~yOkW^+_@Zz1vf zA@ZdoGoC=^XjI1*Wbqc5;WK{bng6k`lM|2Ophh4uO1Gwg!L0Ia|6veU!#b9JB%wM3M9(p#K{SMa8|4=I716X;s_B(WHA4`$k!2##Y2K#3OLPZB zuz7%aB4_8y$7Q}Cn#%mAUVBv&hF!XIX?>vm5mGCA&*9#*hkNmo7UMh(uw(7d4djV)Rw^ak0cer!RwuT`4cIKoUhGyHN&)WZ(?l_5-VF7r)Ol*jB) zQn;TLZ4T0tGgQ6uxwh!_NI@>=MDH|#RgXe~qzJDLAu(pR1f146LSO!L_biy^jDjs) z`~cQgy3hQ=%n)Be*2GI&&of%G4okX;-4!SH^#@r984PoX2AZ z)8d0jOAUgL(%yMD#51;DUqh$hJ!amgP*AqmO0$^6G!ktc4B;Qz7#hQ(pe5``fV1{a z&|uzK)dE49lWGpqRCMeqPt)3CHd+^z)a~V;S5n6M6+4Rkk0U6F zH%$)q5ux}d{wlHUv6x`mNGPhugKo0pK{(1eO-w`%3a9;1ZKD)J=0l%@Gl4gxmakNC z-RHHPh@ujMCL^pk5EENl)l9lxk*vVqGt==9G6jiI+(!hM)H`v9fU(`Sco`)!=MO!~ z$TQg}!+leLVD-So`ewxpO~1P$LfXBxCi|+*q5iYVZ6XD#Jqdcyka+OG=i0dpiklF> zjb%7K{s9jc(oY)@V+#c=&4-HQR8SMCOVBVUlde1=8T4F9AI^>95x(?}XpYQDVM62` zM|M#~Q&QJVG@SI2Q2Ji=e81C|2O54_xkx@hIGv$SrtH&3Ihw!BN78ShQ7!bKkmdEa z8>}1VLtY#2hP+x0V^taV2tPW^Z=I+AMEp3FcnO0_oi99NE%!$h0}E}`L9MwVC7X;8 z@xW@!j5L+5#9msAoK(-v*8an#0^^{30#Qn8b;?&*?RD8>=m)_Gcf7>R#4OHo5d%&@ zNk=11MI=caUah;yLtvJsGp-w}mYgD6F)nv^=qTw~v=ss+$G;|X9V13EO6rV*tK|$y zg2JRf@UNU5!`{Q8v9i~4sTs?eOvq~*6swfUeJApMPwXumkmY2N zh|+<22)hc?_o4N)JAi{|r56`cVXfMp=D7Du%38yKl#?mKhSM5vG`MX(B-yIjmGg|n zIZ3L1zI+s?t&tQ1MqXXVo7fcwLG0n{+Hnnmf&v7ArLc4%p1jMagH17w4WlUoSI&GU zMAYalSv4~s)PWg&t8>BW2VX5y!KXl>>+M(vp_+DMiTb|l4X18+!iS{rJ&U{Q z1-)wNCfW4!?XsfIv5MA-E!Pz!{4j|&8^z3J60gqt#ay)}vGz^y2*RYrfcN*vP@u4B zWR{~kI8i;Tou*tNq)Eg%2~Q+cSP|Vb->8eKqpF_=x1Ogtd-tEuex(uGv~C$xV2!51 zxK|NN#)9IQu;)J>`^176b)R-$pNV_wR#)t?yV~-Q3@vZt-a3Pe6-jorHW^lXKs^`b zZ2Nq7C40TF!5NKw6!e=Ol~FPq9I2#hq(1piQVO}=q} zc3yb(wLC?I?Do@`cKR=;fW5Chr63<-7)vgwW_#1BsvN;-9!>IERf;UZal-GKv*@nC z#4`0gs*(Bb0Gy*fcY|*g2vg3-`U?pa?xj}zs-O0+e_?xrBT}s{I0O;zQqdw#D+jef z)M?`d56+8-0UqDhldL@VWWOtAx_sVy_x>s_cCsNs>>ShpGETa;qMG^qy(I8*z^2Aq zzsv4>Zy9URS2x_^&Sju9&W2me=wbJiwI&jw(kaE{cc2XJ@D!jLeix$>dt)vV|H%rY zHH{h(_UBFB4e>9o?Ro>2g5&)f%5QZa@hc{4qCiG3J~z_bqDm5%qcQLJcoPTB$Rz(m zyZq9@6Ebw#U9$H?#DR7LXmiEt`%0La*&7JS;g$qL>P^#_NuEUGg-G&ROCsKQC$oma zZyS%WonFSN6XLd7kGE^+tPBewaE^9Wg|O}X-ON;!an>dM0{b5fQ7!*&XZWZ%(D#GZ6D}rOANoD2d3o z)gz9mn8f&q>`m*4r6B3ZBT9F!j$0XNZRllN$>GaipssfK3!nBdJkp*}dXiPnTth~r zx}2!%zkI*6W;I-(M;kaeGS}Qh7t}nE#TU*L&m6CBJMy3doIv9(6#+()C@g`8rC+dT zlD9d!ux8$SU!}!q8exC5+d;QZ-2K&o%t(d4pyJMUYNPzD-DyX3$9BOS<0oL2nT~%OhudNG^@*|VXpFw^0Ao?E9G$E21g~V=MC-tKWGPT1}9>O#7H%7&FVGO zBjp$z2wCktC<#qRc7d z6ZAqia}>rp)0;?kpDhKw^Y! zrCA~Rse9)fR4KMLNO^6{@;n{_z3rY#Q?X~LAP;kT8_w}ftzL{GP#XJ7q~I6m)?0p} zZhRvfBU_XhMM9zUmgGoq(Z}u{4rr!XQ^(PQ7vec|*^buEy_$-)O9Nrx2E2(Bt#dU< zVrEf6%imn97Pu@@XnBYWDn|P!btG8!c1+vX!r1sM!d0g?Y*>!N>yyix5DW8-qul8e zCOu^^4U@jdFRGl|$H>%KHmSut9cu2M!_gV7Q5`z(MjAlP@> z9WK{RR69Ivomj3lABUGGd1Myd?LBgMrN&CcFdDMF@eO-~)~iFEJu;=x?gjt;Sv1tv zRzHcQ!WSaG7V7SfyGewC@79W=HOOx-Ka(>T{oG}>wlZfwqsI_$LqIDpo0Jir*y(Sg zm9C*jU{cRH3sKYPST8H=2PiLThvL;4r}CQUh6}eL*G)4c4c*h#7;_wF9o)?--X#YS zE_0`V?i&%I<@p1!Dh9LSGx1C4YdKH%NtTAR6cGoqu!Mk+l77ENS#uzr4|% zjtjNu?Fl)pMS(<#D`K+Y21zVSkf^qUqg!#Omc=Tp+AEAz4bD5H(%N}KK~&|T+1d|3 zDfSR$KJaFl>=YAyWE@ zBV81{Gm4eIXlO4zf&nUcUBrA5_VuA((iz&_E`@h5ffhd3LBMy7=r z(%P-U<(@uN&b)!Gh-t<=J>@5t<7rJ8b0YCvB(;cEwxc7mCQm#(O0n1=)Nl!)vBtMu znt0q24SK4^_DlOm2R#rP3Rd$v|3p{rY#fR47e-yXd29o zFacC&G30({0?`k6661&bli{XU$#dvE^aT4;XPH-eqM1vVv*uV-2%eV)QVSnXIT#ev z>us%#c!!ptdN>RZ-J(CBBwzG2-j7qkesTY+P$0jG`g=W12K^ZZWa51UIhg30O|oJ@ zRWb@>3;_wQoOYN{LGFO^{U@~-?(~xnw<&xujEdTh&Jhe2u2@jLJIXQxR;q#;s#v^n zXKkgUXnxF%oZyh~FB^E;>S)5DZRJLYo_VV@&7yUCa!o(cf%Igx_jcZ#o1;<9PQRgQ;k@V8r5rqOU3j3(TLOF;V5rhGEomh{LV?)K#E zs67iJ->~6V{K^cG44QuTZ>Zz##+65@vKSC@(Z}v=@jy0U&tmw<2}#Tt*}N{ z=Ln@tgQy5W{mIEUwmOtZhE`PKzK78VK{C6THvR}dGI6txIr*YnCdulzBG;E|eS0L8 z=(=8XxEBLTktAFZP8@OSF^K3(K_3RkQPbE=h`}=7_E;|@46%~+e^4X7@ughgqbEHw z;K5$f$VgMNVV(xe8TZ}<@q9?d0~>#$ZD?ki-A#N4Tb8L#KQ@(?CAOmP^kMqtz73EREJoH6~uuc{~BB;i(W8ch+eoR-&#J*g8UHn#q zWgA4fxo}99b0%h^)VfDurmYPtLXh%us4{En)YludQn>nLp?wN#A+X|j=iKOke7%^k zGbm;Xwm6I9|! zR^1E8=gShP##5@+!^qm_%Rz8vA3uiSf%HKhhzLabOg%t7ke}Zi?428T4b>yco9~={ zP^kz13Pbca$77Z_LdfdS%E?`pSnMR6Z!xDW$>$~C(R5lrszUjOv8h{}*s!q#f5UyB zbyI^ixy+WcyT*20^53lI3msP?w%{3(xB8i6hCQ(G0G5a61Ktls~ zAFbJ}rXE}dwH90GF8495VMo3g%Q`k*V=lMOj&sd?y5+|U4mvh@O zc@oA#1^w33P7f04d`Ngto-%oIZEm7$=#{>pf^w!KzpH8SE3CC1$7FTo0=;(~Q=QuV z?{F#}y=OMGXL%xf))LFONWBaz4kvE)?MJb^#o~BOedYT^4=hU32S!ATZLu|vUnoMG zI--Q?A$`4_4%1Y%x*OG23i1V!A{lM~hn{Nnw>(Dnr;Nj&k)B&DhPy%cc5=|_LhV!vk?u2o<$H5#96Y9h29 zXOb$cBZo9hP>a{gkJPOpZ#HFc)L-HwG^16jKvj-JU>kUPb>#D9*A&+u;wjb19k!L0 zH$DeQ*u;X{%98z|WN5qMcurJN$91M?6%s1UUJ<2i@(vWpteOpYd(=aKzj{Yq8Y3AB zLNl2-&akDvAgMiV5~|henhn;gWayad%reT+ri~X*nOoWxuZyL$2)AY%v&x4gkf&^q zWhIX^g#$4`@{M+PW`fb~CRKETOOAI`PV;&L_N*o=i|{8TA*yJbt5o`6MhS~fKP6fm zp;xUO0xlg339pw}((B4;WJ5kE7q31Cyo+|?VJC(ovBKnQyVabUTmw~9PaZWc<~K*$ z6h@xdYp_K+%8g(oeLHXpa)rCM-|kutcc{{NwT1_4L=ZG&$)+8xayD-12SvrCZb)K# zyyxKvSZ|IewKW<{yjFOZ9{*(!CN*L+HWM3CO9gQhoDei_C?|!_a>rRmdCEZO(KBG$ z_{|?31*~ljclR|;%IbhjSfd6ZD4{8Ex9nR|$uWYBlUD zr_}XWsvKvS$L^(TESKG$#2eZ7!Bkq*%+&UO#%Ll&1R7#jPH4$WX%QqNCMCP&v&D;P z!IGU&&FpM{wfiA0Q$AjY)ryv_AXP$zB1o~%fPMC(5Up-^ianr2OUhL9p~;C*2qt&7!I8uL6P*kjcok41*n$%lq#{2kr*>BPQw11WRUMMrThVGn@l zs)FTkznmYZt~#%TNP|lfZLBX6>s;Q92GJl)u+qS>s>SRf%2#Lz8lu{ngx(@pAMFS1 z!AJYEigA~(cuE%&hia$C7BUzWYh;SX#frznOYAT}9I`k>UA}cBuC~Q8L296dJE6!^ zB`(t;yE_tT%Yw;|pDq44ZqqQzCbZXZ%dSl8xZJ~VucNN`o9NAX&2+)uq9> zERab2=jOUDeGGqOd^WEhX2?EYe~4aaQotyEG+et0OBg*-4rf%#Y?a1kC^FS;#SzF) zD))C&v(NZIi1>`30e);f{#+{3=$)RZ1z{;4V%Ac*Xim8I{YS^O?ho>vYUVFB>(o)8 z5DrvPl77NC9|6OGQ*}dw?;W3P&k=h`+t~NcprH?^i=IWk-EI}Y8Jwk(SKT6>qJZC= z0q;8?tMihwMQ*2*+m|Y59w{^i{BIAC9uGQsv+vs~K zEImp*%pI4TktdCc?GvvHPH|4PwxHqeLl%8k&eSg2#3q0B;8Jp#jX^59^iYQ}t8~~G z&O<(@6vXAZKKe!6Fr&-m(I=T(vDdmnHhDDY+5EUyy@+?hAL3q-UBt}fz0(U(nG!Cf z8>Mrm|1*HR5ry>Inz_<#*jNFfvi)}+ASVvt{F4GNIoO9EtE3P%)S2djZy4X z^tgVUoc%KDX@Gj9{^pmgi4Y**NLXFfIQW=CXPyj}axw5ySc`#QM=T6`7pOdcaihon zo%#TcQ$!X)p+g znf%tYO;64>VS9?ZHAuIdy*ub4-xP2`p`I0gblbLA(EWE@u}T*DCw-1P_mZ=diO}SG z9t8X}lk#u!^x)-w;HJT39A8?c%v8fe=HW#(7A4Vq@Axa9pgSvJ{q*sh2+y!q?IF+n zb-%In7=aGK1ur-YPZQSp>F+0!wA5{U`L#w=AeKWqwcL$Wnv7wTXyA*ivVIgr8E)9z zxcbic0zGt4G$RC@H4z@u=8P0Zurl>)Qs|~@30Ezk?T%_xZ-1u^(y=w75u;jR8i!2M zJRnEgzJpK?w}Yj8E-$VIs<+@-q3ZKw{y3ySaaGNscvH zB))^G)dZGn_SSWx99aT&xv41OVmPjUkeu(LkbEQdm@~S~Ir&9ppiM6$NCeILu^c1{ zM29PTFHFQt*eTSCC6n6kRAm>f=(`HDLrpEW#L{!;zhvEnEKdRQPGvcWm|oOv?S|yS ztaQ;o(3M)ULoKgUIvi2F{esS48$t?$#Aj$+wCo3qTPL*Y9!TEm$}Zw_o#?g?f7Ymh z-JBI8r6M8BY(aRZC%PDTNly8>&{oPEWRzGGCRbbtSl10v-mA%g6HWwdkOR?(Shqk485tG1Y4{$cjs_HTX z1XR;tncA%dO5&8nZ%|worjxI2#iiE!#CeX7J}s<)2a69*(Ha)O3yUwqi+4401V&16 z`P0W{YqTjX6Gb!BWuv|4>%*UhA`$YwD+^I7JNHDmKom{NJGzro6}3{`)FwVYJuX38 z9o}<`UUM6@>)>hpntA)MQRH1Re5>u+)?HmX`}V^8EDQSYbpP}R;3d# z=J$`^58$FPihT;t_TJ<Ugay8|fL~>v>_`d59nyB8rzArXj zcz&drQ7af7(65da9HpE$6nFZdM;?m+-Wt8hxolH{YDGP^+xl!UtWv%HEgQtFQPZf_ zNm9fmaQ|hWCFkTkDPPbAxv&Ffgx5Z7+^l@Kg@#S#L;c7Ui_Mei7O~X)TK|gR=OE68 zw`oul3n?f=J+WlA@q}7oDy2?SZpy~*@I>xf4i(bu%^ zMcX5gp>8cFVUD)GeW=n+Ra^&`gM`>@_`&AvjyRo4Yj-rOXPCY|{(Wc;@8h|5{Mn8g z!s3FfBAbCC?4U8z3I68LTP>bYoN;XtW8d(-#h_>F*$zcgn8YxKP4lTO$GUlmHT0Gq z;+p#NRj2!_#P{#W6514%3mzpsA}+mc^z*cK8E}l*|S%zWm}Y=zmKa zLP&3we+T7FTH~_jJRMbK9c>Q50KN{=Hss=>;4XYEeV2oI%JoOc-5k=1r}P&KH4_}R{!ShqmpYeDK^tFA#Rc3OGKGpEKT2AoF<$o zT_f7rFnn)DBFNsyCey(%J#eM-s?%)wrs_aA=LDQKet>?fPqlIC)DUXBpiFSO( z6x#V4D{vy>B{|DQhi!g@S2j(y1V#KUF0ab6sxxk;Mak)0 z7o=Ch)D2-h;8n^}4r1y>MaxoDGa0HNsR%!VeV?h*4u z`PrPxn|}*YUy_B!4qW+UYjD6o`4JEpQXf?p@&whWGk_})Ffwo_!XMpc9ggD@=@GFu zdYMy;d!o*IsI2Z}MHHLQSRbh8<|N(UHEM{`=*hB0^OzD91bkB>Ktl?(f3&$5Lfnd8 z2K8XD5KcKfQkE-Gvs;LJ!m3{M;ETWbv`RHlX)562dL`BiW%l=U$Ba4v9KsA018}bQ zN@84d6OrFDpm^K!WZC+>CVpx9;5&gDO6}( z2j76@DstVua+O;pi6f4SZrq6xQ|&QMRGZ^$q9>hU?QHi^U-Cq?y7$O1Eu3HHULN2{ zDISui>bvXQ@9&$u6P~@lWiPc}=`2n3X%gzMDTYqgRrl=JtY4 zvL)a4D`wvjuDXW$Q@E{)kYom3`sDM|jT z`^-$FUNz#0+RZ!46|8sEV*TYf4{@$y`UuQ>%0$Cr|FKpLh4 zt+Bnb=4pEvKLseUj+_%GvoHmWv4G)v~? zAFYGJtB8?nr93X%zF{;EXqXa3!K}RS~_|VyC>jd1y3zu5LUB3I6qBz{e^BA6|unk=j+B?ZCN>TQ(!Z zrj4RH_c+j65RKk4#GywV_{F5Ztd6d>*0{Ts zug=QRpxrF?f_%NaGNkb+DroP^!iMGa20w(RniLfF@~!MMa4Qjc&0~AX+`7C^s>Q_E zYO|SHo{x#pyfWq*`y2S1r;G=ROW;kgO6GS7LCTmz;J|nhuHS*N8QlUSyuw^5)6b}3 zS=<|LzQ8~Gr6E;UR+%@Es!*%rku%+_DSsV0&s=>=WVtNVdvAwVGc7=`fAOpIY{4^mVuDdFP_WGxQKx7>`ys-#bsE}}ki(6}csTP6AKyq!LZ~O>$jq&@q_LbJY)mm+KG(H>~tA+$GOYW$VW-OJ7L&8cw zWZH`4@agT7pY*Ssn+-nRxM|OzEs1uNXqa zaDanl2AGduxZOO@r7pgTe3C|okAkPMF&n{F@uRkwq>5EzM_8mfTUV_cX}>DMv}+(a zS4DN|4tCdYc53FyA~qz?zq8`QcnOQ z()pFGb&^CKMDz5_QaR>e-FpKUcvhh>0Vb$Ic*n@UudTbhcnIR4{AF<;qLdk1*Y?R7 zYS$lfCj@8HxeV58w-R!_Gv%2ONAcMNRR-Kkidt|3qjdVzQZ;7GNc?*_Q9~k2qo_=OC(wdm^Yq_gErY7_j z2y%I^mG=wDtJNf$R^%Up9(eHx2r!?2LNM?_b`tMu>ksiRK`fgu9}P~rEt63~hu{Z> zN(MX*pMQ+)ELo=Umy$+KAF^~cYAcu7MAF(GvWON`bSqtU+0mp3)*{n6^eduHi+;g+ zT_JnX22)I-;ozCvI1STQPU&TJ zOj9v!o*0{~;=j27qvpSMRK&b^CTwP|XFTY)BgnU>KOFkW+1B=qkm>Fed9XPPWBAaD z|7JVqH{Vz)0y$|FWjDC7Np02LlvGx+k%tL2FRKy*Kshvue>e)pdb?w;f#ik4Yu%gQ z*rNMWQ#mPHa-t;*TLv9rZPTE{*!Txci`YdZ<-Uz2R!gf&Hz_N?ya%o|6*nl7X8x`y7_6FjLy^zu+9@OopU>KqGE}+}wmfv9 zs+6TNJiC_aEV2CEsJsAio%|5l5H!5kD`|YCA@yqFi#h&WdY4Cqnz^KV@2PsmV}lyl zqFk(~yyu)NKEebZrA~U~QF-O+_+8a)H(IW#e6(BpZc1iYT zq~-{gHKVMbET(%Fw-?za|R z-^+1rZ4Ia-3Kzxq`p;^Xc;?I#~wjUnwQJD%@^g zhdbK;R%KQ(LPdX>9r4hb=5k;SKr#%lKAr0`$U`l)c#PemN4l+vcONWGG?wRm`Uj?P z8w`J_*0s9?DY@~Ks1TwIlrr2JmG}!!^=v=Jr+7y3zL&dKO7IO)0+nA^b#3Jr=QZI8 zegcM@(Vi&F^yFplw)306#~?YeAHYi)WZm&xz^2F#oVj_DZqMYsWmgZHplqiV?ifzmksZDP_3tS<_D^ zz~0B}PdlP_`V{hfv`6wTR14}X99&$7E<826s#ep?h193!g0~zBxO9reDly$E8(v!f zSQ*#RTN^Z8S^{$ES$)1(;d* z=NnRGdzaV|V&|V@3X6*G)2Mk^BwR^cYls)hvu;~-M;~a3PgFEzw2i|K88bTe>@XXq z&*b)q2$0vzTAMX)Xz&oHXmqk5$oW9^DDxXS>$#r5n2RjuHs`NR{?Z@x7=O~5Vtxfd z9tqoe)omOnvi$vQOiHYz&dVSr;3C zn*O-hSiYc@?q-n4mF^-U)!Yg0g?CkxH8OA5m~UP5snF^h14ZTYk{{$1f6ZU%KqyZx zhe)%)QG>HsiMHnc$kmR_frH6M(<%1F$hxUbZc+b5O4^vbiZe>$Blxv5j%g27LB@=q zlSXxH3~_|}(7l4m(lqZCq`RkB(9-AtOICXZ18laJ0i%DVq0Q-k8+2mod=2tMGmM>O8Bc7%Qf6 zc+!ALz?og)nogfo9NWAlcH*j(#;oL_qb2J^)BY&xda5UD(33pE-5m5#MM0xXsn_G< zor}LJSbbh99RH1fC05NU^T8p0y%S9GxQ71@G*O=%Z*v4$@a%Lplf-{KA>WnUSUTSK z~A4#E!q?4bVLNVR}Z zrwIiM{r8yTGl8>gj;n>T<1ok3<{jGe~B?8B$eH_?LMvrT6o@V~4kyJ+#; z-QuyXL~sv$K=gns(GbrsuT3aXIWgEwy^Pd?g8jQ;AgSV#jCA?=1C2OKE~AU*&@2c= zTi7SpFyR!^62Br=jW{-Oev?*SVs!k&bsL(?RGO5Ne!MO;xeJDgvUJ?{tN zy0(u4o`edgjAtiZQFSt|i8iG6V{h*>@R!&}1eg&E&kfj4z1L_gIWK`-5irDMt&`}! zx*3EYDU#SbNBiNtgv)H7J1TyiS3Rj1`(>nr;6NjmwLp76+Ta}MnqEWyYAi*FS!{># zWd`%KtVoWkH+gMw^vT7u2&l{42F5wz-F05&=z8pzL4U4;K>dZj@26%- zt*%!q^C?G4e55!{mn)onmhhrA zS57;h9kyx1dF0}`ftV}Xl!yyj$AOz(CAcOztM0*@sgI) z?VEpx=I_w_oi%@F&HvvEn)G!qz+p24m_3acvreaP(5kEde_nOvqd|1Q86m5<9-6hz z3li!9|7B42;FIk5%Gj7)(YrzjwS&nt{&`Fy`YN%g4|qlbg%h4rb=Z+^za;x5+bHlr z(EMS=d0u)Y8GIkwtt|>c!NCluad*1*e1QbE^J`5sRz|8b; z3U_FRS;HNz4FW*Qh#dfBy<=JrAk^S_k=MXhdNl1fp@eSE^7ze1JasfiCpN7WfweItp4JTn=}yZjN05$&WtRJf=O- zj!+|w{SPrkyu}~0y>~w`XIPCdlM5&IZo{WUx?$y#Ao5nING_3!vF=A$7H>})OoH}* z3mR^A+xWp_SnOABOY(dM!i#XL&qF|)m2UqdS82|JS=l2?OsF_23xKdP3`BADTBh_J z$H1mFznxm{{VnagA1lXQzKl6|xlT(srR~{}m~2lbTJc=-mHV-Yp{%TJ^1 z790z8hk&VvJSLq11W^%x%~EzsMg6jtbD<}5f}cN-ckTe9j#j1p>v;GBaZ zAUMB5KeemEH><#jnDnn)2;`pv#gapm!}%(74s&mEq6-)Cf5_rF;A0_<+=JH31s5h} zXdvX2eeFj;$}-uCh6Ki=Uu%H7GvseA^S~L9L=B`VZ0XFNK6y6_)(~9r5P%x-myFkT z-*T0wnqE`l=OT(*$B{VJeLo}chQD^T%kwBovKEB4YnxJjRX)%9Ziy7dv+vx%XI?C z-~#8%+*Qk4jz)7(owfl~tm!WXpin#%9nFR(`AJ_Br2ipa*CS!pE z8PJ0J!S&PVvz}3#T_1Zx;#?P=)R$UD+PRy69b2r1^%*1XjZYe+oF|=xHJD0>D*wn6W)!g(6>XrBYv!-wBij@o?)i#)wR+Dc({y?>9Wuef4wOo_jMSM>_Q(R=Zp0#?^_ z?5dO?@!hM}7*g7w(WN*YisQ{l|Gc#`Y#HP2BD;p#auW3up(9y-$y@u9-><*dGJ2{r zlrNGE0qgce%`)1j-@mH4^n&zCOxL>S)*9zBh&f(XE$5P65Q;(K_KVC8?do2$kZ9>j z{PJ~p6XqN-niVG!jn=v#X`BF3F|R@ZRpWx1SJ zn(x!~Am+E2&mQpT4SWJBS-}OUYTub)NuytN)`a$wm8u$t(E}r~3V@)*MnBrBZjSBH z@m!f2|19ZzFc>yIIV*`n0-~Q|Dic6l}e5{No+d+s^Q=t9=69z zM#iaGUAfc(@)2CE=s05HN8KDO67|I>`qF)VRg1y}o#;U6?n{lSt|#W*sTPfbvTp%7 z*u5fGoo8%v5j^n>-8+R^2ezU@FTN=54Av)iBq6di3hH+D+e*EFb7&mOY`t;lRM-sY z8}d3N!i0FjBWczaT@aE0Br$|8=ckScE(y)n;mLhY`z<`v`+=lU0Nosj7f)?e?9tx-Pg9OXg zLqCAKd-o}Ce4aGXF!A&}2cjI)>t32}YSNxQkb8hcrf@|2dYZR2B}v^v&nqaZHe z!^|zVxk4>pc6vb~l^Dt3t*y4T`o@=KrOTh@z7kIeS*ns7k5A}^jkcBd(9(hlLHLe% z*Qe5H;)TZZ3)*qqaAzp3PwQeTsC{Wn^*F?Q`*!=B(s_&du7&1!x^H4K^e;QWja_jY z!@w7(5qvlIrke47r?rgU;#$%iG7Y+`Q3FYO+y)9Ym%{=de?WCqSY+)eF~M27WpM{~ z083jW&hNq%)h@<(P@Z9F+1UIw6c`8`H!{33P`B?@r zGBJT$Dg0DwM5ib$B`>yPB!#4=^Cl?csCV3c`>knswM8XxVi-33@bN7Wx5!*o!v>uf zCxki1=3d*)FnBc#V6i{Ah;?m0%|0cRa-rn1uKx5ySO>%C-e@c78_t42np)6TpCWY* z=yy+fOiU*pV#J_A=U?sO5kg&XDX~TH>0AaY=_o9=_qWeyec_K&tlS=H)SoXoMvH-s zw(m~G%Q=}tX~g8R2LD4>YNv91iF+RLu(%WycNkZ&FyCfDhPU0}PRGk(gv{^vG4HlM zrp(5KqQOl{8_sxDAQIQ*NYW*VfF&l-y7~?x=khjvvHX0rN2ZrG>3mbgx05}i?uyal z1#sm{B8Z&F_Me*%mu}vDmF%E&sJ?uoe{U%Cw|=ybH9_E4xQB{#Le3#rkwHn%y^=)y z#z)Uu+XJI1uj{NzJ#W4Faub<4CFC6Meg$6CIh%b^9k=?%@#!phSc0%#`U{hn1Syca{Y(BUiqMZezWUQ>LlJU>=pu7w&pI(GaHsFlL$R@29=8aPtA!U;z6YJ3w7cAwJEd3O z^E@P5r#SraO&8BEt=q=%4DPf^Ogblq9&B?^warSYQIZJX$(#|-G)9)^FfQ%wJ2SwB6Cft{(vSz|%%vsBznwt3HffftM7r3bUWgP0FqYfpXO zXrc1r)$_~uPxzH2#4w0KWM zdg;xtgFqiOUXx9YP@D49%#8=Eq%ntKWp0mCJ3zyIpqhP2V|G1&jUyfx(%Z?{Z+k3g z_V-RKImceQI^0N3=;77DaB$1_fi5p3*S_YRsvO|_5wZP3e@!?ny&_5o(qXM{7kN}E zyiu5pY-=w|^9&#d!Y6Agh07c1cAts21+R?0UN?2BeMzx9-&6=BUGwa_!re5^OghgM z@j(8HIJLBv``}e71C}b((8j0m4kW_Lo1rH9WP)4s?sO^BLyD(s*2F#U7Dy&e zJ0TO7+lgeHIz=7=c?A5GjQ>i;f7SfIftJ64mcKEu|C`~-po9+NQ~X0uoPhbn839SQ zNHGxtjZ%D~V7|^y@&oUzF@<5dVY$vTB2~|_76Rqft(b-%B>ox6&jM+P5*24>_D+WF z&j)}IJznC)DwR^Ht~P88C3$2+wT|TIN@sXg3|fV zXrraxRZDt>#X5_kB9msf(!!6 zE_DN%b07HJljaD$U7r!)i*UpY#M#FC5oD3Ef0*gWnR^pK$|xEL#t|9!3+`O@!+o`M$hyW|E?NiSb0fM?<#K>*YKY8PXWA(FNeW5vJR*A5E-pkE#%zJWP(0 zAPsxeVOa0d1neZXR=0y5XAuk!SDqv4yK+CAW`k&mJe?QTnM35w4c2oso4_hJ-F0Z&Nx@uGZ=#V+dz`$K) zyp)Fa!ik21wBhiEsk+3lI|d(~^61`keBVsl`nDdsQVS_0_5_Llp7)H+ z_roq{)~+{^>{OGDI0V_W$FmzU`EK`8Jg-4mDE;{v^2Mh>*Tgj%7@A-jp4dc^_*_*`NoxXU{&$k zvlTcN#DM8J8m6gW0ZeyVAqAmT|60iS?R&S)=Ivi6ggylYH^nkIApIK4X?gWHG! z(Iv8icoYrt`tu;ETA+zz!$7ukp&r>~9Mc~?U0O;7Su8op06P%>0S`fI{hF`2!c<=t zfi$~A9y8x07VowHZ}Xsgkb|{BaSsW^vXtWBzPoj5dCWv1Yrt+}Cz9cdV9UuPI~3)} z=OLSuA2q?K)V>`KgdYkRP?^>Mmxu8^$c@H(Uj7pG$&Lmo+`}OF=eGkqU)(wrC1!hG z(IT(+C<1vjhrfC*eo?@z9wiCdOUt>*>V9HM;GJQ4yzt8U4ltuhcZp|C*B7&if78!_ zI6DEL`WfE9Q;e%Bc&^-CQlObovN9Wk-MSp~Z9`NJ4o+NQuJ`3=e=1Ef$oGJA8GxEaX21$bKR_Z1d? z?c8Wf%XMkqhs?N+2EY_8AA{mvvQVZhN->%)O6bp~aNkf(saJgn=4FK4?+#h@DZ!zI&;WB>j*?&I?^FWh Date: Tue, 5 Nov 2024 21:36:56 +0100 Subject: [PATCH 37/70] Testing automatic release pipeline, attempt 1 (#261) --- .changes/unreleased/Fixed-20241105-213558.yaml | 3 +++ .github/workflows/upload-artifacts.yml | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 .changes/unreleased/Fixed-20241105-213558.yaml diff --git a/.changes/unreleased/Fixed-20241105-213558.yaml b/.changes/unreleased/Fixed-20241105-213558.yaml new file mode 100644 index 00000000..afade886 --- /dev/null +++ b/.changes/unreleased/Fixed-20241105-213558.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: Chart.yaml version has to be bumped up manually every PR, but a workflow step will warn you if you didn't do it +time: 2024-11-05T21:35:58.176861476+01:00 diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 7483dce2..39a0dc6e 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -28,11 +28,6 @@ jobs: # E.g. "v0.5.31" -> "0.5.31" args: latest --remove-prefix - - name: update-chart-version-with-release-version - run: | - RELEASE_VERSION=${{ steps.get-latest-no-v-version.outputs.output }} - sed -i 's//'"$RELEASE_VERSION"'/g' ./deploy/ydb-operator/Chart.yaml - - name: create-tag uses: mathieudutour/github-tag-action@v6.2 with: From ad1e82cde42dd4a74cc990e58fd7fa4b669218a4 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 21:49:30 +0100 Subject: [PATCH 38/70] Testing release pipeline, attempt 2 (#262) --- .github/workflows/create-release-pr.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index de6a1270..f8e6bba0 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -36,18 +36,11 @@ jobs: version: latest args: latest --remove-prefix - - name: check-chart-version + - name: bump-chart-version run: | VERSION=${{ steps.latest-no-v.outputs.output }} - APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"') - - if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then - echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so." - exit 1 - else - echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION." - fi + sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" ./deploy/ydb-operator/Chart.yaml + sed -i "s/^version:.*/version: \"$VERSION\"/" ./deploy/ydb-operator/Chart.yaml - name: Create Pull Request uses: peter-evans/create-pull-request@v7 From e540e632d0304024cd80b9bbde2d61a8bacf0a77 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 21:54:07 +0100 Subject: [PATCH 39/70] Correct release notes for 0.5.32 (#264) --- .changes/unreleased/Fixed-20241105-213558.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/unreleased/Fixed-20241105-213558.yaml b/.changes/unreleased/Fixed-20241105-213558.yaml index afade886..195a21d8 100644 --- a/.changes/unreleased/Fixed-20241105-213558.yaml +++ b/.changes/unreleased/Fixed-20241105-213558.yaml @@ -1,3 +1,3 @@ kind: Fixed -body: Chart.yaml version has to be bumped up manually every PR, but a workflow step will warn you if you didn't do it +body: Chart.yaml version is bumped up automatically when a new release PR is created time: 2024-11-05T21:35:58.176861476+01:00 From 65e6382bd59a0947470df32f1833890c585b5f90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:55:31 +0100 Subject: [PATCH 40/70] Release v0.5.32 (#265) Co-authored-by: Jorres <26899407+Jorres@users.noreply.github.com> --- .changes/unreleased/Fixed-20241105-213558.yaml | 3 --- .changes/v0.5.32.md | 3 +++ CHANGELOG.md | 4 ++++ deploy/ydb-operator/Chart.yaml | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 .changes/unreleased/Fixed-20241105-213558.yaml create mode 100644 .changes/v0.5.32.md diff --git a/.changes/unreleased/Fixed-20241105-213558.yaml b/.changes/unreleased/Fixed-20241105-213558.yaml deleted file mode 100644 index 195a21d8..00000000 --- a/.changes/unreleased/Fixed-20241105-213558.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: Chart.yaml version is bumped up automatically when a new release PR is created -time: 2024-11-05T21:35:58.176861476+01:00 diff --git a/.changes/v0.5.32.md b/.changes/v0.5.32.md new file mode 100644 index 00000000..61d2e7f2 --- /dev/null +++ b/.changes/v0.5.32.md @@ -0,0 +1,3 @@ +## v0.5.32 - 2024-11-05 +### Fixed +* Chart.yaml version is bumped up automatically when a new release PR is created diff --git a/CHANGELOG.md b/CHANGELOG.md index 004c0c1b..94e0e4cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## v0.5.32 - 2024-11-05 +### Fixed +* Chart.yaml version is bumped up automatically when a new release PR is created + ## v0.5.31 - 2024-11-04 ### Added * Initialized a changelog diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 44c76e98..297e7771 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.5.31" +version: "0.5.32" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.31" +appVersion: "0.5.32" From 18830f02abd9be4ca62eac4ad97182bed564959d Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 22:05:50 +0100 Subject: [PATCH 41/70] Fix tag extraction for upload-artifacts job (#266) --- .github/workflows/upload-artifacts.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 39a0dc6e..9e500594 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -14,25 +14,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: get-latest-version - uses: miniscruff/changie-action@v2 - with: - version: latest - args: latest - - name: get-latest-no-v-version - uses: miniscruff/changie-action@v2 - with: - version: latest - # Echoes the same version as previous step, but without "v" prefix. - # Is used as a docker image tag in the release step. - # E.g. "v0.5.31" -> "0.5.31" - args: latest --remove-prefix + - name: parse-version-from-chart + run: | + VERSION=$(cat ./deploy/ydb-operator/Chart.yaml | sed -n 's/^version: //p') + echo "VERSION=$VERSION" >> $GITHUB_ENV - name: create-tag uses: mathieudutour/github-tag-action@v6.2 with: - tag_prefix: "" - custom_tag: ${{ steps.get-latest-version.outputs.output }} + tag_prefix: "v" + custom_tag: "$VERSION" github_token: ${{ github.token }} - name: install-dependencies @@ -67,10 +58,6 @@ jobs: yc config --profile private-docker-helm-public-docker set service-account-key sa-key.json env: SA_KEYS_FOR_PRIVATE_DOCKER_HELM_AND_PUBLIC_DOCKER: ${{ secrets.SA_KEYS_FOR_PRIVATE_DOCKER_HELM_AND_PUBLIC_DOCKER }} - - name: parse-version-from-chart - run: | - VERSION=$(cat ./deploy/ydb-operator/Chart.yaml | sed -n 's/^version: //p') - echo "VERSION=$VERSION" >> $GITHUB_ENV - name: login-to-registries run: | cat sa-key.json | docker login --username json_key --password-stdin cr.yandex From 7cf2963eef316e66ada7707b3629018054d8942e Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 22:08:54 +0100 Subject: [PATCH 42/70] Properly escape env variables in release workflow (#267) --- .github/workflows/upload-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 9e500594..d3a4cc46 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -23,7 +23,7 @@ jobs: uses: mathieudutour/github-tag-action@v6.2 with: tag_prefix: "v" - custom_tag: "$VERSION" + custom_tag: ${{ env.VERSION }} github_token: ${{ github.token }} - name: install-dependencies From 7495656076e251230fb9926a5cd64d7e94a893ed Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 22:12:07 +0100 Subject: [PATCH 43/70] Fix escaping of env variables in release workflow once again (#268) --- .github/workflows/upload-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index d3a4cc46..64581e97 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -16,13 +16,13 @@ jobs: - name: parse-version-from-chart run: | - VERSION=$(cat ./deploy/ydb-operator/Chart.yaml | sed -n 's/^version: //p') + VERSION=$(cat ./deploy/ydb-operator/Chart.yaml | sed -n 's/^version: //p' | tr -d '\"') echo "VERSION=$VERSION" >> $GITHUB_ENV - name: create-tag uses: mathieudutour/github-tag-action@v6.2 with: - tag_prefix: "v" + tag_prefix: "" custom_tag: ${{ env.VERSION }} github_token: ${{ github.token }} From 7b7b6a429628cf752971c0832197c08dd22549a8 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 22:26:58 +0100 Subject: [PATCH 44/70] Add 'actually create a release' step to release job (#269) --- .github/workflows/upload-artifacts.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 64581e97..1372ed39 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -94,3 +94,20 @@ jobs: aws s3 --endpoint-url=https://storage.yandexcloud.net \ cp ./charts/index.yaml s3://charts.ydb.tech/index.yaml + + - name: append-artifacts-info-to-release-notes + run: | + echo "New docker images are available from:" >> .changes/v$VERSION.md + echo "- ydbplatform/ydb-kubernetes-operator:$VERSION" >> .changes/v$VERSION.md + echo "- cr.yandex/yc/ydb-kubernetes-operator:$VERSION" >> .changes/v$VERSION.md + echo "" >> .changes/v$VERSION.md + + echo "New helm chart `ydb-operator`, version $VERSION is available from charts.ydb.tech." >> .changes/v$VERSION.md + + - name: create-github-release + uses: softprops/action-gh-release@v1 + with: + body_path: .changes/v${{ env.VERSION }}.md + tag_name: ${{ env.VERSION }} + env: + GITHUB_TOKEN: ${{ github.token }} From 181a39dc96bc0742dae26de0ee772e8335ea00cc Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Tue, 5 Nov 2024 22:34:01 +0100 Subject: [PATCH 45/70] Clean up release template notes (#270) --- .github/workflows/upload-artifacts.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 1372ed39..f44b5d38 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -97,12 +97,16 @@ jobs: - name: append-artifacts-info-to-release-notes run: | + echo "" >> .changes/v$VERSION.md + + echo "### Docker images" >> .changes/v$VERSION.md echo "New docker images are available from:" >> .changes/v$VERSION.md echo "- ydbplatform/ydb-kubernetes-operator:$VERSION" >> .changes/v$VERSION.md echo "- cr.yandex/yc/ydb-kubernetes-operator:$VERSION" >> .changes/v$VERSION.md echo "" >> .changes/v$VERSION.md - echo "New helm chart `ydb-operator`, version $VERSION is available from charts.ydb.tech." >> .changes/v$VERSION.md + echo "### Helm charts" >> .changes/v$VERSION.md + echo "New helm chart 'ydb-operator', version $VERSION is available from https://charts.ydb.tech" >> .changes/v$VERSION.md - name: create-github-release uses: softprops/action-gh-release@v1 From 8cc391ac713465ad3a800bf36a5f9091f6c2d20d Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Wed, 13 Nov 2024 23:04:59 +0100 Subject: [PATCH 46/70] Release docker image to dockerhub as well (#259) --- .../unreleased/Added-20241113-181628.yaml | 3 + .../unreleased/Fixed-20241113-214512.yaml | 3 + .github/workflows/upload-artifacts.yml | 11 +++ .golangci.yml | 2 +- e2e/tests/smoke_test.go | 79 +++++++------------ .../controllers/database/controller_test.go | 4 +- 6 files changed, 50 insertions(+), 52 deletions(-) create mode 100644 .changes/unreleased/Added-20241113-181628.yaml create mode 100644 .changes/unreleased/Fixed-20241113-214512.yaml diff --git a/.changes/unreleased/Added-20241113-181628.yaml b/.changes/unreleased/Added-20241113-181628.yaml new file mode 100644 index 00000000..ac1658a2 --- /dev/null +++ b/.changes/unreleased/Added-20241113-181628.yaml @@ -0,0 +1,3 @@ +kind: Added +body: starting with this release, deploying to dockerhub (ydbplatform/ydb-kubernetes-operator) +time: 2024-11-13T18:16:28.275365313+01:00 diff --git a/.changes/unreleased/Fixed-20241113-214512.yaml b/.changes/unreleased/Fixed-20241113-214512.yaml new file mode 100644 index 00000000..b5688449 --- /dev/null +++ b/.changes/unreleased/Fixed-20241113-214512.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: e2e tests and unit tests flapped because of the race between storage finalizers and uninstalling operator helm chart +time: 2024-11-13T21:45:12.19273022+01:00 diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index f44b5d38..441630a4 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -67,6 +67,7 @@ jobs: # Public: docker build -t cr.yandex/crpl7ipeu79oseqhcgn2/ydb-operator:"$VERSION" . docker push cr.yandex/crpl7ipeu79oseqhcgn2/ydb-operator:"$VERSION" + # Private: # no rebuild will happen, docker will fetch from cache and just retag: docker build -t cr.yandex/crpsjg1coh47p81vh2lc/ydb-kubernetes-operator:"$VERSION" . @@ -95,6 +96,16 @@ jobs: aws s3 --endpoint-url=https://storage.yandexcloud.net \ cp ./charts/index.yaml s3://charts.ydb.tech/index.yaml + - name: login-to-dockerhub + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + username: ydbplatform + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: retag-and-push-operator-image-to-dockerhub + run: | + docker build -t ydbplatform/ydb-kubernetes-operator:"$VERSION" . + docker push ydbplatform/ydb-kubernetes-operator:"$VERSION" + - name: append-artifacts-info-to-release-notes run: | echo "" >> .changes/v$VERSION.md diff --git a/.golangci.yml b/.golangci.yml index 54552669..b980d72f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ run: concurrency: 4 # timeout for analysis, e.g. 30s, 5m, default is 1m - deadline: 5m + timeout: 5m # exit code when at least one issue was found, default is 1 issues-exit-code: 1 diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index f612a4b2..d7857112 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -146,6 +146,22 @@ func checkPodsRunningAndReady(ctx context.Context, podLabelKey, podLabelValue st }, test.Timeout, test.Interval).Should(BeTrue()) } +func deleteStorageSafely(ctx context.Context, storageSample *v1alpha1.Storage) { + // not checking that deletion completed successfully + // because some tests delete storage themselves and + // it may already be deleted. + _ = k8sClient.Delete(ctx, storageSample) + + Eventually(func() bool { + fetched := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &fetched) + return apierrors.IsNotFound(err) + }, Timeout, Interval).Should(BeTrue()) +} + func bringYdbCliToPod(podName, podNamespace string) { Eventually(func(g Gomega) error { args := []string{ @@ -305,9 +321,7 @@ var _ = Describe("Operator smoke test", func() { It("Check webhook defaulter", func() { emptyStorageDefaultFields(storageSample) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) emptyDatabaseDefaultFields(databaseSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) @@ -330,17 +344,13 @@ var _ = Describe("Operator smoke test", func() { }, } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) }) It("general smoke pipeline, create storage + database", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) @@ -381,9 +391,7 @@ var _ = Describe("Operator smoke test", func() { It("pause and un-pause Storage, should destroy and bring up Pods", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) @@ -431,9 +439,7 @@ var _ = Describe("Operator smoke test", func() { It("freeze + delete StatefulSet + un-freeze Storage", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) @@ -503,20 +509,6 @@ var _ = Describe("Operator smoke test", func() { By("checking that all the storage pods are running and ready...") checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) - - /* - // This test suite attempts to create a database on uninitialised storage - - By("database can be healthily created after Frozen storage...") - Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) - }() - By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) - By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) - */ }) It("create storage and database with nodeSets", func() { @@ -538,9 +530,7 @@ var _ = Describe("Operator smoke test", func() { }) } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) @@ -619,9 +609,7 @@ var _ = Describe("Operator smoke test", func() { }, } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) @@ -632,9 +620,7 @@ var _ = Describe("Operator smoke test", func() { It("storage.State goes Pending -> Preparing -> Initializing -> Provisioning -> Ready", func() { Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) @@ -688,9 +674,7 @@ var _ = Describe("Operator smoke test", func() { Key: "ca.crt", } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("waiting until Storage is ready...") waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) @@ -742,6 +726,7 @@ var _ = Describe("Operator smoke test", func() { It("Check that Storage deleted after Database...", func() { By("create storage...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer deleteStorageSafely(ctx, storageSample) By("create database...") Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) @@ -803,9 +788,7 @@ var _ = Describe("Operator smoke test", func() { storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-dynconfig.yaml")) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) storage := v1alpha1.Storage{} By("waiting until StorageInitialized condition is true...") @@ -919,9 +902,7 @@ var _ = Describe("Operator smoke test", func() { }, } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("create database...") databaseSample.Spec.Nodes = 1 @@ -959,9 +940,7 @@ var _ = Describe("Operator smoke test", func() { It("Check encryption for Database", func() { By("create storage...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer func() { - Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) - }() + defer deleteStorageSafely(ctx, storageSample) By("create database...") databaseSample.Spec.Encryption = &v1alpha1.EncryptionConfig{ Enabled: true, diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index 747d070c..8a9490cd 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -56,6 +56,7 @@ func TestAPIs(t *testing.T) { var _ = Describe("Database controller medium tests", func() { var namespace corev1.Namespace var storageSample v1alpha1.Storage + var databaseSample v1alpha1.Database BeforeEach(func() { namespace = corev1.Namespace{ @@ -94,6 +95,7 @@ var _ = Describe("Database controller medium tests", func() { }) AfterEach(func() { + Expect(k8sClient.Delete(ctx, &databaseSample)).Should(Succeed()) Expect(k8sClient.Delete(ctx, &storageSample)).Should(Succeed()) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) test.DeleteAllObjects(env, k8sClient, &namespace) @@ -101,7 +103,7 @@ var _ = Describe("Database controller medium tests", func() { It("Checking field propagation to objects", func() { By("Check that Shared Database was created...") - databaseSample := *testobjects.DefaultDatabase() + databaseSample = *testobjects.DefaultDatabase() databaseSample.Spec.SharedResources = &v1alpha1.DatabaseResources{ StorageUnits: []v1alpha1.StorageUnit{ { From 5827395fdb732d17c1ccbe156d341aed1c6557aa Mon Sep 17 00:00:00 2001 From: Sergey J Date: Tue, 19 Nov 2024 01:44:20 +0300 Subject: [PATCH 47/70] Add dns domain select (#273) --------- Co-authored-by: Sergey J Co-authored-by: Sergey Ierusalimov --- .changes/unreleased/Added-20241118-222810.yaml | 4 ++++ .changes/unreleased/Changed-20241118-222537.yaml | 3 +++ .changes/unreleased/Security-20241118-222433.yaml | 3 +++ Makefile | 4 ++-- api/v1alpha1/const.go | 7 +++++-- api/v1alpha1/storage_webhook.go | 6 +++++- api/v1alpha1/zz_generated.deepcopy.go | 1 - go.mod | 2 +- go.sum | 4 ++-- internal/resources/database_statefulset.go | 12 ++++++++++-- internal/resources/storage_init_job.go | 6 +++++- internal/resources/storage_statefulset.go | 6 +++++- 12 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 .changes/unreleased/Added-20241118-222810.yaml create mode 100644 .changes/unreleased/Changed-20241118-222537.yaml create mode 100644 .changes/unreleased/Security-20241118-222433.yaml diff --git a/.changes/unreleased/Added-20241118-222810.yaml b/.changes/unreleased/Added-20241118-222810.yaml new file mode 100644 index 00000000..7c6c51ef --- /dev/null +++ b/.changes/unreleased/Added-20241118-222810.yaml @@ -0,0 +1,4 @@ +kind: Added +body: 'added the ability to create metadata announce for customize dns domain (default: + cluster.local)' +time: 2024-11-18T22:28:10.452679+03:00 diff --git a/.changes/unreleased/Changed-20241118-222537.yaml b/.changes/unreleased/Changed-20241118-222537.yaml new file mode 100644 index 00000000..53d107cc --- /dev/null +++ b/.changes/unreleased/Changed-20241118-222537.yaml @@ -0,0 +1,3 @@ +kind: Changed +body: up CONTROLLER_GEN_VERSION to 0.16.5 and ENVTEST_VERSION to release-0.17 +time: 2024-11-18T22:25:37.274092+03:00 diff --git a/.changes/unreleased/Security-20241118-222433.yaml b/.changes/unreleased/Security-20241118-222433.yaml new file mode 100644 index 00000000..af068092 --- /dev/null +++ b/.changes/unreleased/Security-20241118-222433.yaml @@ -0,0 +1,3 @@ +kind: Security +body: bump golang-jwt to v4.5.1 (by dependabot) +time: 2024-11-18T22:24:33.337464+03:00 diff --git a/Makefile b/Makefile index 1b34ec1a..0ec43998 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ docker-push: ## Push docker image with the manager. docker push ${IMG} CONTROLLER_GEN = $(shell pwd)/bin/controller-gen -CONTROLLER_GEN_VERSION ?= v0.6.1 +CONTROLLER_GEN_VERSION ?= v0.16.5 controller-gen: ## Download controller-gen locally if necessary. $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)) @@ -114,7 +114,7 @@ controller-gen: ## Download controller-gen locally if necessary. # Version pinning is needed due to version incompatibility between controller-runtime and setup-envtest. # For more information: https://github.com/kubernetes-sigs/controller-runtime/issues/2744 ENVTEST = $(shell pwd)/bin/setup-envtest -ENVTEST_VERSION ?= release-0.16 +ENVTEST_VERSION ?= release-0.17 envtest: ## Download envtest-setup locally if necessary. $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION)) diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index 293647e7..6f6e9f6a 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -6,15 +6,18 @@ const ( ImagePathFormat = "%s:%s" + DefaultDomainName = "cluster.local" + DNSDomainAnnotation = "dns.domain" + GRPCPort = 2135 GRPCServicePortName = "grpc" GRPCProto = "grpc://" GRPCSProto = "grpcs://" - GRPCServiceFQDNFormat = "%s-grpc.%s.svc.cluster.local" + GRPCServiceFQDNFormat = "%s-grpc.%s.svc.%s" InterconnectPort = 19001 InterconnectServicePortName = "interconnect" - InterconnectServiceFQDNFormat = "%s-interconnect.%s.svc.cluster.local" + InterconnectServiceFQDNFormat = "%s-interconnect.%s.svc.%s" StatusPort = 8765 StatusServicePortName = "status" diff --git a/api/v1alpha1/storage_webhook.go b/api/v1alpha1/storage_webhook.go index 353d9e2f..d6be5085 100644 --- a/api/v1alpha1/storage_webhook.go +++ b/api/v1alpha1/storage_webhook.go @@ -54,7 +54,11 @@ func (r *Storage) GetStorageEndpoint() string { } func (r *Storage) GetGRPCServiceEndpoint() string { - host := fmt.Sprintf(GRPCServiceFQDNFormat, r.Name, r.Namespace) + domain := DefaultDomainName + if dnsAnnotation, ok := r.GetAnnotations()[DNSDomainAnnotation]; ok { + domain = dnsAnnotation + } + host := fmt.Sprintf(GRPCServiceFQDNFormat, r.Name, r.Namespace, domain) if r.Spec.Service.GRPC.ExternalHost != "" { host = r.Spec.Service.GRPC.ExternalHost } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index fd2ad4a1..60e8f7a2 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. diff --git a/go.mod b/go.mod index 788f6f54..d862ad64 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/banzaicloud/k8s-objectmatcher v1.7.0 github.com/go-logr/logr v1.2.4 - github.com/golang-jwt/jwt/v4 v4.4.1 + github.com/golang-jwt/jwt/v4 v4.5.1 github.com/google/go-cmp v0.5.9 github.com/onsi/ginkgo/v2 v2.9.4 github.com/onsi/gomega v1.27.6 diff --git a/go.sum b/go.sum index 88222cae..fb940a91 100644 --- a/go.sum +++ b/go.sum @@ -173,8 +173,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 5d9c63c9..20964efa 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -100,6 +100,10 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar { } func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpec { + domain := api.DefaultDomainName + if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { + domain = dnsAnnotation + } podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: b.Labels, @@ -118,7 +122,7 @@ func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSp DNSConfig: &corev1.PodDNSConfig{ Searches: []string{ - fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Spec.StorageClusterRef.Name, b.Spec.StorageClusterRef.Namespace), + fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Spec.StorageClusterRef.Name, b.Spec.StorageClusterRef.Namespace, domain), }, }, }, @@ -541,6 +545,10 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { } func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { + domain := api.DefaultDomainName + if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { + domain = dnsAnnotation + } command := []string{fmt.Sprintf("%s/%s", api.BinariesDir, api.DaemonBinaryName)} args := []string{ @@ -633,7 +641,7 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { } publicHostOption := "--grpc-public-host" - publicHost := fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Database.Name, b.GetNamespace()) // FIXME .svc.cluster.local + publicHost := fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Database.Name, b.GetNamespace(), domain) // FIXME .svc.cluster.local if b.Spec.Service.GRPC.ExternalHost != "" { publicHost = b.Spec.Service.GRPC.ExternalHost diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index f5399c20..a18cbd7c 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -84,8 +84,12 @@ func GetInitJobBuilder(storage *api.Storage) ResourceBuilder { } func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplateSpec { + domain := api.DefaultDomainName + if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { + domain = dnsAnnotation + } dnsConfigSearches := []string{ - fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Storage.Name, b.GetNamespace()), + fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Storage.Name, b.GetNamespace(), domain), } podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 23576227..f4ec2d3a 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -104,8 +104,12 @@ func (b *StorageStatefulSetBuilder) Build(obj client.Object) error { } func (b *StorageStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpec { + domain := api.DefaultDomainName + if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { + domain = dnsAnnotation + } dnsConfigSearches := []string{ - fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Storage.Name, b.GetNamespace()), + fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Storage.Name, b.GetNamespace(), domain), } podTemplate := corev1.PodTemplateSpec{ From cab74c48fe84647a618cf4c7104847d870edf732 Mon Sep 17 00:00:00 2001 From: Sergey J Date: Tue, 19 Nov 2024 01:45:52 +0300 Subject: [PATCH 48/70] up version controller gen (#272) * up version controller gen * up version controller gen * up version controller gen * up version controller gen * up version controller gen * up version controller gen * up version controller gen --------- Co-authored-by: Sergey J From fd95db4540ccf3e3e793ab06b838a24ad1b7cc18 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Wed, 4 Dec 2024 12:24:23 +0100 Subject: [PATCH 49/70] Regenerate crds with new controller-gen (#274) --- .../unreleased/Fixed-20241129-213809.yaml | 3 + .github/workflows/upload-artifacts.yml | 2 + Makefile | 4 +- deploy/ydb-operator/crds/database.yaml | 4903 +++++++------- .../ydb-operator/crds/databasemonitoring.yaml | 75 +- deploy/ydb-operator/crds/databasenodeset.yaml | 3764 ++++++----- .../crds/remotedatabasenodeset.yaml | 3817 +++++------ .../crds/remotestoragenodeset.yaml | 3908 +++++------ deploy/ydb-operator/crds/storage.yaml | 5982 ++++++++--------- .../ydb-operator/crds/storagemonitoring.yaml | 75 +- deploy/ydb-operator/crds/storagenodeset.yaml | 3855 +++++------ 11 files changed, 13129 insertions(+), 13259 deletions(-) create mode 100644 .changes/unreleased/Fixed-20241129-213809.yaml diff --git a/.changes/unreleased/Fixed-20241129-213809.yaml b/.changes/unreleased/Fixed-20241129-213809.yaml new file mode 100644 index 00000000..bb3a9eb1 --- /dev/null +++ b/.changes/unreleased/Fixed-20241129-213809.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: regenerate CRDs in upload-artifacts workflow (as opposed to manually) +time: 2024-11-29T21:38:09.848071991+01:00 diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 441630a4..030106fe 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -74,6 +74,8 @@ jobs: docker push cr.yandex/crpsjg1coh47p81vh2lc/ydb-kubernetes-operator:"$VERSION" - name: package-and-push-helm-chart run: | + make manifests + helm package ./deploy/ydb-operator # Push into internal oci-based registry diff --git a/Makefile b/Makefile index 0ec43998..967c8c19 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,6 @@ VERSION ?= 0.1.0 # Image URL to use all building/pushing image targets IMG ?= cr.yandex/yc/ydb-operator:latest -# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false" # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.26 @@ -46,7 +44,7 @@ help: ## Display this help. ##@ Development manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) crd rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases cp config/crd/bases/ydb.tech_storages.yaml deploy/ydb-operator/crds/storage.yaml cp config/crd/bases/ydb.tech_databases.yaml deploy/ydb-operator/crds/database.yaml cp config/crd/bases/ydb.tech_storagenodesets.yaml deploy/ydb-operator/crds/storagenodeset.yaml diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index 1bee889b..a80c30d8 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: databases.ydb.tech spec: group: ydb.tech @@ -30,14 +28,19 @@ spec: description: Database is the Schema for the databases 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' + 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' + 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 @@ -64,22 +67,20 @@ spec: 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. + 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). + 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 @@ -89,30 +90,26 @@ spec: 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. + 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. + 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. + 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 @@ -125,30 +122,26 @@ spec: 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. + 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. + 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. + 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 @@ -158,6 +151,7 @@ spec: 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. @@ -169,50 +163,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -225,30 +215,26 @@ spec: 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. + 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. + 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. + 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 @@ -258,26 +244,27 @@ spec: 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 + 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 @@ -296,28 +283,24 @@ spec: 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 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: |- + 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 + 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 @@ -330,50 +313,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -386,39 +363,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -427,23 +402,22 @@ spec: 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. + 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 + 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, @@ -453,26 +427,25 @@ spec: 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 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: |- + 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. + 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 @@ -484,46 +457,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -535,31 +506,28 @@ spec: 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. + 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". + 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. + 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: @@ -573,16 +541,15 @@ spec: 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 + 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 @@ -601,28 +568,24 @@ spec: 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 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: |- + 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 + 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 @@ -635,50 +598,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -691,39 +648,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -732,23 +687,22 @@ spec: 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. + 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 + 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, @@ -758,26 +712,25 @@ spec: 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 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: |- + 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. + 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 @@ -789,46 +742,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -840,31 +791,28 @@ spec: 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. + 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". + 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. + 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: @@ -874,8 +822,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -891,8 +840,9 @@ spec: type: object domain: default: Root - description: '(Optional) Name of the root storage domain Default: - Root' + description: |- + (Optional) Name of the root storage domain + Default: Root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string @@ -909,8 +859,9 @@ spec: a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key must be @@ -919,6 +870,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic pin: type: string required: @@ -928,57 +880,60 @@ spec: description: (Optional) YDB Image properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -989,16 +944,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1011,10 +966,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1023,12 +977,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1041,12 +994,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1066,6 +1018,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1075,10 +1028,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1087,19 +1039,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1108,15 +1061,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1125,51 +1079,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1178,9 +1135,9 @@ spec: 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. + 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. @@ -1190,9 +1147,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1209,22 +1166,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1234,40 +1193,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1276,9 +1232,9 @@ spec: 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. + 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. @@ -1288,9 +1244,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1307,22 +1263,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1332,9 +1290,10 @@ spec: 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. + 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 @@ -1342,36 +1301,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1379,10 +1338,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1391,9 +1352,9 @@ spec: 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. + 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 @@ -1403,9 +1364,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1422,33 +1383,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1463,78 +1426,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1546,36 +1513,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1583,10 +1550,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1595,9 +1564,9 @@ spec: 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. + 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 @@ -1607,9 +1576,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1626,33 +1595,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1667,54 +1638,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1731,8 +1706,9 @@ spec: - 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/' + 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: @@ -1741,33 +1717,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1785,60 +1762,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -1858,108 +1835,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1967,10 +1937,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1979,9 +1951,9 @@ spec: 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. + 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 @@ -1991,9 +1963,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2010,33 +1982,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2051,77 +2025,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2144,40 +2117,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2185,17 +2162,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -2206,10 +2186,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -2225,26 +2205,26 @@ spec: 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' + 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 + 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. + 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 @@ -2254,13 +2234,15 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodeSets: - description: '(Optional) NodeSet inline configuration to split into - multiple StatefulSets Default: (not specified)' + description: |- + (Optional) NodeSet inline configuration to split into multiple StatefulSets + Default: (not specified) items: description: DatabaseNodeSetSpecInline describes an group nodes object inside parent object @@ -2285,22 +2267,20 @@ spec: 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. + 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). + 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 @@ -2310,32 +2290,26 @@ spec: 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. + 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. + 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. + 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 @@ -2348,32 +2322,26 @@ spec: 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. + 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. + 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. + 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 @@ -2383,6 +2351,7 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic weight: description: Weight associated with matching the corresponding nodeSelectorTerm, in the range @@ -2395,53 +2364,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -2454,32 +2416,26 @@ spec: 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. + 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. + 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. + 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 @@ -2489,10 +2445,12 @@ spec: 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. @@ -2500,18 +2458,16 @@ spec: 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. + 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 @@ -2530,29 +2486,24 @@ spec: 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 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: |- + 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 + 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 @@ -2565,52 +2516,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -2623,43 +2566,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -2668,24 +2605,22 @@ spec: 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. + 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 + 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, @@ -2696,28 +2631,24 @@ spec: 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 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: |- + 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 + 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 @@ -2730,50 +2661,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -2786,34 +2711,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -2826,18 +2746,16 @@ spec: 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. + 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 @@ -2856,29 +2774,24 @@ spec: 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 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: |- + 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 + 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 @@ -2891,52 +2804,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -2949,43 +2854,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -2994,24 +2893,22 @@ spec: 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. + 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 + 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, @@ -3022,28 +2919,24 @@ spec: 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 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: |- + 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 + 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 @@ -3056,50 +2949,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -3112,34 +2999,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -3163,10 +3045,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must - be true for the pod to fit on a node. Selector which must - match a node''s labels for the pod to be scheduled on that - node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) in the cluster @@ -3189,23 +3071,28 @@ spec: description: (Optional) Database storage and compute resources properties: containerResources: - description: '(Optional) Database container resource limits. - Any container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where - this field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -3222,8 +3109,9 @@ spec: - 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/' + 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: @@ -3232,17 +3120,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. items: properties: count: @@ -3250,38 +3139,46 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine - guarantees for all main unit parameters: used hard - disk type, capacity throughput, IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object sharedResources: description: (Optional) Shared resources can be used by serverless databases. properties: containerResources: - description: '(Optional) Database container resource limits. - Any container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where - this field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -3298,8 +3195,9 @@ spec: - 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/' + 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: @@ -3308,17 +3206,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. items: properties: count: @@ -3326,15 +3225,18 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine - guarantees for all main unit parameters: used hard - disk type, capacity throughput, IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object terminationGracePeriodSeconds: description: (Optional) If specified, the pod's terminationGracePeriodSeconds. @@ -3343,63 +3245,62 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. - Pods that match this label selector are counted to determine - the number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. properties: key: @@ -3407,17 +3308,16 @@ spec: 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: |- + 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. + 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 @@ -3429,130 +3329,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys - to select the pods over which spreading will be calculated. - The keys are used to lookup values from the incoming - pod labels, those key-value labels are ANDed with labelSelector - to select the group of existing pods over which spreading - will be calculated for the incoming pod. Keys that don't - exist in the incoming pod labels will be ignored. A - null or empty list means only match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods - may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global - minimum. The global minimum is the minimum number of - matching pods in an eligible domain or zero if the number - of eligible domains is less than MinDomains. For example, - in a 3-zone cluster, MaxSkew is set to 1, and pods with - the same labelSelector spread as 2/2/1: In this case, - the global minimum is 1. | zone1 | zone2 | zone3 | | P - P | P P | P | - if MaxSkew is 1, incoming pod - can only be scheduled to zone3 to become 2/2/2; scheduling - it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is - 2, incoming pod can be scheduled onto any zone. When - `whenUnsatisfiable=ScheduleAnyway`, it is used to give - higher precedence to topologies that satisfy it. It''s - a required field. Default value is 1 and 0 is not allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of - eligible domains. When the number of eligible domains - with matching topology keys is less than minDomains, - Pod Topology Spread treats \"global minimum\" as 0, - and then the calculation of Skew is performed. And when - the number of eligible domains with matching topology - keys equals or greater than minDomains, this value has - no effect on scheduling. As a result, when the number - of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. - If value is nil, the constraint behaves as if MinDomains - is equal to 1. Valid values are integers greater than - 0. When value is not nil, WhenUnsatisfiable must be - DoNotSchedule. \n For example, in a 3-zone cluster, - MaxSkew is set to 2, MinDomains is set to 5 and pods - with the same labelSelector spread as 2/2/2: | zone1 - | zone2 | zone3 | | P P | P P | P P | The number - of domains is less than 5(MinDomains), so \"global minimum\" - is treated as 0. In this situation, new pod with the - same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any - of the three zones, it will violate MaxSkew. \n This - is a beta field and requires the MinDomainsInPodTopologySpread - feature gate to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will - treat Pod's nodeAffinity/nodeSelector when calculating - pod topology spread skew. Options are: - Honor: only - nodes matching nodeAffinity/nodeSelector are included - in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. - \n If this value is nil, the behavior is equivalent - to the Honor policy. This is a beta-level feature default - enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat - node taints when calculating pod topology spread skew. - Options are: - Honor: nodes without taints, along with - tainted nodes for which the incoming pod has a toleration, - are included. - Ignore: node taints are ignored. All - nodes are included. \n If this value is nil, the behavior - is equivalent to the Ignore policy. This is a beta-level - feature default enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. + - Ignore: node taints are ignored. All nodes are included. + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes - that have a label with this key and identical values - are considered to be in the same topology. We consider - each as a "bucket", and try to put balanced - number of pods into each bucket. We define a domain - as a particular instance of a topology. Also, we define - an eligible domain as a domain whose nodes meet the - requirements of nodeAffinityPolicy and nodeTaintsPolicy. - e.g. If TopologyKey is "kubernetes.io/hostname", each - Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain - of that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal - with a pod if it doesn''t satisfy the spread constraint. - - DoNotSchedule (default) tells the scheduler not to - schedule it. - ScheduleAnyway tells the scheduler to - schedule the pod in any location, but giving higher - precedence to topologies that would help reduce the skew. - A constraint is considered "Unsatisfiable" for an incoming - pod if and only if every possible node assignment for - that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and - pods with the same labelSelector spread as 3/1/1: | - zone1 | zone2 | zone3 | | P P P | P | P | If - WhenUnsatisfiable is set to DoNotSchedule, incoming - pod can only be scheduled to zone2(zone3) to become - 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies - MaxSkew(1). In other words, the cluster can still be - imbalanced, but scheduler won''t make it *more* imbalanced. - It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -3565,6 +3460,7 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map required: + - name - nodes type: object type: array @@ -3574,24 +3470,25 @@ spec: type: integer operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Database - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Database resource. type: boolean path: - description: '(Optional) Custom database path in schemeshard Default: - //' + description: |- + (Optional) Custom database path in schemeshard + Default: // maxLength: 255 pattern: /[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?(/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?)* type: string pause: default: false - description: The state of the Database processes. `true` means all - the Database Pods are being killed, but the Database resource is - persisted. `false` means the default state of the system, all Pods - running. + description: |- + The state of the Database processes. + `true` means all the Database Pods are being killed, but the Database resource is persisted. + `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. @@ -3600,23 +3497,28 @@ spec: description: (Optional) Database storage and compute resources properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3632,8 +3534,9 @@ spec: - 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/' + 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: @@ -3642,16 +3545,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -3659,28 +3564,35 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array serverlessResources: description: (Optional) If specified, created database will be "serverless". @@ -3704,8 +3616,9 @@ spec: - sharedDatabaseRef type: object service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: datastreams: properties: @@ -3719,9 +3632,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -3738,9 +3651,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3749,6 +3662,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -3757,9 +3671,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3768,6 +3682,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -3778,9 +3693,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3789,6 +3704,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -3810,9 +3726,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -3821,9 +3737,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -3840,9 +3756,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3851,6 +3767,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -3859,9 +3776,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3870,6 +3787,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -3880,9 +3798,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3891,6 +3809,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -3907,9 +3826,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -3926,9 +3845,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3937,6 +3856,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -3945,9 +3865,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3956,6 +3876,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -3966,9 +3887,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -3977,6 +3898,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -3993,9 +3915,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -4012,9 +3934,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -4023,6 +3945,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -4031,9 +3954,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -4042,6 +3965,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -4052,9 +3976,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -4063,6 +3987,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -4073,23 +3998,28 @@ spec: databases. properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -4105,8 +4035,9 @@ spec: - 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/' + 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: @@ -4115,16 +4046,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -4132,15 +4065,18 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object storageClusterRef: description: YDB Storage cluster reference @@ -4166,78 +4102,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -4249,121 +4186,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -4376,46 +4317,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -4437,10 +4381,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -4449,8 +4393,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -4461,8 +4406,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -4480,8 +4426,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -4490,59 +4437,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -4552,27 +4510,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -4580,22 +4536,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4603,54 +4558,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -4660,16 +4619,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -4694,16 +4652,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -4714,10 +4671,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -4737,113 +4693,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -4857,46 +4825,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -4907,45 +4867,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -4961,8 +4917,9 @@ spec: - 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/' + 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: @@ -4971,12 +4928,11 @@ spec: - 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/' + 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 selector: @@ -4988,28 +4944,24 @@ spec: 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 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: |- + 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 + 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 @@ -5022,23 +4974,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -5055,19 +5006,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -5076,26 +5027,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -5104,22 +5056,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -5129,9 +5084,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -5139,52 +5094,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -5197,51 +5154,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -5252,55 +5216,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -5308,43 +5274,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -5354,10 +5328,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -5371,14 +5345,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -5391,14 +5366,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -5412,17 +5386,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -5431,25 +5402,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -5457,16 +5424,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -5496,18 +5463,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -5519,10 +5483,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -5544,6 +5507,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -5554,17 +5518,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -5573,25 +5534,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -5599,44 +5556,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -5649,28 +5603,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -5681,53 +5637,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -5738,9 +5707,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -5751,26 +5722,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -5782,9 +5756,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -5792,31 +5766,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -5824,22 +5797,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -5851,8 +5823,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -5860,39 +5833,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -5900,10 +5875,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -5935,45 +5910,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -5988,10 +5953,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -6013,9 +5974,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/databasemonitoring.yaml b/deploy/ydb-operator/crds/databasemonitoring.yaml index c3212b7b..22545d8e 100644 --- a/deploy/ydb-operator/crds/databasemonitoring.yaml +++ b/deploy/ydb-operator/crds/databasemonitoring.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: databasemonitorings.ydb.tech spec: group: ydb.tech @@ -31,14 +29,19 @@ spec: 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' + 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' + 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 @@ -73,45 +76,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -126,10 +119,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -151,9 +140,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 74aebcac..069ac66b 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: databasenodesets.ydb.tech spec: group: ydb.tech @@ -30,14 +28,19 @@ spec: description: DatabaseNodeSet declares StatefulSet parameters for storageRef 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' + 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' + 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 @@ -65,22 +68,20 @@ spec: 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. + 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). + 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 @@ -90,30 +91,26 @@ spec: 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. + 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. + 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. + 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 @@ -126,30 +123,26 @@ spec: 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. + 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. + 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. + 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 @@ -159,6 +152,7 @@ spec: 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. @@ -170,50 +164,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -226,30 +216,26 @@ spec: 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. + 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. + 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. + 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 @@ -259,26 +245,27 @@ spec: 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 + 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 @@ -297,28 +284,24 @@ spec: 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 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: |- + 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 + 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 @@ -331,50 +314,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -387,39 +364,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -428,23 +403,22 @@ spec: 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. + 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 + 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, @@ -454,26 +428,25 @@ spec: 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 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: |- + 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. + 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 @@ -485,46 +458,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -536,31 +507,28 @@ spec: 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. + 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". + 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. + 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: @@ -574,16 +542,15 @@ spec: 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 + 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 @@ -602,28 +569,24 @@ spec: 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 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: |- + 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 + 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 @@ -636,50 +599,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -692,39 +649,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -733,23 +688,22 @@ spec: 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. + 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 + 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, @@ -759,26 +713,25 @@ spec: 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 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: |- + 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. + 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 @@ -790,46 +743,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -841,31 +792,28 @@ spec: 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. + 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". + 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. + 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: @@ -875,8 +823,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -906,8 +855,9 @@ spec: type: object domain: default: Root - description: '(Optional) Name of the root storage domain Default: - Root' + description: |- + (Optional) Name of the root storage domain + Default: Root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string @@ -924,8 +874,9 @@ spec: a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key must be @@ -934,6 +885,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic pin: type: string required: @@ -943,57 +895,60 @@ spec: description: (Optional) YDB Image properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -1004,16 +959,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1026,10 +981,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1038,12 +992,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1056,12 +1009,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1081,6 +1033,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1090,10 +1043,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1102,19 +1054,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1123,15 +1076,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1140,51 +1094,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1193,9 +1150,9 @@ spec: 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. + 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. @@ -1205,9 +1162,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1224,22 +1181,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1249,40 +1208,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1291,9 +1247,9 @@ spec: 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. + 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. @@ -1303,9 +1259,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1322,22 +1278,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1347,9 +1305,10 @@ spec: 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. + 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 @@ -1357,36 +1316,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1394,10 +1353,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1406,9 +1367,9 @@ spec: 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. + 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 @@ -1418,9 +1379,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1437,33 +1398,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1478,78 +1441,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1561,36 +1528,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1598,10 +1565,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1610,9 +1579,9 @@ spec: 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. + 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 @@ -1622,9 +1591,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1641,33 +1610,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1682,54 +1653,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1746,8 +1721,9 @@ spec: - 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/' + 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: @@ -1756,33 +1732,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1800,60 +1777,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -1873,108 +1850,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1982,10 +1952,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1994,9 +1966,9 @@ spec: 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. + 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 @@ -2006,9 +1978,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2025,33 +1997,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2066,77 +2040,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2159,40 +2132,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2200,17 +2177,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -2221,10 +2201,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -2240,26 +2220,26 @@ spec: 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' + 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 + 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. + 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 @@ -2269,9 +2249,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) in the cluster @@ -2279,24 +2260,25 @@ spec: type: integer operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Database - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Database resource. type: boolean path: - description: '(Optional) Custom database path in schemeshard Default: - //' + description: |- + (Optional) Custom database path in schemeshard + Default: // maxLength: 255 pattern: /[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?(/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?)* type: string pause: default: false - description: The state of the Database processes. `true` means all - the Database Pods are being killed, but the Database resource is - persisted. `false` means the default state of the system, all Pods - running. + description: |- + The state of the Database processes. + `true` means all the Database Pods are being killed, but the Database resource is persisted. + `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. @@ -2305,23 +2287,28 @@ spec: description: (Optional) Database storage and compute resources properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2337,8 +2324,9 @@ spec: - 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/' + 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: @@ -2347,16 +2335,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -2364,28 +2354,35 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array serverlessResources: description: (Optional) If specified, created database will be "serverless". @@ -2409,8 +2406,9 @@ spec: - sharedDatabaseRef type: object service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: datastreams: properties: @@ -2424,9 +2422,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2443,9 +2441,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2454,6 +2452,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2462,9 +2461,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2473,6 +2472,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2483,9 +2483,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2494,6 +2494,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2515,9 +2516,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -2526,9 +2527,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2545,9 +2546,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2556,6 +2557,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2564,9 +2566,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2575,6 +2577,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2585,9 +2588,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2596,6 +2599,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2612,9 +2616,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2631,9 +2635,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2642,6 +2646,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2650,9 +2655,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2661,6 +2666,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2671,9 +2677,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2682,6 +2688,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2698,9 +2705,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2717,9 +2724,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2728,6 +2735,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2736,9 +2744,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2747,6 +2755,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2757,9 +2766,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2768,6 +2777,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2778,23 +2788,28 @@ spec: databases. properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2810,8 +2825,9 @@ spec: - 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/' + 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: @@ -2820,16 +2836,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -2837,15 +2855,18 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object storageClusterRef: description: YDB Storage cluster reference @@ -2871,78 +2892,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -2954,121 +2976,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -3081,46 +3107,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -3142,10 +3171,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -3154,8 +3183,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -3166,8 +3196,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -3185,8 +3216,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -3195,59 +3227,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -3257,27 +3300,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -3285,22 +3326,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -3308,54 +3348,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -3365,16 +3409,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -3399,16 +3442,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -3419,10 +3461,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -3442,113 +3483,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3562,46 +3615,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3612,45 +3657,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3666,8 +3707,9 @@ spec: - 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/' + 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: @@ -3676,12 +3718,11 @@ spec: - 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/' + 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 selector: @@ -3693,28 +3734,24 @@ spec: 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 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: |- + 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 + 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 @@ -3727,23 +3764,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -3760,19 +3796,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -3781,26 +3817,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -3809,22 +3846,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -3834,9 +3874,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -3844,52 +3884,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -3902,51 +3944,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -3957,55 +4006,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -4013,43 +4064,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -4059,10 +4118,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -4076,14 +4135,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -4096,14 +4156,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -4117,17 +4176,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4136,25 +4192,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4162,16 +4214,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -4201,18 +4253,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -4224,10 +4273,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -4249,6 +4297,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -4259,17 +4308,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4278,25 +4324,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4304,44 +4346,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -4354,28 +4393,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -4386,53 +4427,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -4443,9 +4497,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -4456,26 +4512,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -4487,9 +4546,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -4497,31 +4556,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -4529,22 +4587,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4556,8 +4613,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -4565,39 +4623,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -4605,10 +4665,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -4641,45 +4701,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -4694,10 +4744,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4719,9 +4765,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index bc84fb0f..f36e699b 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: remotedatabasenodesets.ydb.tech spec: group: ydb.tech @@ -31,14 +29,19 @@ spec: in remote cluster 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' + 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' + 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 @@ -66,22 +69,20 @@ spec: 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. + 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). + 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 @@ -91,30 +92,26 @@ spec: 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. + 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. + 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. + 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 @@ -127,30 +124,26 @@ spec: 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. + 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. + 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. + 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 @@ -160,6 +153,7 @@ spec: 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. @@ -171,50 +165,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -227,30 +217,26 @@ spec: 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. + 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. + 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. + 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 @@ -260,26 +246,27 @@ spec: 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 + 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 @@ -298,28 +285,24 @@ spec: 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 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: |- + 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 + 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 @@ -332,50 +315,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -388,39 +365,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -429,23 +404,22 @@ spec: 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. + 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 + 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, @@ -455,26 +429,25 @@ spec: 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 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: |- + 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. + 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 @@ -486,46 +459,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -537,31 +508,28 @@ spec: 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. + 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". + 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. + 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: @@ -575,16 +543,15 @@ spec: 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 + 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 @@ -603,28 +570,24 @@ spec: 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 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: |- + 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 + 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 @@ -637,50 +600,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -693,39 +650,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -734,23 +689,22 @@ spec: 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. + 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 + 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, @@ -760,26 +714,25 @@ spec: 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 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: |- + 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. + 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 @@ -791,46 +744,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -842,31 +793,28 @@ spec: 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. + 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". + 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. + 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: @@ -876,8 +824,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -907,8 +856,9 @@ spec: type: object domain: default: Root - description: '(Optional) Name of the root storage domain Default: - Root' + description: |- + (Optional) Name of the root storage domain + Default: Root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string @@ -925,8 +875,9 @@ spec: a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key must be @@ -935,6 +886,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic pin: type: string required: @@ -944,57 +896,60 @@ spec: description: (Optional) YDB Image properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -1005,16 +960,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1027,10 +982,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1039,12 +993,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1057,12 +1010,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1082,6 +1034,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1091,10 +1044,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1103,19 +1055,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1124,15 +1077,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1141,51 +1095,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1194,9 +1151,9 @@ spec: 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. + 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. @@ -1206,9 +1163,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1225,22 +1182,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1250,40 +1209,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1292,9 +1248,9 @@ spec: 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. + 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. @@ -1304,9 +1260,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1323,22 +1279,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1348,9 +1306,10 @@ spec: 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. + 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 @@ -1358,36 +1317,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1395,10 +1354,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1407,9 +1368,9 @@ spec: 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. + 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 @@ -1419,9 +1380,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1438,33 +1399,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1479,78 +1442,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1562,36 +1529,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1599,10 +1566,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1611,9 +1580,9 @@ spec: 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. + 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 @@ -1623,9 +1592,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1642,33 +1611,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1683,54 +1654,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1747,8 +1722,9 @@ spec: - 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/' + 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: @@ -1757,33 +1733,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1801,60 +1778,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -1874,108 +1851,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1983,10 +1953,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1995,9 +1967,9 @@ spec: 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. + 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 @@ -2007,9 +1979,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2026,33 +1998,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2067,77 +2041,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2160,40 +2133,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2201,17 +2178,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -2222,10 +2202,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -2241,26 +2221,26 @@ spec: 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' + 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 + 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. + 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 @@ -2270,9 +2250,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) in the cluster @@ -2280,24 +2261,25 @@ spec: type: integer operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Database - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Database resource. type: boolean path: - description: '(Optional) Custom database path in schemeshard Default: - //' + description: |- + (Optional) Custom database path in schemeshard + Default: // maxLength: 255 pattern: /[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?(/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?)* type: string pause: default: false - description: The state of the Database processes. `true` means all - the Database Pods are being killed, but the Database resource is - persisted. `false` means the default state of the system, all Pods - running. + description: |- + The state of the Database processes. + `true` means all the Database Pods are being killed, but the Database resource is persisted. + `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. @@ -2306,23 +2288,28 @@ spec: description: (Optional) Database storage and compute resources properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2338,8 +2325,9 @@ spec: - 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/' + 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: @@ -2348,16 +2336,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -2365,28 +2355,35 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array serverlessResources: description: (Optional) If specified, created database will be "serverless". @@ -2410,8 +2407,9 @@ spec: - sharedDatabaseRef type: object service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: datastreams: properties: @@ -2425,9 +2423,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2444,9 +2442,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2455,6 +2453,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2463,9 +2462,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2474,6 +2473,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2484,9 +2484,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2495,6 +2495,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2516,9 +2517,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -2527,9 +2528,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2546,9 +2547,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2557,6 +2558,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2565,9 +2567,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2576,6 +2578,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2586,9 +2589,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2597,6 +2600,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2613,9 +2617,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2632,9 +2636,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2643,6 +2647,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2651,9 +2656,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2662,6 +2667,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2672,9 +2678,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2683,6 +2689,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2699,9 +2706,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2718,9 +2725,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2729,6 +2736,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2737,9 +2745,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2748,6 +2756,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2758,9 +2767,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2769,6 +2778,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2779,23 +2789,28 @@ spec: databases. properties: containerResources: - description: '(Optional) Database container resource limits. Any - container limits can be specified. Default: (not specified)' + description: |- + (Optional) Database container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2811,8 +2826,9 @@ spec: - 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/' + 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: @@ -2821,16 +2837,18 @@ spec: - 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/' + 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 storageUnits: - description: 'Kind of the storage unit. Determine guarantees for - all main unit parameters: used hard disk type, capacity throughput, - IOPS etc.' + description: |- + Kind of the storage unit. Determine guarantees + for all main unit parameters: used hard disk type, capacity + throughput, IOPS etc. items: properties: count: @@ -2838,15 +2856,18 @@ spec: format: int64 type: integer unitKind: - description: 'Kind of the storage unit. Determine guarantees + description: |- + Kind of the storage unit. Determine guarantees for all main unit parameters: used hard disk type, capacity - throughput, IOPS etc.' + throughput, IOPS etc. type: string required: - count - unitKind type: object type: array + required: + - storageUnits type: object storageClusterRef: description: YDB Storage cluster reference @@ -2872,78 +2893,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -2955,121 +2977,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -3082,46 +3108,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -3143,10 +3172,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -3155,8 +3184,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -3167,8 +3197,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -3186,8 +3217,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -3196,59 +3228,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -3258,27 +3301,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -3286,22 +3327,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -3309,54 +3349,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -3366,16 +3410,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -3400,16 +3443,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -3420,10 +3462,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -3443,113 +3484,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3563,46 +3616,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3613,45 +3658,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3667,8 +3708,9 @@ spec: - 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/' + 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: @@ -3677,12 +3719,11 @@ spec: - 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/' + 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 selector: @@ -3694,28 +3735,24 @@ spec: 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 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: |- + 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 + 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 @@ -3728,23 +3765,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -3761,19 +3797,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -3782,26 +3818,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -3810,22 +3847,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -3835,9 +3875,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -3845,52 +3885,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -3903,51 +3945,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -3958,55 +4007,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -4014,43 +4065,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -4060,10 +4119,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -4077,14 +4136,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -4097,14 +4157,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -4118,17 +4177,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4137,25 +4193,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4163,16 +4215,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -4202,18 +4254,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -4225,10 +4274,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -4250,6 +4298,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -4260,17 +4309,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4279,25 +4325,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4305,44 +4347,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -4355,28 +4394,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -4387,53 +4428,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -4444,9 +4498,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -4457,26 +4513,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -4488,9 +4547,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -4498,31 +4557,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -4530,22 +4588,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4557,8 +4614,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -4566,39 +4624,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -4606,10 +4666,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -4642,45 +4702,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -4695,10 +4745,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4715,48 +4761,36 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of - the current state of this API Resource. --- This struct - is intended for direct use as an array at the field path - .status.conditions. For example, \n \ttype FooStatus struct{ - \t // Represents the observations of a foo's current - state. \t // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" \t // +patchMergeKey=type - \t // +patchStrategy=merge \t // +listType=map \t - \ // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other - fields \t}" + description: Condition contains details for one aspect of + the current state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should - be when the underlying condition changed. If that is - not known, then using the time when the API field changed - is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, - if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the - current state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier - indicating the reason for the condition's last transition. - Producers of specific condition types may define expected - values and meanings for this field, and whether the - values are considered a guaranteed API. The value should - be a CamelCase string. This field may not be empty. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. maxLength: 1024 minLength: 1 pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ @@ -4771,11 +4805,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across - resources like Available, but because arbitrary conditions - can be useful (see .node.status.conditions), the ability - to deconflict is important. The regex it matches is - (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4815,9 +4844,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index f514a2ac..bd01e43a 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: remotestoragenodesets.ydb.tech spec: group: ydb.tech @@ -31,14 +29,19 @@ spec: in remote cluster 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' + 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' + 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 @@ -65,22 +68,20 @@ spec: 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. + 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). + 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 @@ -90,30 +91,26 @@ spec: 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. + 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. + 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. + 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 @@ -126,30 +123,26 @@ spec: 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. + 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. + 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. + 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 @@ -159,6 +152,7 @@ spec: 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. @@ -170,50 +164,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -226,30 +216,26 @@ spec: 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. + 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. + 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. + 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 @@ -259,26 +245,27 @@ spec: 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 + 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 @@ -297,28 +284,24 @@ spec: 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 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: |- + 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 + 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 @@ -331,50 +314,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -387,39 +364,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -428,23 +403,22 @@ spec: 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. + 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 + 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, @@ -454,26 +428,25 @@ spec: 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 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: |- + 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. + 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 @@ -485,46 +458,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -536,31 +507,28 @@ spec: 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. + 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". + 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. + 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: @@ -574,16 +542,15 @@ spec: 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 + 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 @@ -602,28 +569,24 @@ spec: 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 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: |- + 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 + 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 @@ -636,50 +599,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -692,39 +649,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -733,23 +688,22 @@ spec: 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. + 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 + 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, @@ -759,26 +713,25 @@ spec: 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 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: |- + 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. + 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 @@ -790,46 +743,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -841,31 +792,28 @@ spec: 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. + 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". + 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. + 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: @@ -875,8 +823,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -885,32 +834,33 @@ spec: dataStore: description: (Optional) Where cluster data should be kept items: - description: PersistentVolumeClaimSpec describes the common attributes - of storage devices and allows a Source for provider-specific attributes + description: |- + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes properties: accessModes: - description: 'accessModes contains the desired access modes - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: + description: |- + dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature gate is - enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when - dataSourceRef.namespace is not specified. If the namespace - is specified, then dataSourceRef will not be copied to dataSource.' + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -922,38 +872,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from which - to populate the volume with data, if a non-empty volume is - desired. This may be any object from a non-empty API group - (non core object) or a PersistentVolumeClaim object. When - this field is specified, volume binding will only succeed - if the type of the specified object matches some installed - volume populator or dynamic provisioner. This field will replace - the functionality of the dataSource field and as such if both - fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn''t specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to - the same value automatically if one of them is empty and the - other is non-empty. When namespace is specified in dataSourceRef, - dataSource isn''t set to the same value and must be empty. - There are three important differences between dataSource and - dataSourceRef: * While dataSource only allows two specific - types of objects, dataSourceRef allows any non-core object, - as well as PersistentVolumeClaim objects. * While dataSource - ignores disallowed values (dropping them), dataSourceRef preserves - all values, and generates an error if a disallowed value is specified. - * While dataSource only allows local objects, dataSourceRef - allows objects in any namespaces. (Beta) Using this field - requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires - the CrossNamespaceVolumeDataSource feature gate to be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -962,39 +912,39 @@ spec: description: Name is the name of resource being referenced type: string namespace: - description: Namespace is the namespace of resource being - referenced Note that when a namespace is specified, a - gateway.networking.k8s.io/ReferenceGrant object is required - in the referent namespace to allow that namespace's owner - to accept the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource - feature gate to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources the - volume should have. If RecoverVolumeExpansionFailure feature - is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher - than capacity recorded in the status field of the claim. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1011,8 +961,9 @@ spec: - 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/' + 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: @@ -1021,11 +972,11 @@ spec: - 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/' + 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 selector: @@ -1036,25 +987,25 @@ spec: 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 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: |- + 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. + 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 @@ -1066,21 +1017,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the StorageClass - required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume is required - by the claim. Value of Filesystem is implied when not included - in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference to the PersistentVolume @@ -1090,14 +1042,17 @@ spec: type: array domain: default: Root - description: '(Optional) Name of the root storage domain Default: - root' + description: |- + (Optional) Name of the root storage domain + Default: root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string erasure: default: block-4-2 - description: Data storage topology mode For details, see https://ydb.tech/docs/en/cluster/topology + description: |- + Data storage topology mode + For details, see https://ydb.tech/docs/en/cluster/topology FIXME mirror-3-dc is only supported with external configuration enum: - mirror-3-dc @@ -1105,64 +1060,68 @@ spec: - none type: string hostNetwork: - description: '(Optional) Whether host network should be enabled. Default: - false' + description: |- + (Optional) Whether host network should be enabled. + Default: false type: boolean image: description: (Optional) Container image information properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -1173,16 +1132,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1195,10 +1154,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1207,12 +1165,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1225,12 +1182,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1250,6 +1206,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1259,10 +1216,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1271,19 +1227,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1292,15 +1249,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1309,51 +1267,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1362,9 +1323,9 @@ spec: 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. + 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. @@ -1374,9 +1335,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1393,22 +1354,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1418,40 +1381,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1460,9 +1420,9 @@ spec: 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. + 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. @@ -1472,9 +1432,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1491,22 +1451,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1516,9 +1478,10 @@ spec: 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. + 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 @@ -1526,36 +1489,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1563,10 +1526,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1575,9 +1540,9 @@ spec: 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. + 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 @@ -1587,9 +1552,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1606,33 +1571,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1647,78 +1614,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1730,36 +1701,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1767,10 +1738,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1779,9 +1752,9 @@ spec: 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. + 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 @@ -1791,9 +1764,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1810,33 +1783,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1851,54 +1826,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1915,8 +1894,9 @@ spec: - 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/' + 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: @@ -1925,33 +1905,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1969,60 +1950,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2042,108 +2023,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -2151,10 +2125,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -2163,9 +2139,9 @@ spec: 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. + 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 @@ -2175,9 +2151,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2194,33 +2170,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2235,77 +2213,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2328,40 +2305,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2369,17 +2350,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -2390,10 +2374,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -2409,26 +2393,26 @@ spec: 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' + 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 + 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. + 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 @@ -2438,9 +2422,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) @@ -2448,38 +2433,45 @@ spec: type: integer operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Storage - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Storage resource. type: boolean pause: default: false - description: The state of the Storage processes. `true` means all - the Storage Pods are being killed, but the Storage resource is persisted. + description: |- + The state of the Storage processes. + `true` means all the Storage Pods are being killed, but the Storage resource is persisted. `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. type: string resources: - description: '(Optional) Container resource limits. Any container - limits can be specified. Default: (not specified)' + description: |- + (Optional) Container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined in - spec.resourceClaims, that are used by this container. \n This - is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be set - for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in pod.spec.resourceClaims - of the Pod where this field is used. It makes that resource - available inside a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2495,8 +2487,9 @@ spec: - 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/' + 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: @@ -2505,28 +2498,34 @@ spec: - 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/' + 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 secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: grpc: properties: @@ -2545,9 +2544,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -2556,9 +2555,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2575,9 +2574,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2586,6 +2585,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2594,9 +2594,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2605,6 +2605,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2615,9 +2616,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2626,6 +2627,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2642,9 +2644,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2661,9 +2663,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2672,6 +2674,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2680,9 +2683,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2691,6 +2694,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2701,9 +2705,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2712,6 +2716,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2728,9 +2733,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2747,9 +2752,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2758,6 +2763,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2766,9 +2772,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2777,6 +2783,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2787,9 +2794,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2798,6 +2805,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2824,78 +2832,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -2907,121 +2916,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -3034,46 +3047,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -3095,10 +3111,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -3107,8 +3123,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -3119,8 +3136,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -3138,8 +3156,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -3148,59 +3167,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -3210,27 +3240,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -3238,22 +3266,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -3261,54 +3288,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -3318,16 +3349,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -3352,16 +3382,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -3372,10 +3401,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -3395,113 +3423,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3515,46 +3555,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3565,45 +3597,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3619,8 +3647,9 @@ spec: - 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/' + 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: @@ -3629,12 +3658,11 @@ spec: - 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/' + 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 selector: @@ -3646,28 +3674,24 @@ spec: 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 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: |- + 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 + 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 @@ -3680,23 +3704,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -3713,19 +3736,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -3734,26 +3757,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -3762,22 +3786,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -3787,9 +3814,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -3797,52 +3824,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -3855,51 +3884,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -3910,55 +3946,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -3966,43 +4004,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -4012,10 +4058,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -4029,14 +4075,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -4049,14 +4096,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -4070,17 +4116,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4089,25 +4132,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4115,16 +4154,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -4154,18 +4193,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -4177,10 +4213,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -4202,6 +4237,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -4212,17 +4248,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4231,25 +4264,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4257,44 +4286,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -4307,28 +4333,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -4339,53 +4367,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -4396,9 +4437,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -4409,26 +4452,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -4440,9 +4486,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -4450,31 +4496,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -4482,22 +4527,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4509,8 +4553,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -4518,39 +4563,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -4558,10 +4605,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -4594,45 +4641,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -4647,10 +4684,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4667,48 +4700,36 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of - the current state of this API Resource. --- This struct - is intended for direct use as an array at the field path - .status.conditions. For example, \n \ttype FooStatus struct{ - \t // Represents the observations of a foo's current - state. \t // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" \t // +patchMergeKey=type - \t // +patchStrategy=merge \t // +listType=map \t - \ // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other - fields \t}" + description: Condition contains details for one aspect of + the current state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should - be when the underlying condition changed. If that is - not known, then using the time when the API field changed - is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, - if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the - current state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier - indicating the reason for the condition's last transition. - Producers of specific condition types may define expected - values and meanings for this field, and whether the - values are considered a guaranteed API. The value should - be a CamelCase string. This field may not be empty. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. maxLength: 1024 minLength: 1 pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ @@ -4723,11 +4744,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across - resources like Available, but because arbitrary conditions - can be useful (see .node.status.conditions), the ability - to deconflict is important. The regex it matches is - (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4767,9 +4783,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index 9d0a1805..4f0b2654 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: storages.ydb.tech spec: group: ydb.tech @@ -30,14 +28,19 @@ spec: description: Storage is the Schema for the Storages 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' + 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' + 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 @@ -64,22 +67,20 @@ spec: 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. + 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). + 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 @@ -89,30 +90,26 @@ spec: 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. + 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. + 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. + 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 @@ -125,30 +122,26 @@ spec: 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. + 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. + 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. + 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 @@ -158,6 +151,7 @@ spec: 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. @@ -169,50 +163,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -225,30 +215,26 @@ spec: 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. + 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. + 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. + 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 @@ -258,26 +244,27 @@ spec: 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 + 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 @@ -296,28 +283,24 @@ spec: 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 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: |- + 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 + 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 @@ -330,50 +313,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -386,39 +363,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -427,23 +402,22 @@ spec: 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. + 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 + 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, @@ -453,26 +427,25 @@ spec: 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 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: |- + 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. + 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 @@ -484,46 +457,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -535,31 +506,28 @@ spec: 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. + 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". + 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. + 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: @@ -573,16 +541,15 @@ spec: 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 + 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 @@ -601,28 +568,24 @@ spec: 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 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: |- + 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 + 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 @@ -635,50 +598,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -691,39 +648,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -732,23 +687,22 @@ spec: 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. + 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 + 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, @@ -758,26 +712,25 @@ spec: 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 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: |- + 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. + 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 @@ -789,46 +742,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -840,31 +791,28 @@ spec: 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. + 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". + 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. + 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: @@ -874,8 +822,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -884,32 +833,33 @@ spec: dataStore: description: (Optional) Where cluster data should be kept items: - description: PersistentVolumeClaimSpec describes the common attributes - of storage devices and allows a Source for provider-specific attributes + description: |- + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes properties: accessModes: - description: 'accessModes contains the desired access modes - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: + description: |- + dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature gate is - enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when - dataSourceRef.namespace is not specified. If the namespace - is specified, then dataSourceRef will not be copied to dataSource.' + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -921,38 +871,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from which - to populate the volume with data, if a non-empty volume is - desired. This may be any object from a non-empty API group - (non core object) or a PersistentVolumeClaim object. When - this field is specified, volume binding will only succeed - if the type of the specified object matches some installed - volume populator or dynamic provisioner. This field will replace - the functionality of the dataSource field and as such if both - fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn''t specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to - the same value automatically if one of them is empty and the - other is non-empty. When namespace is specified in dataSourceRef, - dataSource isn''t set to the same value and must be empty. - There are three important differences between dataSource and - dataSourceRef: * While dataSource only allows two specific - types of objects, dataSourceRef allows any non-core object, - as well as PersistentVolumeClaim objects. * While dataSource - ignores disallowed values (dropping them), dataSourceRef preserves - all values, and generates an error if a disallowed value is specified. - * While dataSource only allows local objects, dataSourceRef - allows objects in any namespaces. (Beta) Using this field - requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires - the CrossNamespaceVolumeDataSource feature gate to be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -961,39 +911,39 @@ spec: description: Name is the name of resource being referenced type: string namespace: - description: Namespace is the namespace of resource being - referenced Note that when a namespace is specified, a - gateway.networking.k8s.io/ReferenceGrant object is required - in the referent namespace to allow that namespace's owner - to accept the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource - feature gate to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources the - volume should have. If RecoverVolumeExpansionFailure feature - is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher - than capacity recorded in the status field of the claim. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1010,8 +960,9 @@ spec: - 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/' + 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: @@ -1020,11 +971,11 @@ spec: - 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/' + 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 selector: @@ -1035,25 +986,25 @@ spec: 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 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: |- + 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. + 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 @@ -1065,21 +1016,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the StorageClass - required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume is required - by the claim. Value of Filesystem is implied when not included - in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference to the PersistentVolume @@ -1089,14 +1041,17 @@ spec: type: array domain: default: Root - description: '(Optional) Name of the root storage domain Default: - root' + description: |- + (Optional) Name of the root storage domain + Default: root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string erasure: default: block-4-2 - description: Data storage topology mode For details, see https://ydb.tech/docs/en/cluster/topology + description: |- + Data storage topology mode + For details, see https://ydb.tech/docs/en/cluster/topology FIXME mirror-3-dc is only supported with external configuration enum: - mirror-3-dc @@ -1104,64 +1059,68 @@ spec: - none type: string hostNetwork: - description: '(Optional) Whether host network should be enabled. Default: - false' + description: |- + (Optional) Whether host network should be enabled. + Default: false type: boolean image: description: (Optional) Container image information properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -1172,16 +1131,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1194,10 +1153,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1206,12 +1164,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1224,12 +1181,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1249,6 +1205,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1258,10 +1215,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1270,19 +1226,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1291,15 +1248,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1308,51 +1266,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1361,9 +1322,9 @@ spec: 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. + 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. @@ -1373,9 +1334,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1392,22 +1353,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1417,40 +1380,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1459,9 +1419,9 @@ spec: 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. + 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. @@ -1471,9 +1431,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1490,22 +1450,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1515,9 +1477,10 @@ spec: 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. + 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 @@ -1525,36 +1488,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1562,10 +1525,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1574,9 +1539,9 @@ spec: 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. + 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 @@ -1586,9 +1551,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1605,33 +1570,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1646,78 +1613,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1729,36 +1700,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1766,10 +1737,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1778,9 +1751,9 @@ spec: 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. + 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 @@ -1790,9 +1763,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1809,33 +1782,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1850,54 +1825,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1914,8 +1893,9 @@ spec: - 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/' + 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: @@ -1924,33 +1904,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1968,60 +1949,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2041,108 +2022,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -2150,10 +2124,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -2162,9 +2138,9 @@ spec: 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. + 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 @@ -2174,9 +2150,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2193,33 +2169,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2234,77 +2212,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2327,40 +2304,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2368,17 +2349,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array initJob: - description: '(Optional) Init blobstorage Job settings Default: (not - specified)' + description: |- + (Optional) Init blobstorage Job settings + Default: (not specified) properties: additionalAnnotations: additionalProperties: @@ -2400,22 +2384,20 @@ spec: 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. + 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). + 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 @@ -2425,32 +2407,26 @@ spec: 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. + 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. + 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. + 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 @@ -2463,32 +2439,26 @@ spec: 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. + 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. + 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. + 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 @@ -2498,6 +2468,7 @@ spec: 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. @@ -2509,53 +2480,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -2568,32 +2532,26 @@ spec: 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. + 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. + 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. + 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 @@ -2603,10 +2561,12 @@ spec: 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. @@ -2614,18 +2574,16 @@ spec: 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. + 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 @@ -2644,30 +2602,25 @@ spec: 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 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: |- + 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. + 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 @@ -2679,52 +2632,45 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -2736,41 +2682,37 @@ spec: 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. + 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". + 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. + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -2779,23 +2721,22 @@ spec: 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. + 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 + 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, @@ -2806,28 +2747,24 @@ spec: 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 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: |- + 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 + 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 @@ -2840,50 +2777,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -2896,32 +2827,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -2934,18 +2862,16 @@ spec: 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. + 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 @@ -2964,30 +2890,25 @@ spec: 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 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: |- + 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. + 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 @@ -2999,52 +2920,45 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -3056,41 +2970,37 @@ spec: 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. + 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". + 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. + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -3099,23 +3009,22 @@ spec: 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. + 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 + 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, @@ -3126,28 +3035,24 @@ spec: 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 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: |- + 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 + 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 @@ -3160,50 +3065,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -3216,32 +3115,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -3252,29 +3148,34 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must - be true for the pod to fit on a node. Selector which must match - a node''s labels for the pod to be scheduled on that node. More - info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object resources: - description: '(Optional) Container resource limits. Any container - limits can be specified. Default: (not specified)' + description: |- + (Optional) Container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be - set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in - pod.spec.resourceClaims of the Pod where this field - is used. It makes that resource available inside a - container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3290,8 +3191,9 @@ spec: - 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/' + 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: @@ -3300,57 +3202,57 @@ spec: - 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/' + 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 tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . + 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. + 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. + 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. + 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. + 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. + 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 type: object monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -3361,10 +3263,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -3380,26 +3282,26 @@ spec: 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' + 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 + 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. + 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 @@ -3409,13 +3311,15 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodeSets: - description: '(Optional) NodeSet inline configuration to split into - multiple StatefulSets Default: (not specified)' + description: |- + (Optional) NodeSet inline configuration to split into multiple StatefulSets + Default: (not specified) items: description: StorageNodeSetSpecInline describes an group nodes object inside parent object @@ -3440,22 +3344,20 @@ spec: 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. + 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). + 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 @@ -3465,32 +3367,26 @@ spec: 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. + 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. + 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. + 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 @@ -3503,32 +3399,26 @@ spec: 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. + 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. + 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. + 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 @@ -3538,6 +3428,7 @@ spec: type: object type: array type: object + x-kubernetes-map-type: atomic weight: description: Weight associated with matching the corresponding nodeSelectorTerm, in the range @@ -3550,53 +3441,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -3609,32 +3493,26 @@ spec: 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. + 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. + 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. + 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 @@ -3644,10 +3522,12 @@ spec: 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. @@ -3655,18 +3535,16 @@ spec: 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. + 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 @@ -3685,29 +3563,24 @@ spec: 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 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: |- + 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 + 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 @@ -3720,52 +3593,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -3778,43 +3643,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -3823,24 +3682,22 @@ spec: 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. + 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 + 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, @@ -3851,28 +3708,24 @@ spec: 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 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: |- + 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 + 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 @@ -3885,50 +3738,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -3941,34 +3788,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -3981,18 +3823,16 @@ spec: 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. + 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 @@ -4011,29 +3851,24 @@ spec: 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 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: |- + 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 + 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 @@ -4046,52 +3881,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -4104,43 +3931,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -4149,24 +3970,22 @@ spec: 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. + 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 + 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, @@ -4177,28 +3996,24 @@ spec: 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 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: |- + 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 + 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 @@ -4211,50 +4026,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -4267,34 +4076,29 @@ spec: 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. + 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". + 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: |- + 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 @@ -4310,33 +4114,32 @@ spec: dataStore: description: (Optional) Where cluster data should be kept items: - description: PersistentVolumeClaimSpec describes the common - attributes of storage devices and allows a Source for provider-specific - attributes + description: |- + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified - data source, it will create a new volume based on the - contents of the specified data source. When the AnyVolumeDataSource - feature gate is enabled, dataSource contents will be - copied to dataSourceRef, and dataSourceRef contents - will be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, then - dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API group. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. type: string kind: @@ -4349,40 +4152,37 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from - which to populate the volume with data, if a non-empty - volume is desired. This may be any object from a non-empty - API group (non core object) or a PersistentVolumeClaim - object. When this field is specified, volume binding - will only succeed if the type of the specified object - matches some installed volume populator or dynamic provisioner. - This field will replace the functionality of the dataSource - field and as such if both fields are non-empty, they - must have the same value. For backwards compatibility, - when namespace isn''t specified in dataSourceRef, both - fields (dataSource and dataSourceRef) will be set to - the same value automatically if one of them is empty - and the other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the same - value and must be empty. There are three important differences - between dataSource and dataSourceRef: * While dataSource - only allows two specific types of objects, dataSourceRef allows - any non-core object, as well as PersistentVolumeClaim - objects. * While dataSource ignores disallowed values - (dropping them), dataSourceRef preserves all values, - and generates an error if a disallowed value is specified. - * While dataSource only allows local objects, dataSourceRef - allows objects in any namespaces. (Beta) Using this - field requires the AnyVolumeDataSource feature gate - to be enabled. (Alpha) Using the namespace field of - dataSourceRef requires the CrossNamespaceVolumeDataSource - feature gate to be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API group. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. type: string kind: @@ -4392,43 +4192,41 @@ spec: description: Name is the name of resource being referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace is specified, - a gateway.networking.k8s.io/ReferenceGrant object - is required in the referent namespace to allow that - namespace's owner to accept the reference. See the - ReferenceGrant documentation for details. (Alpha) - This field requires the CrossNamespaceVolumeDataSource - feature gate to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify resource - requirements that are lower than previous value but - must still be higher than capacity recorded in the status - field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used by - this container. \n This is an alpha field and requires - enabling the DynamicResourceAllocation feature gate. - \n This field is immutable. It can only be set for - containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the Pod - where this field is used. It makes that resource - available inside a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -4444,8 +4242,9 @@ spec: - 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/' + 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: @@ -4454,11 +4253,11 @@ spec: - 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/' + 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 selector: @@ -4469,8 +4268,8 @@ spec: 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 + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. properties: key: @@ -4478,17 +4277,16 @@ spec: 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: |- + 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. + 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 @@ -4500,21 +4298,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the StorageClass - required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume is - required by the claim. Value of Filesystem is implied - when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference to the @@ -4523,8 +4322,9 @@ spec: type: object type: array hostNetwork: - description: '(Optional) Whether host network should be enabled. - Default: false' + description: |- + (Optional) Whether host network should be enabled. + Default: false type: boolean labels: additionalProperties: @@ -4537,10 +4337,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must - be true for the pod to fit on a node. Selector which must - match a node''s labels for the pod to be scheduled on that - node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) @@ -4560,22 +4360,27 @@ spec: - cluster type: object resources: - description: '(Optional) Container resource limits. Any container - limits can be specified. Default: (not specified)' + description: |- + (Optional) Container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -4592,8 +4397,9 @@ spec: - 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/' + 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: @@ -4602,11 +4408,11 @@ spec: - 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/' + 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 terminationGracePeriodSeconds: @@ -4616,63 +4422,62 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using - the matching operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. - Pods that match this label selector are counted to determine - the number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. properties: key: @@ -4680,17 +4485,16 @@ spec: 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: |- + 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. + 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 @@ -4702,130 +4506,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys - to select the pods over which spreading will be calculated. - The keys are used to lookup values from the incoming - pod labels, those key-value labels are ANDed with labelSelector - to select the group of existing pods over which spreading - will be calculated for the incoming pod. Keys that don't - exist in the incoming pod labels will be ignored. A - null or empty list means only match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods - may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global - minimum. The global minimum is the minimum number of - matching pods in an eligible domain or zero if the number - of eligible domains is less than MinDomains. For example, - in a 3-zone cluster, MaxSkew is set to 1, and pods with - the same labelSelector spread as 2/2/1: In this case, - the global minimum is 1. | zone1 | zone2 | zone3 | | P - P | P P | P | - if MaxSkew is 1, incoming pod - can only be scheduled to zone3 to become 2/2/2; scheduling - it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is - 2, incoming pod can be scheduled onto any zone. When - `whenUnsatisfiable=ScheduleAnyway`, it is used to give - higher precedence to topologies that satisfy it. It''s - a required field. Default value is 1 and 0 is not allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of - eligible domains. When the number of eligible domains - with matching topology keys is less than minDomains, - Pod Topology Spread treats \"global minimum\" as 0, - and then the calculation of Skew is performed. And when - the number of eligible domains with matching topology - keys equals or greater than minDomains, this value has - no effect on scheduling. As a result, when the number - of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. - If value is nil, the constraint behaves as if MinDomains - is equal to 1. Valid values are integers greater than - 0. When value is not nil, WhenUnsatisfiable must be - DoNotSchedule. \n For example, in a 3-zone cluster, - MaxSkew is set to 2, MinDomains is set to 5 and pods - with the same labelSelector spread as 2/2/2: | zone1 - | zone2 | zone3 | | P P | P P | P P | The number - of domains is less than 5(MinDomains), so \"global minimum\" - is treated as 0. In this situation, new pod with the - same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any - of the three zones, it will violate MaxSkew. \n This - is a beta field and requires the MinDomainsInPodTopologySpread - feature gate to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will - treat Pod's nodeAffinity/nodeSelector when calculating - pod topology spread skew. Options are: - Honor: only - nodes matching nodeAffinity/nodeSelector are included - in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. - \n If this value is nil, the behavior is equivalent - to the Honor policy. This is a beta-level feature default - enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat - node taints when calculating pod topology spread skew. - Options are: - Honor: nodes without taints, along with - tainted nodes for which the incoming pod has a toleration, - are included. - Ignore: node taints are ignored. All - nodes are included. \n If this value is nil, the behavior - is equivalent to the Ignore policy. This is a beta-level - feature default enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. + - Ignore: node taints are ignored. All nodes are included. + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes - that have a label with this key and identical values - are considered to be in the same topology. We consider - each as a "bucket", and try to put balanced - number of pods into each bucket. We define a domain - as a particular instance of a topology. Also, we define - an eligible domain as a domain whose nodes meet the - requirements of nodeAffinityPolicy and nodeTaintsPolicy. - e.g. If TopologyKey is "kubernetes.io/hostname", each - Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain - of that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal - with a pod if it doesn''t satisfy the spread constraint. - - DoNotSchedule (default) tells the scheduler not to - schedule it. - ScheduleAnyway tells the scheduler to - schedule the pod in any location, but giving higher - precedence to topologies that would help reduce the skew. - A constraint is considered "Unsatisfiable" for an incoming - pod if and only if every possible node assignment for - that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and - pods with the same labelSelector spread as 3/1/1: | - zone1 | zone2 | zone3 | | P P P | P | P | If - WhenUnsatisfiable is set to DoNotSchedule, incoming - pod can only be scheduled to zone2(zone3) to become - 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies - MaxSkew(1). In other words, the cluster can still be - imbalanced, but scheduler won''t make it *more* imbalanced. - It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -4847,8 +4646,9 @@ spec: format: int32 type: integer operatorConnection: - description: '(Optional) Operator connection settings Default: (not - specified)' + description: |- + (Optional) Operator connection settings + Default: (not specified) properties: accessToken: properties: @@ -4860,8 +4660,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key must @@ -4870,6 +4671,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - secretKeyRef type: object @@ -4895,9 +4697,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -4906,6 +4708,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - secretKeyRef type: object @@ -4930,9 +4733,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -4941,6 +4744,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - secretKeyRef type: object @@ -4952,38 +4756,45 @@ spec: type: object operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Storage - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Storage resource. type: boolean pause: default: false - description: The state of the Storage processes. `true` means all - the Storage Pods are being killed, but the Storage resource is persisted. + description: |- + The state of the Storage processes. + `true` means all the Storage Pods are being killed, but the Storage resource is persisted. `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. type: string resources: - description: '(Optional) Container resource limits. Any container - limits can be specified. Default: (not specified)' + description: |- + (Optional) Container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined in - spec.resourceClaims, that are used by this container. \n This - is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be set - for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in pod.spec.resourceClaims - of the Pod where this field is used. It makes that resource - available inside a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -4999,8 +4810,9 @@ spec: - 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/' + 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: @@ -5009,28 +4821,34 @@ spec: - 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/' + 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 secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: grpc: properties: @@ -5049,9 +4867,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -5060,9 +4878,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -5079,9 +4897,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5090,6 +4908,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -5098,9 +4917,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5109,6 +4928,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -5119,9 +4939,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5130,6 +4950,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -5146,9 +4967,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -5165,9 +4986,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5176,6 +4997,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -5184,9 +5006,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5195,6 +5017,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -5205,9 +5028,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5216,6 +5039,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -5232,9 +5056,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -5251,9 +5075,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5262,6 +5086,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -5270,9 +5095,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5281,6 +5106,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -5291,9 +5117,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -5302,6 +5128,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -5314,78 +5141,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -5397,121 +5225,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -5524,46 +5356,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -5585,10 +5420,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -5597,8 +5432,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -5609,8 +5445,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -5628,8 +5465,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -5638,59 +5476,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -5700,27 +5549,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -5728,22 +5575,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -5751,54 +5597,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -5808,16 +5658,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -5842,16 +5691,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -5862,10 +5710,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -5885,113 +5732,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -6005,46 +5864,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -6055,45 +5906,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -6109,8 +5956,9 @@ spec: - 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/' + 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: @@ -6119,12 +5967,11 @@ spec: - 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/' + 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 selector: @@ -6136,28 +5983,24 @@ spec: 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 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: |- + 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 + 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 @@ -6170,23 +6013,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -6203,19 +6045,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -6224,26 +6066,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -6252,22 +6095,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -6277,9 +6123,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -6287,52 +6133,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -6345,51 +6193,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -6400,55 +6255,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -6456,43 +6313,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -6502,10 +6367,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -6519,14 +6384,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -6539,14 +6405,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -6560,17 +6425,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -6579,25 +6441,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -6605,16 +6463,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -6644,18 +6502,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -6667,10 +6522,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -6692,6 +6546,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -6702,17 +6557,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -6721,25 +6573,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -6747,44 +6595,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -6797,28 +6642,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -6829,53 +6676,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -6886,9 +6746,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -6899,26 +6761,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -6930,9 +6795,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -6940,31 +6805,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -6972,22 +6836,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -6999,8 +6862,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -7008,39 +6872,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -7048,10 +6914,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -7083,45 +6949,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -7136,10 +6992,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -7161,9 +7013,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/storagemonitoring.yaml b/deploy/ydb-operator/crds/storagemonitoring.yaml index 4d37c632..2e39eb99 100644 --- a/deploy/ydb-operator/crds/storagemonitoring.yaml +++ b/deploy/ydb-operator/crds/storagemonitoring.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: storagemonitorings.ydb.tech spec: group: ydb.tech @@ -30,14 +28,19 @@ spec: description: StorageMonitoring is the Schema for the storagemonitorings 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' + 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' + 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 @@ -72,45 +75,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -125,10 +118,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -150,9 +139,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index 870a29d2..ce572f1b 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -1,11 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.16.5 name: storagenodesets.ydb.tech spec: group: ydb.tech @@ -30,14 +28,19 @@ spec: description: StorageNodeSet declares StatefulSet parameters 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' + 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' + 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 @@ -64,22 +67,20 @@ spec: 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. + 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). + 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 @@ -89,30 +90,26 @@ spec: 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. + 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. + 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. + 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 @@ -125,30 +122,26 @@ spec: 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. + 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. + 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. + 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 @@ -158,6 +151,7 @@ spec: 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. @@ -169,50 +163,46 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -225,30 +215,26 @@ spec: 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. + 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. + 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. + 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 @@ -258,26 +244,27 @@ spec: 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 + 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 @@ -296,28 +283,24 @@ spec: 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 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: |- + 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 + 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 @@ -330,50 +313,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -386,39 +363,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -427,23 +402,22 @@ spec: 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. + 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 + 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, @@ -453,26 +427,25 @@ spec: 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 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: |- + 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. + 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 @@ -484,46 +457,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -535,31 +506,28 @@ spec: 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. + 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". + 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. + 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: @@ -573,16 +541,15 @@ spec: 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 + 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 @@ -601,28 +568,24 @@ spec: 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 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: |- + 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 + 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 @@ -635,50 +598,44 @@ spec: 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. + 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. + 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. + 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. + 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 + 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 @@ -691,39 +648,37 @@ spec: 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. + 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". + 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: |- + 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. + description: |- + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. format: int32 type: integer required: @@ -732,23 +687,22 @@ spec: 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. + 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 + 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, @@ -758,26 +712,25 @@ spec: 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 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: |- + 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. + 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 @@ -789,46 +742,44 @@ spec: 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. + 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. + 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. + 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. + 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. + 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 @@ -840,31 +791,28 @@ spec: 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. + 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". + 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. + 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: @@ -874,8 +822,9 @@ spec: type: object type: object caBundle: - description: User-defined root certificate authority that is added - to system trust store of Storage pods on startup. + description: |- + User-defined root certificate authority that is added to system trust + store of Storage pods on startup. type: string configuration: description: YDB configuration in YAML format. Will be applied on @@ -884,32 +833,33 @@ spec: dataStore: description: (Optional) Where cluster data should be kept items: - description: PersistentVolumeClaimSpec describes the common attributes - of storage devices and allows a Source for provider-specific attributes + description: |- + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes properties: accessModes: - description: 'accessModes contains the desired access modes - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: + description: |- + dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature gate is - enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when - dataSourceRef.namespace is not specified. If the namespace - is specified, then dataSourceRef will not be copied to dataSource.' + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -921,38 +871,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from which - to populate the volume with data, if a non-empty volume is - desired. This may be any object from a non-empty API group - (non core object) or a PersistentVolumeClaim object. When - this field is specified, volume binding will only succeed - if the type of the specified object matches some installed - volume populator or dynamic provisioner. This field will replace - the functionality of the dataSource field and as such if both - fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn''t specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to - the same value automatically if one of them is empty and the - other is non-empty. When namespace is specified in dataSourceRef, - dataSource isn''t set to the same value and must be empty. - There are three important differences between dataSource and - dataSourceRef: * While dataSource only allows two specific - types of objects, dataSourceRef allows any non-core object, - as well as PersistentVolumeClaim objects. * While dataSource - ignores disallowed values (dropping them), dataSourceRef preserves - all values, and generates an error if a disallowed value is specified. - * While dataSource only allows local objects, dataSourceRef - allows objects in any namespaces. (Beta) Using this field - requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires - the CrossNamespaceVolumeDataSource feature gate to be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource being - referenced. If APIGroup is not specified, the specified - Kind must be in the core API group. For any other third-party - types, APIGroup is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being referenced @@ -961,39 +911,39 @@ spec: description: Name is the name of resource being referenced type: string namespace: - description: Namespace is the namespace of resource being - referenced Note that when a namespace is specified, a - gateway.networking.k8s.io/ReferenceGrant object is required - in the referent namespace to allow that namespace's owner - to accept the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource - feature gate to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources the - volume should have. If RecoverVolumeExpansionFailure feature - is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher - than capacity recorded in the status field of the claim. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1010,8 +960,9 @@ spec: - 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/' + 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: @@ -1020,11 +971,11 @@ spec: - 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/' + 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 selector: @@ -1035,25 +986,25 @@ spec: 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 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: |- + 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. + 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 @@ -1065,21 +1016,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the StorageClass - required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume is required - by the claim. Value of Filesystem is implied when not included - in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference to the PersistentVolume @@ -1089,14 +1041,17 @@ spec: type: array domain: default: Root - description: '(Optional) Name of the root storage domain Default: - root' + description: |- + (Optional) Name of the root storage domain + Default: root maxLength: 63 pattern: '[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?' type: string erasure: default: block-4-2 - description: Data storage topology mode For details, see https://ydb.tech/docs/en/cluster/topology + description: |- + Data storage topology mode + For details, see https://ydb.tech/docs/en/cluster/topology FIXME mirror-3-dc is only supported with external configuration enum: - mirror-3-dc @@ -1104,64 +1059,68 @@ spec: - none type: string hostNetwork: - description: '(Optional) Whether host network should be enabled. Default: - false' + description: |- + (Optional) Whether host network should be enabled. + Default: false type: boolean image: description: (Optional) Container image information properties: name: - description: 'Container image with supported YDB version. This - defaults to the version pinned to the operator and requires - a full container and tag/sha name. For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22' + description: |- + Container image with supported YDB version. + This defaults to the version pinned to the operator and requires a full container and tag/sha name. + For example: cr.yandex/crptqonuodf51kdj7a7d/ydb:22.2.22 type: string pullPolicy: - description: '(Optional) PullPolicy for the image, which defaults - to IfNotPresent. Default: IfNotPresent' + description: |- + (Optional) PullPolicy for the image, which defaults to IfNotPresent. + Default: IfNotPresent type: string pullSecret: - description: (Optional) Secret name containing the dockerconfig - to use for a registry that requires authentication. The secret + description: |- + (Optional) Secret name containing the dockerconfig to use for a registry that requires authentication. The secret must be configured first by the user. type: string type: object initContainers: - description: '(Optional) List of initialization containers belonging - to the pod. Init containers are executed in order prior to containers - being started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + description: |- + (Optional) List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ items: description: A single application container that you want to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container image''s - CMD is used if this is not provided. Variable references $(VAR_NAME) - are expanded using the container''s environment. If a variable - cannot be resolved, the reference in the input string will - be unchanged. Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will - produce the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the variable - exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Arguments to the entrypoint. + The container image's CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array command: - description: 'Entrypoint array. Not executed within a shell. - The container image''s ENTRYPOINT is used if this is not provided. - Variable references $(VAR_NAME) are expanded using the container''s - environment. If a variable cannot be resolved, the reference - in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: - i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether - the variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: |- + Entrypoint array. Not executed within a shell. + The container image's ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell items: type: string type: array env: - description: List of environment variables to set in the container. + description: |- + List of environment variables to set in the container. Cannot be updated. items: description: EnvVar represents an environment variable present @@ -1172,16 +1131,16 @@ spec: a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in - the container and any service environment variables. - If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. @@ -1194,10 +1153,9 @@ spec: description: The key to select. 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 type: string optional: description: Specify whether the ConfigMap or @@ -1206,12 +1164,11 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath @@ -1224,12 +1181,11 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -1249,6 +1205,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace @@ -1258,10 +1215,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its @@ -1270,19 +1226,20 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic type: object required: - name type: object type: array envFrom: - description: List of sources to populate environment variables - in the container. The keys defined within a source must be - a C_IDENTIFIER. All invalid keys will be reported as an event - when the container is starting. When a key exists in multiple - sources, the value associated with the last source will take - precedence. Values defined by an Env with a duplicate key - will take precedence. Cannot be updated. + description: |- + List of sources to populate environment variables in the container. + The keys defined within a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take precedence. + Values defined by an Env with a duplicate key will take precedence. + Cannot be updated. items: description: EnvFromSource represents the source of a set of ConfigMaps @@ -1291,15 +1248,16 @@ spec: description: The ConfigMap to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap must be defined type: boolean type: object + x-kubernetes-map-type: atomic prefix: description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. @@ -1308,51 +1266,54 @@ spec: description: The Secret to select from 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret must be defined type: boolean type: object + x-kubernetes-map-type: atomic type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images - This field is optional to allow higher level config management - to default or override container images in workload controllers - like Deployments and StatefulSets.' + description: |- + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. type: string imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. - Defaults to Always if :latest tag is specified, or IfNotPresent - otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + description: |- + Image pull policy. + One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/containers/images#updating-images type: string lifecycle: - description: Actions that the management system should take - in response to container lifecycle events. Cannot be updated. + description: |- + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. properties: postStart: - description: 'PostStart is called immediately after a container - is created. If the handler fails, the container is terminated - and restarted according to its restart policy. Other management - of the container blocks until the hook completes. More - info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PostStart is called immediately after a container is created. If the handler fails, + the container is terminated and restarted according to its restart policy. + Other management of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1361,9 +1322,9 @@ spec: 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. + 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. @@ -1373,9 +1334,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1392,22 +1353,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1417,40 +1380,37 @@ spec: 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. + 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 type: object preStop: - description: 'PreStop is called immediately before a container - is terminated due to an API request or management event - such as liveness/startup probe failure, preemption, resource - contention, etc. The handler is not called if the container - crashes or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the container - will eventually terminate within the Pod''s termination - grace period (unless delayed by finalizers). Other management - of the container blocks until the hook completes or until - the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + description: |- + PreStop is called immediately before a container is terminated due to an + API request or management event such as liveness/startup probe failure, + preemption, resource contention, etc. The handler is not called if the + container crashes or exits. The Pod's termination grace period countdown begins before the + PreStop hook is executed. Regardless of the outcome of the handler, the + container will eventually terminate within the Pod's termination grace + period (unless delayed by finalizers). Other management of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 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. + 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 @@ -1459,9 +1419,9 @@ spec: 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. + 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. @@ -1471,9 +1431,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1490,22 +1450,24 @@ spec: 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. + 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. + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward compatibility. - There are no validation of this field and lifecycle - hooks will fail in runtime when tcp handler is specified. + description: |- + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for the backward compatibility. There are no validation of this field and + lifecycle hooks will fail in runtime when tcp handler is specified. properties: host: description: 'Optional: Host name to connect to, @@ -1515,9 +1477,10 @@ spec: 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. + 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 @@ -1525,36 +1488,36 @@ spec: type: object type: object livenessProbe: - description: 'Periodic probe of container liveness. Container - will be restarted if the probe fails. Cannot be updated. More - info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1562,10 +1525,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1574,9 +1539,9 @@ spec: 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. + 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 @@ -1586,9 +1551,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1605,33 +1570,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1646,78 +1613,82 @@ spec: 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. + 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. + 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' + 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 name: - description: Name of the container specified as a DNS_LABEL. + description: |- + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. type: string ports: - description: List of ports to expose from the container. Not - specifying a port here DOES NOT prevent that port from being - exposed. Any port which is listening on the default "0.0.0.0" - address inside a container will be accessible from the network. - Modifying this array with strategic merge patch may corrupt - the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + description: |- + List of ports to expose from the container. Not specifying a port here + DOES NOT prevent that port from being exposed. Any port which is + listening on the default "0.0.0.0" address inside a container will be + accessible from the network. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. items: description: ContainerPort represents a network port in a single container. properties: containerPort: - description: Number of port to expose on the pod's IP - address. This must be a valid port number, 0 < x < 65536. + description: |- + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. format: int32 type: integer hostIP: description: What host IP to bind the external port to. type: string hostPort: - description: Number of port to expose on the host. If - specified, this must be a valid port number, 0 < x < - 65536. If HostNetwork is specified, this must match - ContainerPort. Most containers do not need this. + description: |- + Number of port to expose on the host. + If specified, this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. format: int32 type: integer name: - description: If specified, this must be an IANA_SVC_NAME - and unique within the pod. Each named port in a pod - must have a unique name. Name for the port that can - be referred to by services. + description: |- + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + named port in a pod must have a unique name. Name for the port that can be + referred to by services. type: string protocol: default: TCP - description: Protocol for port. Must be UDP, TCP, or SCTP. + description: |- + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". type: string required: @@ -1729,36 +1700,36 @@ spec: - protocol x-kubernetes-list-type: map readinessProbe: - description: 'Periodic probe of container service readiness. - Container will be removed from service endpoints if the probe - fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe fails. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -1766,10 +1737,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -1778,9 +1751,9 @@ spec: 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. + 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 @@ -1790,9 +1763,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -1809,33 +1782,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -1850,54 +1825,58 @@ spec: 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. + 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. + 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' + 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: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only - be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -1914,8 +1893,9 @@ spec: - 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/' + 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: @@ -1924,33 +1904,34 @@ spec: - 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/' + 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 securityContext: - description: 'SecurityContext defines the security options the - container should be run with. If set, the fields of SecurityContext - override the equivalent fields of PodSecurityContext. More - info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: |- + SecurityContext defines the security options the container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 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.' + 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. + 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 @@ -1968,60 +1949,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2041,108 +2022,101 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 startupProbe: - description: 'StartupProbe indicates that the Pod has successfully - initialized. If specified, no other probes are executed until - this completes successfully. If this probe fails, the Pod - will be restarted, just as if the livenessProbe failed. This - can be used to provide different probe parameters at the beginning - of a Pod''s lifecycle, when it might take a long time to load - data or warm a cache, than during steady-state operation. - This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: |- + StartupProbe indicates that the Pod has successfully initialized. + If specified, no other probes are executed until this completes successfully. + If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + when it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 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. + 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. + 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. + 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 @@ -2150,10 +2124,12 @@ spec: 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." + default: "" + 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). + + If this is not specified, the default behavior is defined by gRPC. type: string required: - port @@ -2162,9 +2138,9 @@ spec: 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. + 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 @@ -2174,9 +2150,9 @@ spec: to be used in HTTP probes properties: name: - description: The header field name. This will - be canonicalized upon output, so case-variant - names will be understood as the same header. + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. type: string value: description: The header field value @@ -2193,33 +2169,35 @@ spec: 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. + 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. + 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' + 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. + 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. + 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: @@ -2234,77 +2212,76 @@ spec: 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. + 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. + 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' + 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 stdin: - description: Whether this container should allocate a buffer - for stdin in the container runtime. If this is not set, reads - from stdin in the container will always result in EOF. Default - is false. + description: |- + Whether this container should allocate a buffer for stdin in the container runtime. If this + is not set, reads from stdin in the container will always result in EOF. + Default is false. type: boolean stdinOnce: - description: Whether the container runtime should close the - stdin channel after it has been opened by a single attach. - When stdin is true the stdin stream will remain open across - multiple attach sessions. If stdinOnce is set to true, stdin - is opened on container start, is empty until the first client - attaches to stdin, and then remains open and accepts data - until the client disconnects, at which time stdin is closed - and remains closed until the container is restarted. If this - flag is false, a container processes that reads from stdin - will never receive an EOF. Default is false + description: |- + Whether the container runtime should close the stdin channel after it has been opened by + a single attach. When stdin is true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + first client attaches to stdin, and then remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin will never receive an EOF. + Default is false type: boolean terminationMessagePath: - description: 'Optional: Path at which the file to which the - container''s termination message will be written is mounted - into the container''s filesystem. Message written is intended - to be brief final status, such as an assertion failure message. - Will be truncated by the node if greater than 4096 bytes. - The total message length across all containers will be limited - to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + description: |- + Optional: Path at which the file to which the container's termination message + will be written is mounted into the container's filesystem. + Message written is intended to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. + Cannot be updated. type: string terminationMessagePolicy: - description: Indicate how the termination message should be - populated. File will use the contents of terminationMessagePath - to populate the container status message on both success and - failure. FallbackToLogsOnError will use the last chunk of - container log output if the termination message file is empty - and the container exited with an error. The log output is - limited to 2048 bytes or 80 lines, whichever is smaller. Defaults - to File. Cannot be updated. + description: |- + Indicate how the termination message should be populated. File will use the contents of + terminationMessagePath to populate the container status message on both success and failure. + FallbackToLogsOnError will use the last chunk of container log output if the termination + message file is empty and the container exited with an error. + The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + Defaults to File. + Cannot be updated. type: string tty: - description: Whether this container should allocate a TTY for - itself, also requires 'stdin' to be true. Default is false. + description: |- + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. type: boolean volumeDevices: description: volumeDevices is the list of block devices to be @@ -2327,40 +2304,44 @@ spec: type: object type: array volumeMounts: - description: Pod volumes to mount into the container's filesystem. + description: |- + Pod volumes to mount into the container's filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. properties: mountPath: - description: Path within the container at which the volume - should be mounted. Must not contain ':'. + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are - propagated from the host to container and the other - way around. When not set, MountPropagationNone is used. + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. This field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which - the container's volume should be mounted. Behaves similarly - to SubPath but environment variable references $(VAR_NAME) - are expanded using the container's environment. Defaults - to "" (volume's root). SubPathExpr and SubPath are mutually - exclusive. + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. type: string required: - mountPath @@ -2368,17 +2349,20 @@ spec: type: object type: array workingDir: - description: Container's working directory. If not specified, - the container runtime's default will be used, which might - be configured in the container image. Cannot be updated. + description: |- + Container's working directory. + If not specified, the container runtime's default will be used, which + might be configured in the container image. + Cannot be updated. type: string required: - name type: object type: array monitoring: - description: '(Optional) Monitoring sets configuration options for - YDB observability Default: ""' + description: |- + (Optional) Monitoring sets configuration options for YDB observability + Default: "" properties: enabled: type: boolean @@ -2389,10 +2373,10 @@ spec: description: RelabelConfig allows dynamic rewriting of the label set, being applied to sample before ingestion. 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' + 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. @@ -2408,26 +2392,26 @@ spec: 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' + 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 + 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. + 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 @@ -2437,9 +2421,10 @@ spec: nodeSelector: additionalProperties: type: string - description: '(Optional) NodeSelector is a selector which must be - true for the pod to fit on a node. Selector which must match a node''s - labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + description: |- + (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ type: object nodes: description: Number of nodes (pods) @@ -2447,38 +2432,45 @@ spec: type: integer operatorSync: default: true - description: Enables or disables operator's reconcile loop. `false` - means all the Pods are running, but the reconcile is effectively - turned off. `true` means the default state of the system, all Pods - running, operator reacts to specification change of this Storage - resource. + description: |- + Enables or disables operator's reconcile loop. + `false` means all the Pods are running, but the reconcile is effectively turned off. + `true` means the default state of the system, all Pods running, operator reacts + to specification change of this Storage resource. type: boolean pause: default: false - description: The state of the Storage processes. `true` means all - the Storage Pods are being killed, but the Storage resource is persisted. + description: |- + The state of the Storage processes. + `true` means all the Storage Pods are being killed, but the Storage resource is persisted. `false` means the default state of the system, all Pods running. type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. type: string resources: - description: '(Optional) Container resource limits. Any container - limits can be specified. Default: (not specified)' + description: |- + (Optional) Container resource limits. Any container limits + can be specified. + Default: (not specified) properties: claims: - description: "Claims lists the names of resources, defined in - spec.resourceClaims, that are used by this container. \n This - is an alpha field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can only be set - for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry in pod.spec.resourceClaims - of the Pod where this field is used. It makes that resource - available inside a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -2494,8 +2486,9 @@ spec: - 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/' + 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: @@ -2504,28 +2497,34 @@ spec: - 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/' + 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 secrets: - description: 'Secret names that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/secrets//`' + description: |- + Secret names that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/secrets//` items: - description: LocalObjectReference contains enough information to - let you locate the referenced object inside the same namespace. + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic type: array service: - description: '(Optional) Storage services parameter overrides Default: - (not specified)' + description: |- + (Optional) Storage services parameter overrides + Default: (not specified) properties: grpc: properties: @@ -2544,9 +2543,9 @@ spec: enabled: type: boolean ipFamily: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an - IP expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string targetNameOverride: type: string @@ -2555,9 +2554,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2574,9 +2573,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2585,6 +2584,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2593,9 +2593,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2604,6 +2604,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2614,9 +2615,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2625,6 +2626,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2641,9 +2643,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2660,9 +2662,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2671,6 +2673,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2679,9 +2682,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2690,6 +2693,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2700,9 +2704,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2711,6 +2715,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2727,9 +2732,9 @@ spec: type: object ipFamilies: items: - description: IPFamily represents the IP Family (IPv4 or - IPv6). This type is used to express the family of an IP - expressed by a type (e.g. service.spec.ipFamilies). + description: |- + IPFamily represents the IP Family (IPv4 or IPv6). This type is used + to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type: string type: array ipFamilyPolicy: @@ -2746,9 +2751,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2757,6 +2762,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic certificate: description: SecretKeySelector selects a key of a Secret. properties: @@ -2765,9 +2771,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2776,6 +2782,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic enabled: type: boolean key: @@ -2786,9 +2793,9 @@ spec: be a valid secret key. 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 type: string optional: description: Specify whether the Secret or its key @@ -2797,6 +2804,7 @@ spec: required: - key type: object + x-kubernetes-map-type: atomic required: - enabled type: object @@ -2823,78 +2831,79 @@ spec: tolerations: description: (Optional) If specified, the pod's tolerations. items: - description: The pod this Toleration is attached to tolerates any - taint that matches the triple using the matching - operator . + 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. + 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. + 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. + 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. + 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. + 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 topologySpreadConstraints: - description: (Optional) If specified, the pod's topologySpreadConstraints. + description: |- + (Optional) If specified, the pod's topologySpreadConstraints. All topologySpreadConstraints are ANDed. items: description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. properties: labelSelector: - description: LabelSelector is used to find matching pods. Pods - that match this label selector are counted to determine the - number of pods in their corresponding topology domain. + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. 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 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: |- + 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. + 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 @@ -2906,121 +2915,125 @@ spec: 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. + 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 matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select - the pods over which spreading will be calculated. The keys - are used to lookup values from the incoming pod labels, those - key-value labels are ANDed with labelSelector to select the - group of existing pods over which spreading will be calculated - for the incoming pod. Keys that don't exist in the incoming - pod labels will be ignored. A null or empty list means only - match against labelSelector. + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. items: type: string type: array x-kubernetes-list-type: atomic maxSkew: - description: 'MaxSkew describes the degree to which pods may - be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between the number - of matching pods in the target topology and the global minimum. - The global minimum is the minimum number of matching pods - in an eligible domain or zero if the number of eligible domains - is less than MinDomains. For example, in a 3-zone cluster, - MaxSkew is set to 1, and pods with the same labelSelector - spread as 2/2/1: In this case, the global minimum is 1. | - zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 to become - 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) - on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies that satisfy - it. It''s a required field. Default value is 1 and 0 is not - allowed.' + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. format: int32 type: integer minDomains: - description: "MinDomains indicates a minimum number of eligible - domains. When the number of eligible domains with matching - topology keys is less than minDomains, Pod Topology Spread - treats \"global minimum\" as 0, and then the calculation of - Skew is performed. And when the number of eligible domains - with matching topology keys equals or greater than minDomains, - this value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, scheduler - won't schedule more than maxSkew Pods to those domains. If - value is nil, the constraint behaves as if MinDomains is equal - to 1. Valid values are integers greater than 0. When value - is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For - example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains - is set to 5 and pods with the same labelSelector spread as - 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), so \"global - minimum\" is treated as 0. In this situation, new pod with - the same labelSelector cannot be scheduled, because computed - skew will be 3(3 - 0) if new Pod is scheduled to any of the - three zones, it will violate MaxSkew. \n This is a beta field - and requires the MinDomainsInPodTopologySpread feature gate - to be enabled (enabled by default)." + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + + This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). format: int32 type: integer nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will treat - Pod's nodeAffinity/nodeSelector when calculating pod topology - spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector - are included in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. \n - If this value is nil, the behavior is equivalent to the Honor - policy. This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will treat node - taints when calculating pod topology spread skew. Options - are: - Honor: nodes without taints, along with tainted nodes - for which the incoming pod has a toleration, are included. + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. - \n If this value is nil, the behavior is equivalent to the - Ignore policy. This is a beta-level feature default enabled - by the NodeInclusionPolicyInPodTopologySpread feature flag." + + If this value is nil, the behavior is equivalent to the Ignore policy. + This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. type: string topologyKey: - description: TopologyKey is the key of node labels. Nodes that - have a label with this key and identical values are considered - to be in the same topology. We consider each - as a "bucket", and try to put balanced number of pods into - each bucket. We define a domain as a particular instance of - a topology. Also, we define an eligible domain as a domain - whose nodes meet the requirements of nodeAffinityPolicy and - nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain of - that topology. It's a required field. + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. type: string whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a - pod if it doesn''t satisfy the spread constraint. - DoNotSchedule - (default) tells the scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any location, but - giving higher precedence to topologies that would help reduce - the skew. A constraint is considered "Unsatisfiable" for - an incoming pod if and only if every possible node assignment - for that pod would violate "MaxSkew" on some topology. For - example, in a 3-zone cluster, MaxSkew is set to 1, and pods - with the same labelSelector spread as 3/1/1: | zone1 | zone2 - | zone3 | | P P P | P | P | If WhenUnsatisfiable is - set to DoNotSchedule, incoming pod can only be scheduled to - zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on - zone2(zone3) satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t make it *more* - imbalanced. It''s a required field.' + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. type: string required: - maxSkew @@ -3033,46 +3046,49 @@ spec: - whenUnsatisfiable x-kubernetes-list-type: map version: - description: '(Optional) YDBVersion sets the explicit version of the - YDB image Default: ""' + description: |- + (Optional) YDBVersion sets the explicit version of the YDB image + Default: "" type: string volumes: - description: 'Additional volumes that will be mounted into the well-known - directory of every storage pod. Directory: `/opt/ydb/volumes/`. - Only `hostPath` volume type is supported for now.' + description: |- + Additional volumes that will be mounted into the well-known directory of + every storage pod. Directory: `/opt/ydb/volumes/`. + Only `hostPath` volume type is supported for now. items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty).' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly - setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk - resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - volumeID @@ -3094,10 +3110,10 @@ spec: storage type: string fsType: - description: fsType is Filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: description: 'kind expected values are Shared: multiple @@ -3106,8 +3122,9 @@ spec: disk (only in managed availability set). defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean required: - diskName @@ -3118,8 +3135,9 @@ spec: on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretName: description: secretName is the name of secret that contains @@ -3137,8 +3155,9 @@ spec: shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection - of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it items: type: string type: array @@ -3147,59 +3166,70 @@ spec: rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the - path to key ring for User, default is /etc/ceph/user.secret - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference - to the authentication secret for User, default is empty. - More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, - default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and - mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Examples: "ext4", "xfs", "ntfs". Implicitly inferred to - be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: boolean secretRef: - description: 'secretRef is optional: points to a secret - object containing parameters used to connect to OpenStack.' + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - volumeID @@ -3209,27 +3239,25 @@ spec: this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items if unspecified, each key-value pair in - the Data field of the referenced ConfigMap will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the ConfigMap, the volume setup will error unless it is - marked optional. Paths must be relative and may not contain - the '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -3237,22 +3265,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -3260,54 +3287,58 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic csi: description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles - this volume. Consult with your admin for the correct name - as registered in the cluster. + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". - If not provided, the empty value is passed to the associated - CSI driver which will determine the default filesystem - to apply. + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the - secret object containing sensitive information to pass - to the CSI driver to complete the CSI NodePublishVolume - and NodeUnpublishVolume calls. This field is optional, - and may be empty if no secret is required. If the secret - object contains more than one secret, all secret references - are passed. + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration - for the volume. Defaults to false (read/write). + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties - that are passed to the CSI driver. Consult your driver's - documentation for supported values. + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. type: object required: - driver @@ -3317,16 +3348,15 @@ spec: that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files - by default. Must be a Optional: mode bits used to set - permissions on created files by default. Must be an octal - value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: @@ -3351,16 +3381,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions - on this file, must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -3371,10 +3400,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, requests.cpu and requests.memory) - are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -3394,113 +3422,125 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that - shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir properties: medium: - description: 'medium represents what type of storage medium - should back this directory. The default is "" which means - to use the node''s default medium. Must be an empty string - (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage - required for this EmptyDir volume. The size limit is also - applicable for memory medium. The maximum usage on memory - medium EmptyDir would be the minimum value between the - SizeLimit specified here and the sum of memory limits - of all containers in a pod. The default is nil which means - that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled - by a cluster storage driver. The volume's lifecycle is tied - to the pod that defines it - it will be created before the - pod starts, and deleted when the pod is removed. \n Use this - if: a) the volume is only needed while the pod runs, b) features - of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time." + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to - provision the volume. The pod in which this EphemeralVolumeSource - is embedded will be the owner of the PVC, i.e. the PVC - will be deleted together with the pod. The name of the - PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. - Pod validation will reject the pod if the concatenated - name is not valid for a PVC (for example, too long). \n - An existing PVC with that name that is not owned by the - pod will *not* be used for the pod to avoid using an unrelated + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until - the unrelated PVC is removed. If such a pre-created PVC - is meant to be used by the pod, the PVC has to updated - with an owner reference to the pod once the pod exists. - Normally this should not be necessary, but it may be useful - when manually reconstructing a broken cluster. \n This - field is read-only and no changes will be made by Kubernetes - to the PVC after it has been created. \n Required, must - not be nil." + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. properties: metadata: - description: May contain labels and annotations that - will be copied into the PVC when creating it. No other - fields are allowed and will be rejected during validation. + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. type: object spec: - description: The specification for the PersistentVolumeClaim. - The entire content is copied unchanged into the PVC - that gets created from this template. The same fields - as in a PersistentVolumeClaim are also valid here. + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. properties: accessModes: - description: 'accessModes contains the desired access - modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 items: type: string type: array dataSource: - description: 'dataSource field can be used to specify - either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the - provisioner or an external controller can support - the specified data source, it will create a new - volume based on the contents of the specified - data source. When the AnyVolumeDataSource feature - gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will - be copied to dataSource when dataSourceRef.namespace - is not specified. If the namespace is specified, - then dataSourceRef will not be copied to dataSource.' + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3514,46 +3554,38 @@ spec: - kind - name type: object + x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object - from which to populate the volume with data, if - a non-empty volume is desired. This may be any - object from a non-empty API group (non core object) - or a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. - This field will replace the functionality of the - dataSource field and as such if both fields are - non-empty, they must have the same value. For - backwards compatibility, when namespace isn''t - specified in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the same value - automatically if one of them is empty and the - other is non-empty. When namespace is specified - in dataSourceRef, dataSource isn''t set to the - same value and must be empty. There are three - important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types - of objects, dataSourceRef allows any non-core - object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping - them), dataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - * While dataSource only allows local objects, - dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource - feature gate to be enabled. (Alpha) Using the - namespace field of dataSourceRef requires the - CrossNamespaceVolumeDataSource feature gate to - be enabled.' + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, - the specified Kind must be in the core API - group. For any other third-party types, APIGroup - is required. + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: description: Kind is the type of resource being @@ -3564,45 +3596,41 @@ spec: referenced type: string namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace - is specified, a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent namespace - to allow that namespace's owner to accept - the reference. See the ReferenceGrant documentation - for details. (Alpha) This field requires the - CrossNamespaceVolumeDataSource feature gate - to be enabled. + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify - resource requirements that are lower than previous - value but must still be higher than capacity recorded - in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources properties: claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field - and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name - of one entry in pod.spec.resourceClaims - of the Pod where this field is used. - It makes that resource available inside - a container. + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. type: string required: - name @@ -3618,8 +3646,9 @@ spec: - 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/' + 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: @@ -3628,12 +3657,11 @@ spec: - 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/' + 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 selector: @@ -3645,28 +3673,24 @@ spec: 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 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: |- + 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 + 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 @@ -3679,23 +3703,22 @@ spec: 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. + 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 storageClassName: - description: 'storageClassName is the name of the - StorageClass required by the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 type: string volumeMode: - description: volumeMode defines what type of volume - is required by the claim. Value of Filesystem - is implied when not included in claim spec. + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. type: string volumeName: description: volumeName is the binding reference @@ -3712,19 +3735,19 @@ spec: pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. TODO: how do we prevent errors in the - filesystem from compromising the machine' + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean targetWWNs: description: 'targetWWNs is Optional: FC target worldwide @@ -3733,26 +3756,27 @@ spec: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers - (wwids) Either wwids or combination of targetWWNs and - lun must be set, but not both simultaneously.' + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource - that is provisioned/attached using an exec based plugin. + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. properties: driver: description: driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". The default filesystem depends - on FlexVolume script. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. type: string options: additionalProperties: @@ -3761,22 +3785,25 @@ spec: command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference - to the secret object containing sensitive information - to pass to the plugin scripts. This may be empty if no - secret object is specified. If the secret object contains - more than one secret, all secrets are passed to the plugin - scripts.' + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic required: - driver type: object @@ -3786,9 +3813,9 @@ spec: service being running properties: datasetName: - description: datasetName is Name of the dataset stored as - metadata -> name on the dataset for Flocker should be - considered as deprecated + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated type: string datasetUUID: description: datasetUUID is the UUID of the dataset. This @@ -3796,52 +3823,54 @@ spec: type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource - that is attached to a kubelet''s host machine and then exposed - to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk properties: fsType: - description: 'fsType is filesystem type of the volume that - you want to mount. Tip: Ensure that the filesystem type - is supported by the host operating system. Examples: "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from - compromising the machine' type: string partition: - description: 'partition is the partition in the volume that - you want to mount. If omitted, the default is to mount - by volume name. Examples: For volume /dev/sda1, you specify - the partition as "1". Similarly, the volume partition - for /dev/sda is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in - GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular - revision. DEPRECATED: GitRepo is deprecated. To provision - a container with a git repo, mount an EmptyDir into an InitContainer - that clones the repo using git, then mount the EmptyDir into - the Pod''s container.' + description: |- + gitRepo represents a git repository at a particular revision. + DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. properties: directory: - description: directory is the target directory name. Must - not contain or start with '..'. If '.' is supplied, the - volume directory will be the git repository. Otherwise, - if specified, the volume will contain the git repository - in the subdirectory with the given name. + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. type: string repository: description: repository is the URL @@ -3854,51 +3883,58 @@ spec: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md properties: endpoints: - description: 'endpoints is the endpoint name that details - Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + endpoints is the endpoint name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string path: - description: 'path is the Glusterfs volume path. More info: - https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: string readOnly: - description: 'readOnly here will force the Glusterfs volume - to be mounted with read-only permissions. Defaults to - false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory - on the host machine that is directly exposed to the container. - This is generally used for system agents or other privileged - things that are allowed to see the host machine. Most containers - will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- TODO(jonesdl) We need to restrict who can use host directory - mounts and who can/can not mount host directories as read/write.' + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath properties: path: - description: 'path of the directory on the host. If the - path is a symlink, it will follow the link to the real - path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string type: - description: 'type for HostPath Volume Defaults to "" More - info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is - attached to a kubelet''s host machine and then exposed to - the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md properties: chapAuthDiscovery: description: chapAuthDiscovery defines whether support iSCSI @@ -3909,55 +3945,57 @@ spec: Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses - an iSCSI transport. Defaults to 'default' (tcp). + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The - portal is either an IP or ip_addr:port if the port is - other than default (typically TCP ports 860 and 3260). + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. type: boolean secretRef: description: secretRef is the CHAP Secret for iSCSI target and initiator 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal - is either an IP or ip_addr:port if the port is other than - default (typically TCP ports 860 and 3260). + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -3965,43 +4003,51 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique - within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string nfs: - description: 'nfs represents an NFS mount on the host that shares - a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs properties: path: - description: 'path that is exported by the NFS server. More - info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string readOnly: - description: 'readOnly here will force the NFS export to - be mounted with read-only permissions. Defaults to false. - More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: boolean server: - description: 'server is the hostname or IP address of the - NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a - reference to a PersistentVolumeClaim in the same namespace. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim - in the same namespace as the pod using this volume. More - info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims type: string readOnly: - description: readOnly Will force the ReadOnly setting in - VolumeMounts. Default false. + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. type: boolean required: - claimName @@ -4011,10 +4057,10 @@ spec: persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: description: pdID is the ID that identifies Photon Controller @@ -4028,14 +4074,15 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount - Must be a filesystem type supported by the host operating - system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean volumeID: description: volumeID uniquely identifies a Portworx volume @@ -4048,14 +4095,13 @@ spec: configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path are - not affected by this setting. This might be in conflict - with other options that affect the file mode, like fsGroup, - and the result can be other mode bits set. + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer sources: @@ -4069,17 +4115,14 @@ spec: data to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the ConfigMap, the volume - setup will error unless it is marked optional. - Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4088,25 +4131,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4114,16 +4153,16 @@ spec: type: object type: array 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 type: string optional: description: optional specify whether the ConfigMap or its keys must be defined type: boolean type: object + x-kubernetes-map-type: atomic downwardAPI: description: downwardAPI information about the downwardAPI data to project @@ -4153,18 +4192,15 @@ spec: required: - fieldPath type: object + x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to - set permissions on this file, must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: @@ -4176,10 +4212,9 @@ spec: with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the - container: only resources limits and requests - (limits.cpu, limits.memory, requests.cpu - and requests.memory) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. properties: containerName: description: 'Container name: required @@ -4201,6 +4236,7 @@ spec: required: - resource type: object + x-kubernetes-map-type: atomic required: - path type: object @@ -4211,17 +4247,14 @@ spec: to project properties: items: - description: items if unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file - whose name is the key and content is the value. - If specified, the listed keys will be projected - into the specified paths, and unlisted keys - will not be present. If a key is specified which - is not present in the Secret, the volume setup - will error unless it is marked optional. Paths - must be relative and may not contain the '..' - path or start with '..'. + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. @@ -4230,25 +4263,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. - Must be an octal value between 0000 and - 0777 or a decimal value between 0 and - 511. YAML accepts both octal and decimal - values, JSON requires decimal values for - mode bits. If not specified, the volume - defaultMode will be used. This might be - in conflict with other options that affect - the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be - an absolute path. May not contain the - path element '..'. May not start with - the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4256,44 +4285,41 @@ spec: type: object type: array 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 type: string optional: description: optional field specify whether the Secret or its key must be defined type: boolean type: object + x-kubernetes-map-type: atomic serviceAccountToken: description: serviceAccountToken is information about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience - of the token. A recipient of a token must identify - itself with an identifier specified in the audience - of the token, and otherwise should reject the - token. The audience defaults to the identifier - of the apiserver. + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested - duration of validity of the service account - token. As the token approaches expiration, the - kubelet volume plugin will proactively rotate - the service account token. The kubelet will - start trying to rotate the token if the token - is older than 80 percent of its time to live - or if the token is older than 24 hours.Defaults - to 1 hour and must be at least 10 minutes. + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the - mount point of the file to project the token - into. + description: |- + path is the path relative to the mount point of the file to project the + token into. type: string required: - path @@ -4306,28 +4332,30 @@ spec: that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no - group + description: |- + group to map volume access to + Default is no group type: string readOnly: - description: readOnly here will force the Quobyte volume - to be mounted with read-only permissions. Defaults to - false. + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. type: boolean registry: - description: registry represents a single or multiple Quobyte - Registry services specified as a string as host:port pair - (multiple entries are separated with commas) which acts - as the central registry for volumes + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the - Backend Used with dynamically provisioned Quobyte volumes, - value is set by the plugin + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount - user + description: |- + user to map volume access to + Defaults to serivceaccount user type: string volume: description: volume is a string that references an already @@ -4338,53 +4366,66 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the - host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md properties: fsType: - description: 'fsType is the filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem - type is supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd type: string image: - description: 'image is the rados image name. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: - description: 'keyring is the path to key ring for RBDUser. - Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string readOnly: - description: 'readOnly here will force the ReadOnly setting - in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: boolean secretRef: - description: 'secretRef is name of the authentication secret - for RBDUser. If provided overrides keyring. Default is - nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - image @@ -4395,9 +4436,11 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". type: string gateway: description: gateway is the host address of the ScaleIO @@ -4408,26 +4451,29 @@ spec: Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO - user and other sensitive information. If this is not provided, - Login operation will fail. + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic sslEnabled: description: sslEnabled Flag enable/disable SSL communication with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for - a volume should be ThickProvisioned or ThinProvisioned. + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: @@ -4439,9 +4485,9 @@ spec: configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already - created in the ScaleIO system that is associated with - this volume source. + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. type: string required: - gateway @@ -4449,31 +4495,30 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate - this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to - set permissions on created files by default. Must be an - octal value between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. Defaults to - 0644. Directories within the path are not affected by - this setting. This might be in conflict with other options - that affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer items: - description: items If unspecified, each key-value pair in - the Data field of the referenced Secret will be projected - into the volume as a file whose name is the key and content - is the value. If specified, the listed keys will be projected - into the specified paths, and unlisted keys will not be - present. If a key is specified which is not present in - the Secret, the volume setup will error unless it is marked - optional. Paths must be relative and may not contain the - '..' path or start with '..'. + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. items: description: Maps a string key to a path within a volume. properties: @@ -4481,22 +4526,21 @@ spec: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to - set permissions on this file. Must be an octal value - between 0000 and 0777 or a decimal value between - 0 and 511. YAML accepts both octal and decimal values, - JSON requires decimal values for mode bits. If not - specified, the volume defaultMode will be used. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer path: - description: path is the relative path of the file - to map the key to. May not be an absolute path. - May not contain the path element '..'. May not start - with the string '..'. + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -4508,8 +4552,9 @@ spec: its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the - pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret type: string type: object storageos: @@ -4517,39 +4562,41 @@ spec: and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must - be a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly - here will force the ReadOnly setting in VolumeMounts. + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining - the StorageOS API credentials. If not specified, default - values will be attempted. + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. 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?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object + x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the - StorageOS volume. Volume names are only unique within - a namespace. + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the - volume within StorageOS. If no namespace is specified - then the Pod's namespace will be used. This allows the - Kubernetes name scoping to be mirrored within StorageOS - for tighter integration. Set VolumeName to any name to - override the default behaviour. Set to "default" if you - are not using namespaces within StorageOS. Namespaces - that do not pre-exist within StorageOS will be created. + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. type: string type: object vsphereVolume: @@ -4557,10 +4604,10 @@ spec: and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be - a filesystem type supported by the host operating system. - Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: description: storagePolicyID is the storage Policy Based @@ -4593,45 +4640,35 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n \ttype FooStatus struct{ \t // Represents the observations - of a foo's current state. \t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\" \t // - +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map - \t // +listMapKey=type \t Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields - \t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -4646,10 +4683,6 @@ spec: type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -4671,9 +4704,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] From 611c5e56ee029a0a09651e86cdbc9225b58338d7 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Mon, 9 Dec 2024 18:14:08 +0100 Subject: [PATCH 50/70] feat: add minor/patch toggle to release PR (#277) --- .github/workflows/create-release-pr.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index f8e6bba0..2848731b 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -2,6 +2,15 @@ name: create-release-pr on: workflow_dispatch: + inputs: + bump_type: + description: 'Which version to bump when creating a release PR: minor or patch?' + required: true + default: 'patch' + type: choice + options: + - patch + - minor jobs: create-release-pr: @@ -14,7 +23,7 @@ jobs: uses: miniscruff/changie-action@v2 with: version: latest - args: batch patch + args: batch ${{ github.event.inputs.bump_type }} - name: merge-changes uses: miniscruff/changie-action@v2 @@ -48,4 +57,8 @@ jobs: title: Release ${{ steps.latest.outputs.output }} branch: release/${{ steps.latest.outputs.output }} commit-message: Release ${{ steps.latest.outputs.output }} + body: | + Here is what a new entry in changelog would look like: + + [`.changes/${{ steps.latest.outputs.output }}.md`](https://github.com/${{ github.repository }}/blob/release/${{ steps.latest.outputs.output }}/.changes/${{ steps.latest.outputs.output }}.md) token: ${{ github.token }} From bd1d256f82f843403cfb085e4c3568930a5b253a Mon Sep 17 00:00:00 2001 From: Nikita Kozlovskii Date: Fri, 27 Dec 2024 09:48:10 +0100 Subject: [PATCH 51/70] customize securityContext for Database and Storage (#271) --- .../unreleased/Added-20241209-182500.yaml | 3 + api/v1alpha1/database_types.go | 2 + api/v1alpha1/storage_types.go | 2 + api/v1alpha1/zz_generated.deepcopy.go | 10 + deploy/ydb-operator/crds/database.yaml | 338 ++++++++++++++++++ deploy/ydb-operator/crds/databasenodeset.yaml | 162 +++++++++ .../crds/remotedatabasenodeset.yaml | 162 +++++++++ .../crds/remotestoragenodeset.yaml | 162 +++++++++ deploy/ydb-operator/crds/storage.yaml | 338 ++++++++++++++++++ deploy/ydb-operator/crds/storagenodeset.yaml | 162 +++++++++ internal/resources/database_statefulset.go | 10 +- internal/resources/security_context.go | 47 +++ internal/resources/security_context_test.go | 55 +++ internal/resources/storage_statefulset.go | 7 +- 14 files changed, 1447 insertions(+), 13 deletions(-) create mode 100644 .changes/unreleased/Added-20241209-182500.yaml create mode 100644 internal/resources/security_context.go create mode 100644 internal/resources/security_context_test.go diff --git a/.changes/unreleased/Added-20241209-182500.yaml b/.changes/unreleased/Added-20241209-182500.yaml new file mode 100644 index 00000000..74088f43 --- /dev/null +++ b/.changes/unreleased/Added-20241209-182500.yaml @@ -0,0 +1,3 @@ +kind: Added +body: customize Database and Storage container securityContext +time: 2024-12-09T18:25:00.648464+01:00 diff --git a/api/v1alpha1/database_types.go b/api/v1alpha1/database_types.go index cf89f0f9..17c2ff5d 100644 --- a/api/v1alpha1/database_types.go +++ b/api/v1alpha1/database_types.go @@ -168,6 +168,8 @@ type DatabaseNodeSpec struct { // (Optional) Additional custom resource annotations that are added to all resources // +optional AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"` + + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` } type DatabaseResources struct { diff --git a/api/v1alpha1/storage_types.go b/api/v1alpha1/storage_types.go index 039b3a33..5a51f07d 100644 --- a/api/v1alpha1/storage_types.go +++ b/api/v1alpha1/storage_types.go @@ -165,6 +165,8 @@ type StorageNodeSpec struct { // (Optional) Additional custom resource annotations that are added to all resources // +optional AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"` + + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` } type StorageInitJobSpec struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 60e8f7a2..d4d9dbde 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -511,6 +511,11 @@ func (in *DatabaseNodeSpec) DeepCopyInto(out *DatabaseNodeSpec) { (*out)[key] = val } } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseNodeSpec. @@ -1633,6 +1638,11 @@ func (in *StorageNodeSpec) DeepCopyInto(out *StorageNodeSpec) { (*out)[key] = val } } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageNodeSpec. diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index a80c30d8..124fc0f8 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -3152,6 +3152,182 @@ spec: required: - storageUnits type: object + securityContext: + description: SecurityContext holds security configuration that + will be applied to a container. Some fields are present in + both SecurityContext and PodSecurityContext. When both are + set, the values in SecurityContext take precedence. + 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 sharedResources: description: (Optional) Shared resources can be used by serverless databases. @@ -3594,6 +3770,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 serverlessResources: description: (Optional) If specified, created database will be "serverless". properties: diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 069ac66b..284496c4 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -2384,6 +2384,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 serverlessResources: description: (Optional) If specified, created database will be "serverless". properties: diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index f36e699b..4745a180 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -2385,6 +2385,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 serverlessResources: description: (Optional) If specified, created database will be "serverless". properties: diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index bd01e43a..2699c1c7 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -2522,6 +2522,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 service: description: |- (Optional) Storage services parameter overrides diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index 4f0b2654..24cf8520 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -4415,6 +4415,182 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object + securityContext: + description: SecurityContext holds security configuration that + will be applied to a container. Some fields are present in + both SecurityContext and PodSecurityContext. When both are + set, the values in SecurityContext take precedence. + 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 terminationGracePeriodSeconds: description: (Optional) If specified, the pod's terminationGracePeriodSeconds. format: int64 @@ -4845,6 +5021,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 service: description: |- (Optional) Storage services parameter overrides diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index ce572f1b..e08cc36a 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -2521,6 +2521,168 @@ spec: type: object x-kubernetes-map-type: atomic type: array + securityContext: + description: SecurityContext holds security configuration that will + be applied to a container. Some fields are present in both SecurityContext + and PodSecurityContext. When both are set, the values in SecurityContext + take precedence. + 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 service: description: |- (Optional) Storage services parameter overrides diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 20964efa..2455f35e 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -405,6 +405,7 @@ func (b *DatabaseStatefulSetBuilder) buildContainer() corev1.Container { if b.Spec.Image.PullPolicyName != nil { imagePullPolicy = *b.Spec.Image.PullPolicyName } + container := corev1.Container{ Name: "ydb-dynamic", Image: b.Spec.Image.Name, @@ -413,13 +414,8 @@ func (b *DatabaseStatefulSetBuilder) buildContainer() corev1.Container { Args: args, Env: b.buildEnv(), - VolumeMounts: b.buildVolumeMounts(), - SecurityContext: &corev1.SecurityContext{ - Privileged: ptr.Bool(false), - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_RAWIO"}, - }, - }, + VolumeMounts: b.buildVolumeMounts(), + SecurityContext: mergeSecurityContextWithDefaults(b.Spec.SecurityContext), } if value, ok := b.ObjectMeta.Annotations[api.AnnotationDisableLivenessProbe]; !ok || value != api.AnnotationValueTrue { diff --git a/internal/resources/security_context.go b/internal/resources/security_context.go new file mode 100644 index 00000000..c7f3367f --- /dev/null +++ b/internal/resources/security_context.go @@ -0,0 +1,47 @@ +package resources + +import ( + corev1 "k8s.io/api/core/v1" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr" +) + +func contains(s []corev1.Capability, v corev1.Capability) bool { + for _, vs := range s { + if vs == v { + return true + } + } + return false +} + +func mergeSecurityContextWithDefaults(context *corev1.SecurityContext) *corev1.SecurityContext { + var result *corev1.SecurityContext + defaultCapabilities := []corev1.Capability{"SYS_RAWIO"} + + if context != nil { + result = context.DeepCopy() + } else { + result = &corev1.SecurityContext{} + } + + // set defaults + + if result.Privileged == nil { + result.Privileged = ptr.Bool(false) + } + + if result.Capabilities == nil { + result.Capabilities = &corev1.Capabilities{ + Add: []corev1.Capability{}, + } + } + + for _, defaultCapability := range defaultCapabilities { + if !contains(result.Capabilities.Add, defaultCapability) { + result.Capabilities.Add = append(result.Capabilities.Add, defaultCapability) + } + } + + return result +} diff --git a/internal/resources/security_context_test.go b/internal/resources/security_context_test.go new file mode 100644 index 00000000..fcb0cf55 --- /dev/null +++ b/internal/resources/security_context_test.go @@ -0,0 +1,55 @@ +package resources + +import ( + "testing" + + corev1 "k8s.io/api/core/v1" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestSecurityContextMerge(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "SecurityContext builder") +} + +var _ = Describe("SecurityContext builder", func() { + It("no securityContext passed", func() { + Expect(mergeSecurityContextWithDefaults(nil)).Should(BeEquivalentTo(&corev1.SecurityContext{ + Privileged: ptr.Bool(false), + Capabilities: &corev1.Capabilities{ + Add: []corev1.Capability{"SYS_RAWIO"}, + }, + })) + }) + It("securityContext with Capabilities passed", func() { + ctx := &corev1.SecurityContext{ + Privileged: ptr.Bool(false), + Capabilities: &corev1.Capabilities{ + Add: []corev1.Capability{"SYS_PTRACE"}, + }, + } + Expect(mergeSecurityContextWithDefaults(ctx)).Should(BeEquivalentTo(&corev1.SecurityContext{ + Privileged: ptr.Bool(false), + Capabilities: &corev1.Capabilities{ + Add: []corev1.Capability{"SYS_PTRACE", "SYS_RAWIO"}, + }, + })) + }) + It("securityContext without Capabilities passed", func() { + ctx := &corev1.SecurityContext{ + Privileged: ptr.Bool(true), + RunAsUser: ptr.Int64(10), + } + Expect(mergeSecurityContextWithDefaults(ctx)).Should(BeEquivalentTo(&corev1.SecurityContext{ + Privileged: ptr.Bool(true), + RunAsUser: ptr.Int64(10), + Capabilities: &corev1.Capabilities{ + Add: []corev1.Capability{"SYS_RAWIO"}, + }, + })) + }) +}) diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index f4ec2d3a..5a15fd23 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -364,12 +364,7 @@ func (b *StorageStatefulSetBuilder) buildContainer() corev1.Container { // todo Command: command, Args: args, - SecurityContext: &corev1.SecurityContext{ - Privileged: ptr.Bool(false), - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_RAWIO"}, - }, - }, + SecurityContext: mergeSecurityContextWithDefaults(b.Spec.SecurityContext), Ports: []corev1.ContainerPort{{ Name: "grpc", ContainerPort: api.GRPCPort, From 51aa80a354b7d91ae5821602e595c01233252f99 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Fri, 27 Dec 2024 11:14:05 +0100 Subject: [PATCH 52/70] Add compatibility tests, first iteration (#276) --- .../unreleased/Added-20241204-153550.yaml | 3 + .github/workflows/compatibility-tests.yaml | 129 +++++ .github/workflows/run-tests.yml | 15 +- .golangci.yml | 12 +- README.md | 2 +- docs/tests.md | 6 +- e2e/operator-values.yaml | 10 - e2e/tests/data/ca.crt | 19 - e2e/tests/data/tls.crt | 21 - e2e/tests/data/tls.key | 27 - .../controllers/database/controller_test.go | 4 +- .../databasenodeset/controller_test.go | 4 +- .../controllers/monitoring/monitoring_test.go | 4 +- .../remotedatabasenodeset/controller_test.go | 4 +- .../remotestoragenodeset/controller_test.go | 4 +- .../controllers/storage/controller_test.go | 4 +- internal/controllers/storage/init.go | 2 +- .../storagenodeset/controller_test.go | 4 +- {e2e => tests/cfg}/kind-cluster-config.yaml | 6 + tests/cfg/operator-local-values.yaml | 5 + tests/cfg/operator-values.yaml | 5 + .../compatibility/compatibility_suite_test.go | 364 +++++++++++++ tests/data/database.crt | 21 + tests/data/database.key | 28 + tests/data/generate-crts/README.md | 13 + tests/data/generate-crts/ca.crt | 19 + tests/data/generate-crts/ca.key | 28 + tests/data/generate-crts/ca.srl | 1 + .../data/generate-crts/generate-test-certs.sh | 76 +++ ...torage-mirror-3-dc-config-staticCreds.yaml | 3 + .../data/storage-mirror-3-dc-config-tls.yaml | 3 + .../data/storage-mirror-3-dc-config.yaml | 3 + .../data/storage-mirror-3-dc-dynconfig.yaml | 3 + tests/data/storage.crt | 21 + tests/data/storage.key | 28 + .../e2e/e2e_suite_test.go | 0 {e2e/tests => tests/e2e}/smoke_test.go | 500 +++++------------- .../test-k8s-objects}/objects.go | 72 ++- tests/test-utils/test-utils.go | 368 +++++++++++++ 39 files changed, 1346 insertions(+), 495 deletions(-) create mode 100644 .changes/unreleased/Added-20241204-153550.yaml create mode 100644 .github/workflows/compatibility-tests.yaml delete mode 100644 e2e/operator-values.yaml delete mode 100644 e2e/tests/data/ca.crt delete mode 100644 e2e/tests/data/tls.crt delete mode 100644 e2e/tests/data/tls.key rename {e2e => tests/cfg}/kind-cluster-config.yaml (63%) create mode 100644 tests/cfg/operator-local-values.yaml create mode 100644 tests/cfg/operator-values.yaml create mode 100644 tests/compatibility/compatibility_suite_test.go create mode 100644 tests/data/database.crt create mode 100644 tests/data/database.key create mode 100644 tests/data/generate-crts/README.md create mode 100644 tests/data/generate-crts/ca.crt create mode 100644 tests/data/generate-crts/ca.key create mode 100644 tests/data/generate-crts/ca.srl create mode 100644 tests/data/generate-crts/generate-test-certs.sh rename {e2e/tests => tests}/data/storage-mirror-3-dc-config-staticCreds.yaml (98%) rename {e2e/tests => tests}/data/storage-mirror-3-dc-config-tls.yaml (98%) rename {e2e/tests => tests}/data/storage-mirror-3-dc-config.yaml (98%) rename {e2e/tests => tests}/data/storage-mirror-3-dc-dynconfig.yaml (98%) create mode 100644 tests/data/storage.crt create mode 100644 tests/data/storage.key rename e2e/tests/root_suite_test.go => tests/e2e/e2e_suite_test.go (100%) rename {e2e/tests => tests/e2e}/smoke_test.go (58%) rename {e2e/tests/test-objects => tests/test-k8s-objects}/objects.go (71%) create mode 100644 tests/test-utils/test-utils.go diff --git a/.changes/unreleased/Added-20241204-153550.yaml b/.changes/unreleased/Added-20241204-153550.yaml new file mode 100644 index 00000000..a324b32b --- /dev/null +++ b/.changes/unreleased/Added-20241204-153550.yaml @@ -0,0 +1,3 @@ +kind: Added +body: compatibility tests running automatically on each new tag +time: 2024-12-04T15:35:50.352507104+01:00 diff --git a/.github/workflows/compatibility-tests.yaml b/.github/workflows/compatibility-tests.yaml new file mode 100644 index 00000000..db7af57c --- /dev/null +++ b/.github/workflows/compatibility-tests.yaml @@ -0,0 +1,129 @@ +name: compatibility-tests + +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + test-compatibility: + runs-on: ubuntu-latest + steps: + - name: Maximize build space + uses: AdityaGarg8/remove-unwanted-software@v4.1 + with: + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-dotnet: 'true' + remove-swapfile: 'true' + + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # we need to know about previous tags + + - name: print the latest version without "v" + id: latest-no-v + uses: miniscruff/changie-action@v2 + with: + version: latest + args: latest --remove-prefix + + - name: determine-versions + run: | + NEW_VERSION=${{ steps.latest-no-v.outputs.output }} + + # Extract the major and minor parts of the version + MAJOR=$(echo $NEW_VERSION | cut -d. -f1) + MINOR=$(echo $NEW_VERSION | cut -d. -f2) + PREV_MINOR=$((MINOR - 1)) + + # Find the previous version tag in the format ".." + PREVIOUS_VERSION=$(git tag -l "${MAJOR}.${PREV_MINOR}.*" | sort --version-sort | tail -1) + + # If no previous version is found, fallback to a default or handle the error somehow + if [ -z "$PREVIOUS_VERSION" ]; then + echo "No previous version found, ensure your repository has proper tags." + exit 1 + fi + + # remove after creating 0.6.0 tag. + # Basically, we are incompatible with 0.4, and while there is no 0.6 (and prev minor being 0.5), + # we will run compat tests from previous patch version + if [ "$PREVIOUS_VERSION" = "0.4.42" ]; then + PREVIOUS_VERSION="0.5.30" + fi + + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.22' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential + + curl -LO https://dl.k8s.io/release/v1.25.3/bin/linux/amd64/kubectl + chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin + + HELM_VERSION="v3.10.3" + curl -sSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar -zxvf - --strip-components=1 linux-amd64/helm + chmod +x ./helm && sudo mv ./helm /usr/local/bin + + go install sigs.k8s.io/kind@v0.25.0 + + curl -sSL https://storage.yandexcloud.net/yandexcloud-ydb/install.sh | bash + + echo "$(pwd)" >> $GITHUB_PATH + echo "$HOME/ydb/bin" >> $GITHUB_PATH + echo "$HOME/go/bin" >> $GITHUB_PATH + + - name: Check dependencies + run: | + gcc --version + go version + kind version + kubectl version --client=true + helm version + ydb version + + - name: Setup k8s cluster + run: | + kind create cluster \ + --image=kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e \ + --config=./tests/cfg/kind-cluster-config.yaml + + kubectl wait --timeout=5m --for=condition=ready node -l worker=true + + - name: Run compatibility tests + env: + NEW_VERSION: ${{ env.NEW_VERSION }} + PREVIOUS_VERSION: ${{ env.PREVIOUS_VERSION }} + run: | + go install gotest.tools/gotestsum@v1.12.0 + gotestsum --format pkgname --jsonfile log.json -- -v -timeout 3600s -p 1 ./tests/compatibility/... -ginkgo.vv -coverprofile cover.out + + - name: convert-to-human-readable + run: jq -r '.Output| gsub("[\\n]"; "")' log.json 2>/dev/null 1>log.txt || true + + - name: artifact-upload-step + uses: actions/upload-artifact@v4 + id: artifact-upload-step + if: always() + with: + name: compat-tests-log + path: log.txt + if-no-files-found: error + + - name: echo-tests-log-url + run: echo 'Unit tests log URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}' + + - name: Teardown k8s cluster + run: | + kind delete cluster diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 413a31a1..36fbacfa 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -82,7 +82,7 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential - go install sigs.k8s.io/kind@v0.17.0 + go install sigs.k8s.io/kind@v0.25.0 curl -LO https://dl.k8s.io/release/v1.25.3/bin/linux/amd64/kubectl chmod +x ./kubectl @@ -108,14 +108,10 @@ jobs: run: | kind delete cluster kind create cluster \ - --image=kindest/node:v1.25.3@sha256:cd248d1438192f7814fbca8fede13cfe5b9918746dfa12583976158a834fd5c5 \ - --config=./e2e/kind-cluster-config.yaml + --image=kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e \ + --config=./tests/cfg/kind-cluster-config.yaml kubectl wait --timeout=5m --for=condition=ready node -l worker=true - - kubectl label --overwrite node kind-worker topology.kubernetes.io/zone=fakeZone1 - kubectl label --overwrite node kind-worker2 topology.kubernetes.io/zone=fakeZone2 - kubectl label --overwrite node kind-worker3 topology.kubernetes.io/zone=fakeZone3 - name: build-operator-image uses: docker/build-push-action@v3 with: @@ -138,7 +134,7 @@ jobs: kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --nodes kind-worker,kind-worker2,kind-worker3 - name: pull-and-load-ydb-image run: | - YDB_IMAGE=$(grep "anchor_for_fetching_image_from_workflow" ./e2e/tests/**/*.go | grep -o -E '"cr\.yandex.*"') + YDB_IMAGE=$(grep "anchor_for_fetching_image_from_workflow" ./tests/**/*.go | grep -o -E '"cr\.yandex.*"') YDB_IMAGE=${YDB_IMAGE:1:-1} # strip "" docker pull $YDB_IMAGE kind load docker-image $YDB_IMAGE --nodes kind-worker,kind-worker2,kind-worker3 @@ -148,7 +144,7 @@ jobs: - name: run-e2e-tests id: run-e2e-tests run: | - gotestsum --format pkgname --jsonfile log.json -- -v -timeout 3600s -p 1 ./e2e/... -ginkgo.vv + gotestsum --format pkgname --jsonfile log.json -- -v -timeout 3600s -p 1 ./tests/e2e/... -ginkgo.vv - name: convert-json-log-to-human-readable run: jq -r '.Output| gsub("[\\n]"; "")' log.json 2>/dev/null 1>log.txt || true - name: artifact-upload-step @@ -164,4 +160,3 @@ jobs: - name: teardown-k8s-cluster run: | kind delete cluster - diff --git a/.golangci.yml b/.golangci.yml index b980d72f..1dc7fd9d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,15 +37,22 @@ output: # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" format: colored-line-number - # print lines of code with issue, default is true print-issued-lines: true - # print linter name in the end of issue text, default is true print-linter-name: true # all available settings of specific linters linters-settings: + stylecheck: + dot-import-whitelist: + # used in tests only + - "github.com/onsi/ginkgo/v2" + # used in tests only + - "github.com/onsi/gomega" + # it's nice having string constants in a separate package, but without boilerplate + - "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" + errcheck: # report about not checking of errors in types assetions: `a := b.(MyStruct)`; # default is false: such cases aren't reported by default. @@ -77,6 +84,7 @@ linters-settings: excludes: - G101 - G115 + - G601 # no longer actual since 1.22 fieldalignment: # print struct with more effective memory layout or not, false by default suggest-new: true diff --git a/README.md b/README.md index 63c0b890..1323b427 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![run-tests](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/run-tests.yml) [![upload-artifacts](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/upload-artifacts.yml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/upload-artifacts.yml) +[![compatibility-tests](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/compatibility-tests.yaml/badge.svg)](https://github.com/ydb-platform/ydb-kubernetes-operator/actions/workflows/compatibility-tests.yaml) # YDB Kubernetes Operator diff --git a/docs/tests.md b/docs/tests.md index 028cdfc8..8cbd46bd 100644 --- a/docs/tests.md +++ b/docs/tests.md @@ -43,7 +43,7 @@ containers on a single machine. This allows for full-blown smoke tests - apply t `Storage` manifests, wait until the `Pod`s become available, run `SELECT 1` inside one of those pods to check that YDB is actually up and running! -E2E tests are located in [e2e](../e2e) folder. +E2E tests are located in [tests/e2e](../tests/e2e) folder. ## Running tests @@ -81,7 +81,7 @@ kind delete cluster --name=local-kind kind create cluster \ --image=kindest/node:v1.21.14@sha256:9d9eb5fb26b4fbc0c6d95fa8c790414f9750dd583f5d7cee45d92e8c26670aa1 \ --name=local-kind \ - --config=./e2e/kind-cluster-config.yaml \ + --config=./tests/cfg/kind-cluster-config.yaml \ --wait 5m # Switch your local kubeconfig to the newly created cluster: @@ -92,7 +92,7 @@ kubectl config use-context kind-local-kind # kind/ydb-operator:current # You have to download the ydb image and build the operator image yourself. Then, explicitly -# upload them into the kind cluster. Refer to `./github/e2e.yaml` github workflow which essentially +# upload them into the kind cluster. Refer to `./github/workflows/run-tests.yaml` github workflow which essentially # does the same thing. kind --name local-kind load docker-image kind/ydb-operator:current kind --name local-kind load docker-image ydb: diff --git a/e2e/operator-values.yaml b/e2e/operator-values.yaml deleted file mode 100644 index 41c1efe4..00000000 --- a/e2e/operator-values.yaml +++ /dev/null @@ -1,10 +0,0 @@ -image: - repository: kind/ydb-operator - tag: current - pullPolicy: Never - -webhook: - enabled: true - - patch: - enabled: true diff --git a/e2e/tests/data/ca.crt b/e2e/tests/data/ca.crt deleted file mode 100644 index 2ef75164..00000000 --- a/e2e/tests/data/ca.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC/TCCAeWgAwIBAgIRAKt07W/6Gy+wIe5lk+0YyqwwDQYJKoZIhvcNAQELBQAw -FzEVMBMGA1UEAxMMdGVzdC1yb290LWNhMCAXDTI0MDQxMjA4MTM0NFoYDzIwNTQw -NDA1MDgxMzQ0WjAXMRUwEwYDVQQDEwx0ZXN0LXJvb3QtY2EwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCs4c67HN45wf9jokQLdxDsfLUO5I3FiPVE4uWZ -Ma2zNSL2pMJBk95Vmj6pP/3HA6llUm3flVotzVzHh3C0j/WBZf6YE31eWlyMokuE -uLAGfKw/qL+gqC6Phoa72f9kJwnGXsVMDZijAEyqNquLZwgkK+4jgQcVhpGi/3ws -fop0qYVcK5LKAT5lGSx0MEuW74jheLDlscMsmUqVl2SCWRC/UGY+nUOTpcKK8228 -Corc+DEFstqOIXGH9n/k0ZmBxjh8eU4IRp+LiDcB6x/yI4edAYJK/mnejmSA2i6a -K2mSzCJfBSVnDxwiGWY6xm8eAh6MaDU6iuqqkFFPltGl90CRAgMBAAGjQjBAMA4G -A1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTFXnzlk4tO -SosBlUEM7AiDOYuW7TANBgkqhkiG9w0BAQsFAAOCAQEAJHTeKc1ySltDwwINFVp1 -z5kFlIMyp3l146xn6qT5VWzYP4dZWdJz3gjAML56HRCHNe6B3MijjQY8sRObD5YI -589xpEhLMr+JR/DmU3Yol0XGILUdZ6TeK6FK+U3gYJdy3U39rcV2usEGfN5SRV4b -rUZg8asLFWPY7cdWBNIkF2yuJcF6PIpnuhzbfiEtOZ9ucvgnc62XPDnIuMSBKojG -Bj7QfqadEddSOztZFL00FZULIwSVE/8o0+HQvTBGjbZMuvuSBTJswujYUkD5Sy2O -wfc+dMJ6dbcDZR+5Q1kLEg+Oq7jjx/BTS35Axo1fPxO/WumJppTUmuEbFtEoX47o -fQ== ------END CERTIFICATE----- diff --git a/e2e/tests/data/tls.crt b/e2e/tests/data/tls.crt deleted file mode 100644 index 9549d538..00000000 --- a/e2e/tests/data/tls.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYDCCAkigAwIBAgIRAKHQc3G24VDsWff5qQxyl3EwDQYJKoZIhvcNAQELBQAw -FzEVMBMGA1UEAxMMdGVzdC1yb290LWNhMB4XDTI0MDQxMjA4MTgxOVoXDTM5MDQw -OTA4MTgxOVowDzENMAsGA1UEChMEdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAMqGcyqm3UIEZCL3Ge8Qh63OU0QykI3ymtj9gDJ57vtZdUOpHF18 -QsX4Urf6vGNvI8gWXEtPbK8Dchqo+3Reuejjq8aRFs1RaPVZoWPD8i782p6L6/oX -4k5zAwvCdjC2y/YuUf4GTZqpfwDbhSfH+EdacrfwmYjLxYaehEn7z9M67R5wSekr -1bMuxBKZW1sclmip3JRf3uBuHfMLkoYpTa7KcEycn9YstZ1h2XuWFLk42GS4bMZs -Cq2E3sEqD8LOyCHs/qWWGM3Txz6edLTi5U6XtzPeWwxyM5W7fOpC0Q3iw58myGsm -DDmUngyneS/mzyLvKTywzsu2sRAqdjqsZCUCAwEAAaOBrjCBqzAdBgNVHSUEFjAU -BggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBTF -Xnzlk4tOSosBlUEM7AiDOYuW7TBbBgNVHREEVDBSgiJzdG9yYWdlLWdycGMueWRi -LnN2Yy5jbHVzdGVyLmxvY2FsgiwqLnN0b3JhZ2UtaW50ZXJjb25uZWN0LnlkYi5z -dmMuY2x1c3Rlci5sb2NhbDANBgkqhkiG9w0BAQsFAAOCAQEAQYRvaGGFsnR4cp8Y -MJo948t7zI3Pgy20YonmYTriz1zeEYNj9+5t678p04FlCjIx0j4dad1tFC1bNtnI -FOJNMkhiyC1JPKSN7HR90L5P9JfsuunUVTNEHP6EuLj2/VnMXj+30qX9i0kVkcnH -OV9yXk8cpN0GuUUyfKUq5k/WS+/15JRoLJ9F8vS1lm77nHeQ9F7m1Yjqkc131N3k -czFLe3wexWhnKCnNw5OtdFgJsMgL09pYgnN+0xyE4iLY8f0o/b58J/tpbKkeJb9L -YogP1+ultfGvrlX8TE6iAEi8UA+rZCNpGwiqTI2Y9clZNnkYu7UgW7kn2ih5/vgU -xntdsA== ------END CERTIFICATE----- diff --git a/e2e/tests/data/tls.key b/e2e/tests/data/tls.key deleted file mode 100644 index c8999b40..00000000 --- a/e2e/tests/data/tls.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAyoZzKqbdQgRkIvcZ7xCHrc5TRDKQjfKa2P2AMnnu+1l1Q6kc -XXxCxfhSt/q8Y28jyBZcS09srwNyGqj7dF656OOrxpEWzVFo9VmhY8PyLvzanovr -+hfiTnMDC8J2MLbL9i5R/gZNmql/ANuFJ8f4R1pyt/CZiMvFhp6ESfvP0zrtHnBJ -6SvVsy7EEplbWxyWaKnclF/e4G4d8wuShilNrspwTJyf1iy1nWHZe5YUuTjYZLhs -xmwKrYTewSoPws7IIez+pZYYzdPHPp50tOLlTpe3M95bDHIzlbt86kLRDeLDnybI -ayYMOZSeDKd5L+bPIu8pPLDOy7axECp2OqxkJQIDAQABAoIBAQCXKyBPl9nTax+r -kbID5dzAeR9h6jRIH+xBR4cnJiih6LZE2LfZd+UHjEGCHl/8AHs+4KHnfNNtFy9W -gweeZw5xrW8MekQA4WFssYhrxVjChe5RJbPwK1+6mtKNNout9OPtT8nXyLCoXxfz -defAN900tWinr6mKmD9KKowoBROtYBsKVwO4DOl+JonZP7A5eF/ao4T8XFSOOju5 -aU9flCjw6iagzKuryrJCzt4LsTA3/svuMswPQ7LRMSJm+RsceiBl4oVCuRmJ79tN -pmhHZqG80upp/idgyuGZu+rgePiXSnmtn47iXXvCjZKTNMkabQMc2WZ5P3HWfG0/ -28kXH5IBAoGBAPswl0SrvZdcQbalNHjLc1JtMMhZs6LPZe+/QTP4i/5qXvee8Dox -vvGJlvjNQuOGNsPUTsLMY203eKQWJ4+soK2qDhuDCxGmyQJ7NgTTzdhOCULctXlD -pdBHxiSmCUGEtW7Goe3M1/CL3sVfRp85FzMYItHHZEMTHZNzoZ+XXAzBAoGBAM5n -SknfqHM4oBT0LxxkmVFyiFoCi2grXzsGjzK5rk30DWajwT5sAy9x+X2vmG2zKkBJ -tTBYYUFh+SlNtBsY/TW2ZIcmHDpu0w82zXXDLLhUwYjxudXzyG30yU8d4woAwE6u -NPiVmFX6C8U597a/nC36LLsrSnUPvaJ4voFyRlxlAoGAHJa8MLmnO2nppMMKxNDL -EE+TJMpo0pfuTyoiXqrkLBGpO1+gkc8Fn3H8d9bMzR6CbyljyXH/wvd0SKCo4gZQ -x1M6hdEVWm30JM8nJ8d/fyXqkeySzvlvDtSMbbFkDkvvZms/FNSioyMYOLiOTiLu -TAdsNxoNhEDRte2MMKDGfkECgYAGH1o8xr2gbVWSSYv8M5+4osUYpmqsNF0myxME -Vi2tckfTe5gH2fxeM+tKpyLGXkIqlgUh4f1Aiz9w0jU9eIhKR5bDy4Wa1h68nMuL -araw4RK8lS8GAa04VcKC7kgFy+/oZZJ8rTNPmZMvzoBik1x2oK0jAC29OzJM13gP -LuyXYQKBgQCvkar/nthVUlScVa3uPzqKdpNlqmeXQRMVwcmRQJcJoHYWkaF2RRAx -AcjWTkP6/ThUgPhI76O0neQqO2N0P+FnCkaE4qU6Wg+dZcH0q7HVnt2TRuCzsECQ -kxDqdbF+qbXmYfbJ4dKkJdF0dNad4/d2hL/wbvyHXDEEGpuIlZAZrg== ------END RSA PRIVATE KEY----- diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index 8a9490cd..ee099129 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -21,11 +21,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/database" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storage" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) var ( @@ -65,7 +65,7 @@ var _ = Describe("Database controller medium tests", func() { }, } Expect(k8sClient.Create(ctx, &namespace)).Should(Succeed()) - storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, &storageSample)).Should(Succeed()) By("checking that Storage created on local cluster...") diff --git a/internal/controllers/databasenodeset/controller_test.go b/internal/controllers/databasenodeset/controller_test.go index 47beb813..26f7aeb7 100644 --- a/internal/controllers/databasenodeset/controller_test.go +++ b/internal/controllers/databasenodeset/controller_test.go @@ -16,12 +16,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/database" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/databasenodeset" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storage" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) const ( @@ -71,7 +71,7 @@ var _ = Describe("DatabaseNodeSet controller medium tests", func() { } Expect(k8sClient.Create(ctx, &namespace)).Should(Succeed()) - storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = *testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, &storageSample)).Should(Succeed()) By("checking that Storage created on local cluster...") diff --git a/internal/controllers/monitoring/monitoring_test.go b/internal/controllers/monitoring/monitoring_test.go index 5a31d55c..be2651e0 100644 --- a/internal/controllers/monitoring/monitoring_test.go +++ b/internal/controllers/monitoring/monitoring_test.go @@ -16,11 +16,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" //nolint:revive,stylecheck "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/monitoring" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) var ( @@ -119,7 +119,7 @@ func createMockDBAndSvc() { func createMockStorageAndSvc() { GinkgoHelper() - stor := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + stor := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) Expect(k8sClient.Create(ctx, stor)).Should(Succeed()) stor.Status.State = StorageReady diff --git a/internal/controllers/remotedatabasenodeset/controller_test.go b/internal/controllers/remotedatabasenodeset/controller_test.go index 25252795..d0335e93 100644 --- a/internal/controllers/remotedatabasenodeset/controller_test.go +++ b/internal/controllers/remotedatabasenodeset/controller_test.go @@ -25,7 +25,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" ydbannotations "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/database" @@ -36,6 +35,7 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storagenodeset" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) const ( @@ -203,7 +203,7 @@ var _ = Describe("RemoteDatabaseNodeSet controller tests", func() { var databaseSample *v1alpha1.Database BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) databaseSample = testobjects.DefaultDatabase() databaseSample.Spec.NodeSets = append(databaseSample.Spec.NodeSets, v1alpha1.DatabaseNodeSetSpecInline{ Name: testNodeSetName + "-local", diff --git a/internal/controllers/remotestoragenodeset/controller_test.go b/internal/controllers/remotestoragenodeset/controller_test.go index 0c5666c6..a1a20613 100644 --- a/internal/controllers/remotestoragenodeset/controller_test.go +++ b/internal/controllers/remotestoragenodeset/controller_test.go @@ -24,7 +24,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" ydbannotations "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/remotestoragenodeset" @@ -32,6 +31,7 @@ import ( "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storagenodeset" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) const ( @@ -175,7 +175,7 @@ var _ = Describe("RemoteStorageNodeSet controller tests", func() { var storageSample *v1alpha1.Storage BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ Name: testNodeSetName + "-local", StorageNodeSpec: v1alpha1.StorageNodeSpec{ diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index ded230bb..f36a699b 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -17,12 +17,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storage" "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) var ( @@ -62,7 +62,7 @@ var _ = Describe("Storage controller medium tests", func() { }) It("Checking field propagation to objects", func() { - storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) tmpFilesDir := "/tmp/mounted_volume" testVolumeName := "sample-volume" diff --git a/internal/controllers/storage/init.go b/internal/controllers/storage/init.go index a9dc1b17..e0e0ea18 100644 --- a/internal/controllers/storage/init.go +++ b/internal/controllers/storage/init.go @@ -193,7 +193,7 @@ func (r *Reconciler) initializeBlobstorage( storage, corev1.EventTypeWarning, "InitializingStorage", - "Failed initBlobstorage Job, check Pod logs for addditional info", + "Failed initBlobstorage Job, check Pod logs for additional info", ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ Type: StorageInitializedCondition, diff --git a/internal/controllers/storagenodeset/controller_test.go b/internal/controllers/storagenodeset/controller_test.go index c93149e6..0302c85a 100644 --- a/internal/controllers/storagenodeset/controller_test.go +++ b/internal/controllers/storagenodeset/controller_test.go @@ -15,10 +15,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - testobjects "github.com/ydb-platform/ydb-kubernetes-operator/e2e/tests/test-objects" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storage" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storagenodeset" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) var ( @@ -62,7 +62,7 @@ var _ = Describe("StorageNodeSet controller medium tests", func() { }) It("Check controller operation through nodeSetSpec inline spec in Storage object", func() { - storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "e2e", "tests", "data", "storage-mirror-3-dc-config.yaml")) + storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) // Test create inline nodeSetSpec in Storage object testNodeSetName := "nodeset" diff --git a/e2e/kind-cluster-config.yaml b/tests/cfg/kind-cluster-config.yaml similarity index 63% rename from e2e/kind-cluster-config.yaml rename to tests/cfg/kind-cluster-config.yaml index 0a1f7068..18829857 100644 --- a/e2e/kind-cluster-config.yaml +++ b/tests/cfg/kind-cluster-config.yaml @@ -2,12 +2,18 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane + - role: worker labels: + topology.kubernetes.io/zone: az-1 worker: true + - role: worker labels: + topology.kubernetes.io/zone: az-2 worker: true + - role: worker labels: + topology.kubernetes.io/zone: az-3 worker: true diff --git a/tests/cfg/operator-local-values.yaml b/tests/cfg/operator-local-values.yaml new file mode 100644 index 00000000..edc33299 --- /dev/null +++ b/tests/cfg/operator-local-values.yaml @@ -0,0 +1,5 @@ +webhook: + enabled: true + + patch: + enabled: true diff --git a/tests/cfg/operator-values.yaml b/tests/cfg/operator-values.yaml new file mode 100644 index 00000000..edc33299 --- /dev/null +++ b/tests/cfg/operator-values.yaml @@ -0,0 +1,5 @@ +webhook: + enabled: true + + patch: + enabled: true diff --git a/tests/compatibility/compatibility_suite_test.go b/tests/compatibility/compatibility_suite_test.go new file mode 100644 index 00000000..1b28479c --- /dev/null +++ b/tests/compatibility/compatibility_suite_test.go @@ -0,0 +1,364 @@ +package compatibility + +import ( + "context" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/kubectl/pkg/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + + logf "sigs.k8s.io/controller-runtime/pkg/log" + + v1alpha1 "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" + . "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-utils" +) + +var ( + k8sClient client.Client + restConfig *rest.Config + + testEnv *envtest.Environment + + oldVersion string + newVersion string +) + +func TestCompatibility(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Compatibility Suite") +} + +var _ = BeforeSuite(func() { + logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) + + useExistingCluster := true + testEnv = &envtest.Environment{ + CRDDirectoryPaths: []string{filepath.Join("..", "..", "deploy", "ydb-operator", "crds")}, + ErrorIfCRDPathMissing: true, + UseExistingCluster: &useExistingCluster, + } + + cfg, err := testEnv.Start() + Expect(err).NotTo(HaveOccurred()) + Expect(cfg).NotTo(BeNil()) + + if useExistingCluster && !(strings.Contains(cfg.Host, "127.0.0.1") || strings.Contains(cfg.Host, "::1") || strings.Contains(cfg.Host, "localhost")) { + Fail("You are trying to run e2e tests against some real cluster, not the local `kind` cluster!") + } + + err = v1alpha1.AddToScheme(scheme.Scheme) + Expect(err).NotTo(HaveOccurred()) + + k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) + Expect(err).NotTo(HaveOccurred()) + Expect(k8sClient).NotTo(BeNil()) + + clientset, err := kubernetes.NewForConfig(cfg) + Expect(err).NotTo(HaveOccurred()) + Expect(clientset).NotTo(BeNil()) + + oldVersion = os.Getenv("PREVIOUS_VERSION") + newVersion = os.Getenv("NEW_VERSION") + Expect(oldVersion).NotTo(BeEmpty(), "PREVIOUS_VERSION environment variable is required") + Expect(newVersion).NotTo(BeEmpty(), "NEW_VERSION environment variable is required") +}) + +var _ = Describe("Operator Compatibility Test", func() { + var ( + ctx context.Context + namespace corev1.Namespace + storageSample *v1alpha1.Storage + databaseSample *v1alpha1.Database + ) + + BeforeEach(func() { + ctx = context.Background() + + namespace = corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: testobjects.YdbNamespace, + }, + } + Expect(k8sClient.Create(ctx, &namespace)).Should(Succeed()) + + Eventually(func() bool { + ns := &corev1.Namespace{} + err := k8sClient.Get(ctx, client.ObjectKey{Name: namespace.Name}, ns) + return err == nil + }, Timeout, Interval).Should(BeTrue()) + + By(fmt.Sprintf("Installing previous operator version %s", oldVersion)) + InstallOperatorWithHelm(testobjects.YdbNamespace, oldVersion) + + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config.yaml")) + databaseSample = testobjects.DefaultDatabase() + }) + + It("Upgrades from old operator to new operator, objects persist, YQL works", func() { + By("Creating Storage resource") + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, storageSample)).Should(Succeed()) + + By("Waiting for Storage to be ready") + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) + + By("Creating Database resource") + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, databaseSample)).Should(Succeed()) + defer DeleteDatabase(ctx, k8sClient, databaseSample) + + By("Waiting for Database to be ready") + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) + + By(fmt.Sprintf("Upgrading CRDs from %s to %s", oldVersion, newVersion)) + UpdateCRDsTo(YdbOperatorReleaseName, namespace.Name, newVersion) + + By(fmt.Sprintf("Upgrading operator from %s to %s, with uninstalling, just to cause more chaos", oldVersion, newVersion)) + UninstallOperatorWithHelm(testobjects.YdbNamespace) + InstallOperatorWithHelm(testobjects.YdbNamespace, newVersion) + + By("Verifying Storage + Database are the same objects after upgrade") + Consistently(func() error { + storageAfterUpgrade := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &storageAfterUpgrade) + if err != nil { + return err + } + if storageAfterUpgrade.UID != storageSample.UID { + return fmt.Errorf("storage UID has changed") + } + + databaseAfterUpgrade := v1alpha1.Database{} + err = k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &databaseAfterUpgrade) + if err != nil { + return err + } + if databaseAfterUpgrade.UID != databaseSample.UID { + return fmt.Errorf("database UID has changed") + } + return nil + }, ConsistentConditionTimeout, Interval).Should(Succeed()) + + By("Restarting storage pods (one by one, no rolling restart, for simplicity)") + RestartPodsNoRollingRestart(ctx, k8sClient, testobjects.YdbNamespace, "ydb-cluster", "kind-storage") + + By("Restarting database pods (one by one, no rolling restart, for simplicity)") + RestartPodsNoRollingRestart(ctx, k8sClient, testobjects.YdbNamespace, "ydb-cluster", "kind-database") + + database := v1alpha1.Database{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &database)).Should(Succeed()) + storageEndpoint := database.Spec.StorageEndpoint + + databasePods := corev1.PodList{} + Expect(k8sClient.List(ctx, &databasePods, + client.InNamespace(testobjects.YdbNamespace), + client.MatchingLabels{"ydb-cluster": "kind-database"}), + ).Should(Succeed()) + + Expect(databasePods.Items).ToNot(BeEmpty()) + podName := databasePods.Items[0].Name + + By("bring YDB CLI inside ydb database pod...") + BringYdbCliToPod(podName, testobjects.YdbNamespace) + + By("execute simple query inside ydb database pod...") + databasePath := "/" + testobjects.DefaultDomain + "/" + databaseSample.Name + ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) + }) + + It("Upgrades from old operator to new operator, applying objects later succeeds", func() { + By("Creating Storage resource") + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, storageSample)).Should(Succeed()) + + By("Waiting for Storage to be ready") + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) + + By("Creating Database resource") + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, databaseSample)).Should(Succeed()) + defer DeleteDatabase(ctx, k8sClient, databaseSample) + + By("Waiting for Database to be ready") + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) + + By(fmt.Sprintf("Upgrading CRDs from %s to %s", oldVersion, newVersion)) + UpdateCRDsTo(YdbOperatorReleaseName, namespace.Name, newVersion) + + By(fmt.Sprintf("Upgrading operator from %s to %s, with uninstalling, just to cause more chaos", oldVersion, newVersion)) + UninstallOperatorWithHelm(testobjects.YdbNamespace) + InstallOperatorWithHelm(testobjects.YdbNamespace, newVersion) + + By("Verifying Storage + Database are the same objects after upgrade") + Consistently(func() error { + storageAfterUpgrade := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &storageAfterUpgrade) + if err != nil { + return err + } + if storageAfterUpgrade.UID != storageSample.UID { + return fmt.Errorf("storage UID has changed") + } + + databaseAfterUpgrade := v1alpha1.Database{} + err = k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &databaseAfterUpgrade) + if err != nil { + return err + } + if databaseAfterUpgrade.UID != databaseSample.UID { + return fmt.Errorf("database UID has changed") + } + return nil + }, ConsistentConditionTimeout, Interval).Should(Succeed()) + + By("Restarting storage pods (one by one, no rolling restart, for simplicity)") + RestartPodsNoRollingRestart(ctx, k8sClient, testobjects.YdbNamespace, "ydb-cluster", "kind-storage") + + By("Restarting database pods (one by one, no rolling restart, for simplicity)") + RestartPodsNoRollingRestart(ctx, k8sClient, testobjects.YdbNamespace, "ydb-cluster", "kind-database") + + // This is probably the most important check. + // If any major fields moved or got deleted, updating a resource will fail + // For this to work even better, TODO @jorres make this storage object as full as possible + // (utilizing as many fields), as it will help catching an error + By("applying the storage again must NOT fail because of CRD issues...") + Expect(k8sClient.Get(ctx, client.ObjectKey{ + Name: storageSample.Name, + Namespace: storageSample.Namespace, + }, storageSample)).Should(Succeed()) + Expect(k8sClient.Update(ctx, storageSample)).Should(Succeed()) + + By("applying the database again must NOT fail because of CRD issues...") + Expect(k8sClient.Get(ctx, client.ObjectKey{ + Name: databaseSample.Name, + Namespace: databaseSample.Namespace, + }, databaseSample)).Should(Succeed()) + Expect(k8sClient.Update(ctx, databaseSample)).Should(Succeed()) + }) + + AfterEach(func() { + By("Uninstalling operator") + UninstallOperatorWithHelm(testobjects.YdbNamespace) + + By("Deleting namespace") + Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) + Eventually(func() bool { + ns := &corev1.Namespace{} + err := k8sClient.Get(ctx, client.ObjectKey{Name: namespace.Name}, ns) + return apierrors.IsNotFound(err) + }, Timeout, Interval).Should(BeTrue()) + }) +}) + +func UpdateCRDsTo(releaseName, namespace, version string) { + tempDir, err := os.MkdirTemp("", "helm-chart-*") + Expect(err).ShouldNot(HaveOccurred()) + defer os.RemoveAll(tempDir) + + cmd := exec.Command("helm", "pull", YdbOperatorRemoteChart, "--version", version, "--untar", "--untardir", tempDir) + output, err := cmd.CombinedOutput() + Expect(err).ShouldNot(HaveOccurred(), string(output)) + + crdDir := filepath.Join(tempDir, YdbOperatorRemoteChart, "crds") + crdFiles, err := filepath.Glob(filepath.Join(crdDir, "*.yaml")) + Expect(err).ShouldNot(HaveOccurred()) + for _, crdFile := range crdFiles { + cmd := exec.Command("kubectl", "apply", "-f", crdFile) + output, err := cmd.CombinedOutput() + Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed to apply CRD %s: %s", crdFile, string(output))) + } +} + +var _ = AfterSuite(func() { + By("cleaning up the test environment") + err := testEnv.Stop() + Expect(err).NotTo(HaveOccurred()) +}) + +// This was the fastest way to implement restart without bringing rolling +// restart to operator itself or using ydbops. If you read this and +// operator already can do rolling restart natively, please rewrite +// this function! +func RestartPodsNoRollingRestart( + ctx context.Context, + k8sClient client.Client, + namespace string, + labelKey, labelValue string, +) { + podList := corev1.PodList{} + + Expect(k8sClient.List(ctx, &podList, client.InNamespace(namespace), client.MatchingLabels{ + labelKey: labelValue, + })).Should(Succeed()) + + for _, pod := range podList.Items { + originalUID := pod.UID + Expect(k8sClient.Delete(ctx, &pod)).Should(Succeed()) + + Eventually(func() bool { + newPod := corev1.Pod{} + err := k8sClient.Get(ctx, types.NamespacedName{Name: pod.Name, Namespace: namespace}, &newPod) + if err != nil { + return apierrors.IsNotFound(err) + } + return newPod.UID != originalUID + }, Timeout, Interval).Should(BeTrue(), fmt.Sprintf("Pod %s should be recreated with a new UID", pod.Name)) + + Eventually(func() bool { + newPod := corev1.Pod{} + err := k8sClient.Get(ctx, types.NamespacedName{Name: pod.Name, Namespace: namespace}, &newPod) + if err != nil { + return false + } + return newPod.Status.Phase == corev1.PodRunning + }, Timeout, Interval).Should(BeTrue(), fmt.Sprintf("Pod %s should be running", pod.Name)) + + time.Sleep(120 * time.Second) + } +} diff --git a/tests/data/database.crt b/tests/data/database.crt new file mode 100644 index 00000000..5dbc3481 --- /dev/null +++ b/tests/data/database.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDhDCCAmygAwIBAgIUUQQsk4wdGfrawpygX64aFtR6/1IwDQYJKoZIhvcNAQEL +BQAwFzEVMBMGA1UEAwwMdGVzdC1yb290LWNhMB4XDTI0MTIwNTEzMjEwMVoXDTM5 +MTIwMjEzMjEwMVowDzENMAsGA1UECgwEdGVzdDCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMU+EoeP6971G2uFgo2Sm2Ela8rjZSmivZZ3Xg//rj9gcfle +KNoJ5EAHdwyTfapLoSVvgy1QLun15ibWeRgbBuUt2+DiHnEpaeriUqmktki9UIzl +pAjytDwCmsjbOoLXRhCIa02tkU6rF8JjpwitZnwhTXjJTAkuJiuNvN2EEdacTlx1 +ZPdcHQveJTVJy4eOoSA8yc72XG9CWPY8mhLMTOzoZqbRX7MRoZoyYaV8TNAyQmh4 +tX045h4u1ZmMkWC06z2n+8Le3wTpu6mccOhS2ETw0j3Jefx78Zafc2s+jX0lCP71 +qiQXeEx1vuYQ5+nop2wh2nTFeFrjH+zZ4eyKduUCAwEAAaOBzzCBzDBdBgNVHREE +VjBUgiNkYXRhYmFzZS1ncnBjLnlkYi5zdmMuY2x1c3Rlci5sb2NhbIItKi5kYXRh +YmFzZS1pbnRlcmNvbm5lY3QueWRiLnN2Yy5jbHVzdGVyLmxvY2FsMB0GA1UdJQQW +MBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRe +hFiyRdaUYUiw6KnHiuTcqwh0CjAfBgNVHSMEGDAWgBRPTY3GM3OCesbsHOf9zDIu +T6ubJTANBgkqhkiG9w0BAQsFAAOCAQEAkYb1N40MGhxw07vVDPHrBfuMSgPqSqef +myPtwAIuwPIOILIAIek0yUogeMKF7kv/C5fyRnac3iHz59M7V4PetW7YhLB6G20n +bOpvq1Bp8Lw7WwRviULWHHIsS9OZlekvikEs3jS9H7XZGgmKC4mN3GbCZkpUvRjU +BBsdyKkQsDupofrzbFPaWfgRjUPGuQ27vUrZkPlmQPrZmowJpTIYwMyJxL8qFtip +JWX8qsKRle58L/K64Nx7AbW2LFjey8txJtkkROwpy9Zt7Dn0kvLcjZC2H8Nqdx8o +bPJqXdMlbGEUFDo1W6W/6zYCRUuDVvtM26Yua5DOm+6wJW+sSqlv4Q== +-----END CERTIFICATE----- diff --git a/tests/data/database.key b/tests/data/database.key new file mode 100644 index 00000000..274d72b9 --- /dev/null +++ b/tests/data/database.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDFPhKHj+ve9Rtr +hYKNkpthJWvK42Upor2Wd14P/64/YHH5XijaCeRAB3cMk32qS6Elb4MtUC7p9eYm +1nkYGwblLdvg4h5xKWnq4lKppLZIvVCM5aQI8rQ8AprI2zqC10YQiGtNrZFOqxfC +Y6cIrWZ8IU14yUwJLiYrjbzdhBHWnE5cdWT3XB0L3iU1ScuHjqEgPMnO9lxvQlj2 +PJoSzEzs6Gam0V+zEaGaMmGlfEzQMkJoeLV9OOYeLtWZjJFgtOs9p/vC3t8E6bup +nHDoUthE8NI9yXn8e/GWn3NrPo19JQj+9aokF3hMdb7mEOfp6KdsIdp0xXha4x/s +2eHsinblAgMBAAECggEALgJQ8bDDcTZlD0NtJOd8GaDQQFsjO59T0I+nEB3Q0EVH +yMarSlMQ3FOxdCxKXak3HYOhynXf/6Clr00LobEaPmbgWZh9R+HEbG8fH6XFhHmu +mrMtfI3at33XC7/BqggbtpsPxqaUVNCpoeU7bxV9qLpe9ywjcafDbRjqo5RdUd0q +J29OtBD/tfEFU17Bv0VlYW/IXmGhJp686ZDvUpybrc2qGiWJo5wnGgUpL0OLNk0L +piK7TThjDzBNLCSzq6DOZOwIoNBmGINLK1Q3SjC77zWH3YzZv/u3EjE3v61phQlj +hy2tR3yimFYGxX6ZJduockJgOC4WJznkR2G85HjggQKBgQD5+JB1o5rfo7J7Txgl +afL7EL2v/+VZ7DSs7Zh+zlIbGGr2vNnW5SgOOfpnjAY+8E91D3BzfmWdIb7/BGwB +6VAq6aH4a1xhOfWRmUgHL1vDfMfxO8hFN2Ixo2QCt+mQv09lZrExpr1RmlHPPija +XWJ0yE85cJHZlfywLQrG85F+gQKBgQDJ//ArSt4idZ4uRyslMj2ntnsBaD8DwVzl +jie1+ohMW26Fsw3059JplmmiPAvQXFzl3oZcOpJjxjHdGP7al3mdzGHbBSLDtW/h +bREUX78RZm9WHpc2K8ZkPxp36EAysZpmKCdkWH7lB/pt7926BUyqhHXk7thrkTeU +PylzE/iOZQKBgE4oHKrbg5IHMcgCO+9+x/0eB+EepoxOIU4sX7DOO7fDE7af55Cc +R8Di+dskWdOV+ZIFSMijrYvKwFgl/ss+MtWoBP+SOekgYRqsDWxJr2xY+H8BjSWv +ImGYz61V6Y5bcqymxiJbGviHwqqEqetUpXMUKkkwXDnm/oHrI2J/R2+BAoGAYlzv +7ZTqcGtH2I8tUlKRtV5lrXy+2qxI+Tts2O+jeVM4kYBsdmqAiowE6kxFEHQ5hHIE +iVq4OD+lvl1SlM0YGqAQsp9gm155mZMLsxkgqG9yHcSNq4JLfDtCP0toH4degQpi +jDmPqSVmbCxWkyPLfmk8I3uvBUpUfyr2myQJcAUCgYEA+b+ovH8gh3PGfuXtj4zW +6IjGXnmt4u2YUssF9sBklbTq9Ev8M4h58TlNh1oHWQ6yyXnpsP8vZMFU0iMYybvi +WGfPMtigyiLASjTV7Ws60uQlZ8raHqtb7QN5wJrvGqVxJe6aw/gQmxY8ejNjjWyM +1QkHQGyLaWJWFUy3blpUBsA= +-----END PRIVATE KEY----- diff --git a/tests/data/generate-crts/README.md b/tests/data/generate-crts/README.md new file mode 100644 index 00000000..ad58d965 --- /dev/null +++ b/tests/data/generate-crts/README.md @@ -0,0 +1,13 @@ +## Certificates for testing + +`ca.crt` and `ca.key` are just a self-signed CA created like this: + + +``` +openssl genrsa -out ca.key 2048 +openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.crt -subj "/CN=test-root-ca" +``` + +Then use `generate-test-certs.sh` to generate storage and database certs, which then are used in tests. + +`ca.srl` is a file created by the script as well. diff --git a/tests/data/generate-crts/ca.crt b/tests/data/generate-crts/ca.crt new file mode 100644 index 00000000..b8bf3192 --- /dev/null +++ b/tests/data/generate-crts/ca.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDDzCCAfegAwIBAgIUPG5Ffwh8I/zAtqSePmlBTGsP2eEwDQYJKoZIhvcNAQEL +BQAwFzEVMBMGA1UEAwwMdGVzdC1yb290LWNhMB4XDTI0MTIwNTExMjk1MFoXDTM0 +MTIwMzExMjk1MFowFzEVMBMGA1UEAwwMdGVzdC1yb290LWNhMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA45Y8h+mKX0//0H6B+KUcmhyis2dlfI8MlQNo +1qRpsQQKkqY+n6J8mzFPO+XOC/kLia6SShgpGZF79xhC9+Iq+2ARulIbPH3PiUdf +gwnLD/wfFgCmPaFFfJ93v9AY+eWeq00IKkRVp2gfb159C9BZQmoiyPCPOlWuLN/B +ZPMFHZUWPbL+4mvy4BBrcS/+FncUf7dA5ND7lb26G/sXUGWpYPLclhNnu7Hvapi4 +pIx60d8Z3+5eOVHEVECqgIU8wUqTrUbg1YMUHSZxdnsIPnL985sa7a66x/GAgMAi +xuAhUBMyxTUXOXqW+GWIlrmOHmiYRp7ARA3dPbYJJ1kdDfJRswIDAQABo1MwUTAd +BgNVHQ4EFgQUT02NxjNzgnrG7Bzn/cwyLk+rmyUwHwYDVR0jBBgwFoAUT02NxjNz +gnrG7Bzn/cwyLk+rmyUwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC +AQEAfpqusEPmGoL/Hzkui/xs20k+JKFQ90e5iZPQLyuES7BKQp1iajMOytAIXlhY +dtt4oSOYmBfl2bs8OU0U2mjGetx0AHWINY7bNzg7wxd4H46iiCitC4qlUlGG23bF +GVQt7/SddmwKoOJBaasnRTBPqVTlreqAF4Ni8bY0kqO3GK5QWZ2sL+Btn9dML8aK +wLb6sW0h7rAjik0l3NcsrKE8UoViWjAgB3Oe9L00GSXaMnfD6V65XnzkXvLOpCdd +wjZHPoWinhqM8ZHm/iFSe2UcL1KG0rdrMg8oBY6zMNrgENEdhqEXNJJrioT9bzKE +FyNQDOxpeql/GJl2MGxj0FXy+Q== +-----END CERTIFICATE----- diff --git a/tests/data/generate-crts/ca.key b/tests/data/generate-crts/ca.key new file mode 100644 index 00000000..df26c211 --- /dev/null +++ b/tests/data/generate-crts/ca.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDjljyH6YpfT//Q +foH4pRyaHKKzZ2V8jwyVA2jWpGmxBAqSpj6fonybMU875c4L+QuJrpJKGCkZkXv3 +GEL34ir7YBG6Uhs8fc+JR1+DCcsP/B8WAKY9oUV8n3e/0Bj55Z6rTQgqRFWnaB9v +Xn0L0FlCaiLI8I86Va4s38Fk8wUdlRY9sv7ia/LgEGtxL/4WdxR/t0Dk0PuVvbob ++xdQZalg8tyWE2e7se9qmLikjHrR3xnf7l45UcRUQKqAhTzBSpOtRuDVgxQdJnF2 +ewg+cv3zmxrtrrrH8YCAwCLG4CFQEzLFNRc5epb4ZYiWuY4eaJhGnsBEDd09tgkn +WR0N8lGzAgMBAAECggEAB/+oZ6EeSzSalGSog2lPf13GR3E42znZLVuN/GKRkbZx ++1l7Fffgp+usZznaa11ODywNhCvOi1GA/obhw6iKmNnK2wuLstfmdWKxc/+MyCZf +nqcDMLim9+GllHOR4nve1GfEA7LxzQ0XHb4/vYHjFox4ZdYz5870bNX9triRKMrw +Ru6FMbdcMf8ClTHtqHIQgARRTOFvizqVFElFgrIo4eh8svseed3+xwX98oeC+O0u +WrLW42RpVWIoai+V6OdYzO+uALr8z0IC3yzw1pqLMVt+SLY0nS/qz8b3eruU4BmL +6i0BQvJF8QFCE+gmtZJSQyCXzOw5jcvlDAm10v/1QQKBgQD+eg13guElgrjvkjT6 +a1ry3hA5LfQ7QyqigydyZlkbPfBcnv0dsWXbL+toyu0RqMwcKBGG3/7bVpGx/0gb +EgtnDWgS/PyWpuW+scwhqryzCKLnbUCor3GIo7CkM+71m5BcOHNTUPoqrMt6/W6a +mQ4z+VNpVQlRrx3YXp2zbO/dgwKBgQDk8vqmioezNNNhnk/7LhFITN7TavsVT3LT +jgs9CTSwEKFLC8eo/sKPaTKTcPxhxrt9eOWhYbNNQ9WYzy/ulA/vKvfkZjvtUaHl +sC35E9FcMW6lSiM8LOQlPnJYq6VqIQOdTgtBp1lsmQvkRbAF7Wq2Fy8BjiwPJfV1 +CJejygI0EQKBgCZs96ucL7MiUhqa0TUfENSrg3ee4MoyEjYH5+T2X24lpC3YNBBP +wTmfusRQIAwSmP+HbV4YZLtqDwX5rkGoL+CXvadgXCPDf92Tq2dKCMRgAXlAngra +syIW1Y116hdcLig+vetOxve6r98adaESi3p9o4K8PHQBJViOsPFu+alRAoGAUtb8 +DIB5Y0VM6rheljLv++ocggDmgqpxkMyHknkfQEl0IvRLNQGhIkTdEO5D05kVw+uX +otH4D4/o3FazMC8QqOgyM8kuC8uKudIKgGJEUYhtUY9GuoI/tp4mv6CzxHfXl/Zi +KkpEGAA0hk8UxsBF6UbwMi7gEEcazlLik1gHfhECgYEA0HyiW3LaWfACD2y7gpYu +GDvF+Oo28tK2QBkPBa1FNtZ4BKBquGqe8V6iNuQ5HsZFwycFum/VU0FWoDOyLS5M +vclQT0fojPxlLTjS0B2PRBEv52cNNFwMrj/I/DerqdDh3saUIe1MeJoVIMDTE/Jl +H5v0FaUgorY35MZdyQ54uw0= +-----END PRIVATE KEY----- diff --git a/tests/data/generate-crts/ca.srl b/tests/data/generate-crts/ca.srl new file mode 100644 index 00000000..63d9a189 --- /dev/null +++ b/tests/data/generate-crts/ca.srl @@ -0,0 +1 @@ +51042C938C1D19FADAC29CA05FAE1A16D47AFF53 diff --git a/tests/data/generate-crts/generate-test-certs.sh b/tests/data/generate-crts/generate-test-certs.sh new file mode 100644 index 00000000..488f76d4 --- /dev/null +++ b/tests/data/generate-crts/generate-test-certs.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +CA_KEY="ca.key" +CA_CERT="ca.crt" + +# Output paths for the database and storage certificates and keys +DATABASE_KEY="../database.key" +DATABASE_CSR="database.csr" +DATABASE_CERT="../database.crt" + +STORAGE_KEY="../storage.key" +STORAGE_CSR="storage.csr" +STORAGE_CERT="../storage.crt" + +generate_certificate() { + local KEY_PATH=$1 + local CSR_PATH=$2 + local CERT_PATH=$3 + local CONFIG_FILE=$4 + + openssl req -new -newkey rsa:2048 -nodes -keyout "$KEY_PATH" -out "$CSR_PATH" -config "$CONFIG_FILE" + openssl x509 -req -in "$CSR_PATH" -CA "$CA_CERT" -CAkey "$CA_KEY" -CAcreateserial -out "$CERT_PATH" -days 5475 -sha256 -extensions req_ext -extfile "$CONFIG_FILE" +} + +# Paths to .cnf files, where we will write certificate settings +DATABASE_CONFIG="database-csr.cnf" +STORAGE_CONFIG="storage-csr.cnf" + +cat > $DATABASE_CONFIG < $STORAGE_CONFIG <`) - - for scanner.Scan() { - line := scanner.Text() - - matches := portForwardRegex.FindStringSubmatch(line) - if matches != nil { - localPort, err = strconv.Atoi(matches[1]) - if err != nil { - return err - } - break - } - } - - if localPort != 0 { - if err = f(localPort); err != nil { - return err - } - } else { - content, _ := io.ReadAll(stderr) - - return fmt.Errorf("kubectl port-forward stderr: %s", content) - } - return nil - }, Timeout, test.Interval).Should(BeNil()) -} - func emptyStorageDefaultFields(storage *v1alpha1.Storage) { storage.Spec.Image = nil storage.Spec.Resources = nil @@ -295,7 +59,7 @@ var _ = Describe("Operator smoke test", func() { var databaseSample *v1alpha1.Database BeforeEach(func() { - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config.yaml")) databaseSample = testobjects.DefaultDatabase() ctx = context.Background() @@ -315,13 +79,13 @@ var _ = Describe("Operator smoke test", func() { } return false }, Timeout, Interval).Should(BeTrue()) - Expect(installOperatorWithHelm(testobjects.YdbNamespace)).Should(BeTrue()) + InstallLocalOperatorWithHelm(testobjects.YdbNamespace) }) It("Check webhook defaulter", func() { emptyStorageDefaultFields(storageSample) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) emptyDatabaseDefaultFields(databaseSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) @@ -331,7 +95,7 @@ var _ = Describe("Operator smoke test", func() { }) It("Check webhook defaulter with dynconfig and nodeSets", func() { - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-dynconfig.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-dynconfig.yaml")) emptyStorageDefaultFields(storageSample) storageSample.Spec.NodeSets = []v1alpha1.StorageNodeSetSpecInline{ { @@ -344,29 +108,29 @@ var _ = Describe("Operator smoke test", func() { }, } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) }) It("general smoke pipeline, create storage + database", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) database := v1alpha1.Database{} Expect(k8sClient.Get(ctx, types.NamespacedName{ @@ -382,22 +146,23 @@ var _ = Describe("Operator smoke test", func() { podName := databasePods.Items[0].Name By("bring YDB CLI inside ydb database pod...") - bringYdbCliToPod(podName, testobjects.YdbNamespace) + BringYdbCliToPod(podName, testobjects.YdbNamespace) By("execute simple query inside ydb database pod...") - executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + databasePath := DatabasePathWithDefaultDomain(databaseSample) + ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) }) It("pause and un-pause Storage, should destroy and bring up Pods", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("setting storage pause to Paused...") storage := v1alpha1.Storage{} @@ -430,22 +195,22 @@ var _ = Describe("Operator smoke test", func() { Expect(k8sClient.Update(ctx, &storage)).Should(Succeed()) By("expecting storage to become ready again...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) }) It("freeze + delete StatefulSet + un-freeze Storage", func() { By("issuing create commands...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("setting storage operatorSync to false...") storage := v1alpha1.Storage{} @@ -505,15 +270,15 @@ var _ = Describe("Operator smoke test", func() { Expect(k8sClient.Update(ctx, &storage)).Should(Succeed()) By("expecting storage to become ready again...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) }) It("create storage and database with nodeSets", func() { By("issuing create commands...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config.yaml")) testNodeSetName := "nodeset" for idx := 1; idx <= 3; idx++ { storageSample.Spec.NodeSets = append(storageSample.Spec.NodeSets, v1alpha1.StorageNodeSetSpecInline{ @@ -530,23 +295,23 @@ var _ = Describe("Operator smoke test", func() { }) } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) database := v1alpha1.Database{} databasePods := corev1.PodList{} @@ -594,36 +359,37 @@ var _ = Describe("Operator smoke test", func() { podName := databasePods.Items[0].Name By("bring YDB CLI inside ydb database pod...") - bringYdbCliToPod(podName, testobjects.YdbNamespace) + BringYdbCliToPod(podName, testobjects.YdbNamespace) By("execute simple query inside ydb database pod...") - executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + databasePath := DatabasePathWithDefaultDomain(databaseSample) + ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) }) It("operatorConnection check, create storage with default staticCredentials", func() { By("issuing create commands...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-staticCreds.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config-staticCreds.yaml")) storageSample.Spec.OperatorConnection = &v1alpha1.ConnectionOptions{ StaticCredentials: &v1alpha1.StaticCredentialsAuth{ Username: "root", }, } Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) }) It("storage.State goes Pending -> Preparing -> Initializing -> Provisioning -> Ready", func() { Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("tracking storage state changes...") events, err := clientset.CoreV1().Events(testobjects.YdbNamespace).List(context.Background(), @@ -647,101 +413,89 @@ var _ = Describe("Operator smoke test", func() { }) It("using grpcs for storage connection", func() { - By("create secret...") - cert := testobjects.DefaultCertificate( - filepath.Join(".", "data", "tls.crt"), - filepath.Join(".", "data", "tls.key"), - filepath.Join(".", "data", "ca.crt"), - ) - Expect(k8sClient.Create(ctx, cert)).Should(Succeed()) + By("create storage certificate secret...") + storageCert := testobjects.StorageCertificate() + Expect(k8sClient.Create(ctx, storageCert)).Should(Succeed()) defer func() { - Expect(k8sClient.Delete(ctx, cert)).Should(Succeed()) + Expect(k8sClient.Delete(ctx, storageCert)).Should(Succeed()) + }() + By("create database certificate secret...") + databaseCert := testobjects.DatabaseCertificate() + Expect(k8sClient.Create(ctx, databaseCert)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseCert)).Should(Succeed()) }() By("create storage...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-config-tls.yaml")) - storageSample.Spec.Service.GRPC.TLSConfiguration.Enabled = true - storageSample.Spec.Service.GRPC.TLSConfiguration.Certificate = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.crt", - } - storageSample.Spec.Service.GRPC.TLSConfiguration.Key = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.key", - } - storageSample.Spec.Service.GRPC.TLSConfiguration.CertificateAuthority = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "ca.crt", - } + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config-tls.yaml")) + storageSample.Spec.Service.GRPC.TLSConfiguration = testobjects.TLSConfiguration( + testobjects.StorageCertificateSecretName, + ) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("create database...") - databaseSample.Spec.Service.GRPC.TLSConfiguration.Enabled = true - databaseSample.Spec.Service.GRPC.TLSConfiguration.Certificate = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.crt", - } - databaseSample.Spec.Service.GRPC.TLSConfiguration.Key = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.key", - } - databaseSample.Spec.Service.GRPC.TLSConfiguration.CertificateAuthority = corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "ca.crt", - } + databaseSample.Spec.Service.GRPC.TLSConfiguration = testobjects.TLSConfiguration( + testobjects.DatabaseCertificateSecretName, + ) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) - storagePods := corev1.PodList{} - Expect(k8sClient.List(ctx, &storagePods, + database := v1alpha1.Database{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseSample.Name, + Namespace: testobjects.YdbNamespace, + }, &database)).Should(Succeed()) + storageEndpoint := database.Spec.StorageEndpoint + + databasePods := corev1.PodList{} + Expect(k8sClient.List(ctx, &databasePods, client.InNamespace(testobjects.YdbNamespace), - client.MatchingLabels{ - "ydb-cluster": "kind-database", - })).Should(Succeed()) - podName := storagePods.Items[0].Name + client.MatchingLabels{"ydb-cluster": "kind-database"}), + ).Should(Succeed()) + podName := databasePods.Items[0].Name - By("bring YDB CLI inside ydb storage pod...") - bringYdbCliToPod(podName, testobjects.YdbNamespace) + By("bring YDB CLI inside ydb database pod...") + BringYdbCliToPod(podName, testobjects.YdbNamespace) - By("execute simple query inside ydb storage pod...") - storageEndpoint := fmt.Sprintf("grpcs://%s:%d", testobjects.StorageGRPCService, testobjects.StorageGRPCPort) - executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + By("execute simple query inside ydb database pod...") + databasePath := DatabasePathWithDefaultDomain(databaseSample) + ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) }) It("Check that Storage deleted after Database...", func() { By("create storage...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("create database...") Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("waiting until Database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) By("delete Storage...") Expect(k8sClient.Delete(ctx, storageSample)).Should(Succeed()) @@ -785,10 +539,10 @@ var _ = Describe("Operator smoke test", func() { It("check storage with dynconfig", func() { By("create storage...") - storageSample = testobjects.DefaultStorage(filepath.Join(".", "data", "storage-mirror-3-dc-dynconfig.yaml")) + storageSample = testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-dynconfig.yaml")) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) storage := v1alpha1.Storage{} By("waiting until StorageInitialized condition is true...") @@ -838,9 +592,9 @@ var _ = Describe("Operator smoke test", func() { }) It("TLS for status service", func() { - tlsHTTPCheck := func(port int) error { + tlsHTTPCheck := func(port int, serverName string) error { url := fmt.Sprintf("https://localhost:%d/", port) - cert, err := os.ReadFile(filepath.Join(".", "data", "ca.crt")) + cert, err := os.ReadFile(testobjects.TestCAPath) Expect(err).ShouldNot(HaveOccurred()) certPool := x509.NewCertPool() @@ -850,7 +604,7 @@ var _ = Describe("Operator smoke test", func() { tlsConfig := &tls.Config{ MinVersion: tls.VersionTLS12, RootCAs: certPool, - ServerName: "storage-grpc.ydb.svc.cluster.local", + ServerName: serverName, } transport := &http.Transport{TLSClientConfig: tlsConfig} @@ -877,70 +631,65 @@ var _ = Describe("Operator smoke test", func() { return nil } - By("create secret...") - cert := testobjects.DefaultCertificate( - filepath.Join(".", "data", "tls.crt"), - filepath.Join(".", "data", "tls.key"), - filepath.Join(".", "data", "ca.crt"), - ) - Expect(k8sClient.Create(ctx, cert)).Should(Succeed()) + By("create storage certificate secret...") + storageCert := testobjects.StorageCertificate() + Expect(k8sClient.Create(ctx, storageCert)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, storageCert)).Should(Succeed()) + }() + By("create database certificate secret...") + databaseCert := testobjects.DatabaseCertificate() + Expect(k8sClient.Create(ctx, databaseCert)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseCert)).Should(Succeed()) + }() By("create storage...") - storageSample.Spec.Service.Status.TLSConfiguration = &v1alpha1.TLSConfiguration{ - Enabled: true, - Certificate: corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.crt", - }, - Key: corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "tls.key", - }, - CertificateAuthority: corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: testobjects.CertificateSecretName}, - Key: "ca.crt", - }, - } + storageSample.Spec.Service.Status.TLSConfiguration = testobjects.TLSConfiguration( + testobjects.StorageCertificateSecretName, + ) Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("create database...") databaseSample.Spec.Nodes = 1 - databaseSample.Spec.Service.Status = *storageSample.Spec.Service.Status.DeepCopy() + databaseSample.Spec.Service.Status.TLSConfiguration = testobjects.TLSConfiguration( + testobjects.DatabaseCertificateSecretName, + ) Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) defer func() { Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) }() By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("forward storage status port and check that we can check TLS response") - portForward(ctx, + PortForward(ctx, fmt.Sprintf(resources.StatusServiceNameFormat, storageSample.Name), storageSample.Namespace, - v1alpha1.StatusPort, tlsHTTPCheck, + "storage-grpc.ydb.svc.cluster.local", v1alpha1.StatusPort, tlsHTTPCheck, ) By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) By("forward database status port and check that we can check TLS response") - portForward(ctx, + PortForward(ctx, fmt.Sprintf(resources.StatusServiceNameFormat, databaseSample.Name), databaseSample.Namespace, - v1alpha1.StatusPort, tlsHTTPCheck, + "database-grpc.ydb.svc.cluster.local", v1alpha1.StatusPort, tlsHTTPCheck, ) }) It("Check encryption for Database", func() { By("create storage...") Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) - defer deleteStorageSafely(ctx, storageSample) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) By("create database...") databaseSample.Spec.Encryption = &v1alpha1.EncryptionConfig{ Enabled: true, @@ -951,16 +700,16 @@ var _ = Describe("Operator smoke test", func() { }() By("waiting until Storage is ready...") - waitUntilStorageReady(ctx, storageSample.Name, testobjects.YdbNamespace) + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) By("checking that all the storage pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) By("waiting until database is ready...") - waitUntilDatabaseReady(ctx, databaseSample.Name, testobjects.YdbNamespace) + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) By("checking that all the database pods are running and ready...") - checkPodsRunningAndReady(ctx, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) database := v1alpha1.Database{} Expect(k8sClient.Get(ctx, types.NamespacedName{ @@ -977,14 +726,15 @@ var _ = Describe("Operator smoke test", func() { podName := databasePods.Items[0].Name By("bring YDB CLI inside ydb database pod...") - bringYdbCliToPod(podName, testobjects.YdbNamespace) + BringYdbCliToPod(podName, testobjects.YdbNamespace) By("execute simple query inside ydb database pod...") - executeSimpleQuery(podName, testobjects.YdbNamespace, storageEndpoint) + databasePath := DatabasePathWithDefaultDomain(databaseSample) + ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) }) AfterEach(func() { - Expect(uninstallOperatorWithHelm(testobjects.YdbNamespace)).Should(BeTrue()) + UninstallOperatorWithHelm(testobjects.YdbNamespace) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) Eventually(func(g Gomega) bool { namespaceList := corev1.NamespaceList{} diff --git a/e2e/tests/test-objects/objects.go b/tests/test-k8s-objects/objects.go similarity index 71% rename from e2e/tests/test-objects/objects.go rename to tests/test-k8s-objects/objects.go index c369d4cc..447f6c49 100644 --- a/e2e/tests/test-objects/objects.go +++ b/tests/test-k8s-objects/objects.go @@ -2,8 +2,9 @@ package testobjects import ( "os" + "path/filepath" - . "github.com/onsi/gomega" //nolint:all + . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -11,15 +12,26 @@ import ( ) const ( - YdbImage = "cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7" // anchor_for_fetching_image_from_workflow - YdbNamespace = "ydb" - StorageName = "storage" - DatabaseName = "database" - CertificateSecretName = "storage-crt" - DefaultDomain = "Root" - ReadyStatus = "Ready" - StorageGRPCService = "storage-grpc.ydb.svc.cluster.local" - StorageGRPCPort = 2135 + YdbImage = "cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7" // anchor_for_fetching_image_from_workflow + YdbNamespace = "ydb" + StorageName = "storage" + DatabaseName = "database" + StorageCertificateSecretName = "storage-crt" + DatabaseCertificateSecretName = "database-crt" + DefaultDomain = "Root" + ReadyStatus = "Ready" + StorageGRPCService = "storage-grpc.ydb.svc.cluster.local" + StorageGRPCPort = 2135 +) + +var ( + TestCAPath = filepath.Join("..", "data", "generate-crts", "ca.crt") + + StorageTLSKeyPath = filepath.Join("..", "data", "storage.key") + StorageTLSCrtPath = filepath.Join("..", "data", "storage.crt") + + DatabaseTLSKeyPath = filepath.Join("..", "data", "database.key") + DatabaseTLSCrtPath = filepath.Join("..", "data", "database.crt") ) func constructAntiAffinityFor(key, value string) *corev1.Affinity { @@ -172,7 +184,25 @@ func DefaultDatabase() *v1alpha1.Database { } } -func DefaultCertificate(certPath, keyPath, caPath string) *corev1.Secret { +func StorageCertificate() *corev1.Secret { + return DefaultCertificate( + StorageCertificateSecretName, + StorageTLSCrtPath, + StorageTLSKeyPath, + TestCAPath, + ) +} + +func DatabaseCertificate() *corev1.Secret { + return DefaultCertificate( + DatabaseCertificateSecretName, + DatabaseTLSCrtPath, + DatabaseTLSKeyPath, + TestCAPath, + ) +} + +func DefaultCertificate(secretName, certPath, keyPath, caPath string) *corev1.Secret { cert, err := os.ReadFile(certPath) Expect(err).To(BeNil()) key, err := os.ReadFile(keyPath) @@ -182,7 +212,7 @@ func DefaultCertificate(certPath, keyPath, caPath string) *corev1.Secret { return &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Name: CertificateSecretName, + Name: secretName, Namespace: YdbNamespace, }, Type: corev1.SecretTypeOpaque, @@ -193,3 +223,21 @@ func DefaultCertificate(certPath, keyPath, caPath string) *corev1.Secret { }, } } + +func TLSConfiguration(secretName string) *v1alpha1.TLSConfiguration { + return &v1alpha1.TLSConfiguration{ + Enabled: true, + Certificate: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: secretName}, + Key: "tls.crt", + }, + Key: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: secretName}, + Key: "tls.key", + }, + CertificateAuthority: corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: secretName}, + Key: "ca.crt", + }, + } +} diff --git a/tests/test-utils/test-utils.go b/tests/test-utils/test-utils.go new file mode 100644 index 00000000..43cb86ed --- /dev/null +++ b/tests/test-utils/test-utils.go @@ -0,0 +1,368 @@ +package testutils + +import ( + "bufio" + "context" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" + "time" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + v1alpha1 "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" + . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" + testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" +) + +const ( + ConsistentConditionTimeout = time.Second * 30 + Timeout = time.Second * 600 + Interval = time.Second * 2 + YdbOperatorRemoteChart = "ydb/ydb-operator" + YdbOperatorReleaseName = "ydb-operator" +) + +var ( + pathToHelmValuesInLocalInstall = filepath.Join("..", "cfg", "operator-local-values.yaml") + pathToHelmValuesInRemoteInstall = filepath.Join("..", "cfg", "operator-values.yaml") +) + +func InstallLocalOperatorWithHelm(namespace string) { + args := []string{ + "-n", namespace, + "install", + "--wait", + "ydb-operator", + filepath.Join("..", "..", "deploy", "ydb-operator"), + "-f", pathToHelmValuesInLocalInstall, + } + + result := exec.Command("helm", args...) + stdout, err := result.Output() + Expect(err).To(BeNil()) + Expect(stdout).To(ContainSubstring("deployed")) +} + +func InstallOperatorWithHelm(namespace, version string) { + args := []string{ + "-n", namespace, + "install", + "--wait", + "ydb-operator", + YdbOperatorRemoteChart, + "-f", pathToHelmValuesInRemoteInstall, + "--version", version, + } + + Expect(exec.Command("helm", "repo", "add", "ydb", "https://charts.ydb.tech/").Run()).To(Succeed()) + Expect(exec.Command("helm", "repo", "update").Run()).To(Succeed()) + + installCommand := exec.Command("helm", args...) + output, err := installCommand.CombinedOutput() + Expect(err).To(BeNil()) + Expect(string(output)).To(ContainSubstring("deployed")) +} + +func UninstallOperatorWithHelm(namespace string) { + args := []string{ + "-n", namespace, + "uninstall", + "--wait", + "ydb-operator", + } + result := exec.Command("helm", args...) + stdout, err := result.Output() + Expect(err).To(BeNil()) + Expect(stdout).To(ContainSubstring("uninstalled")) +} + +func UpgradeOperatorWithHelm(namespace, version string) { + args := []string{ + "-n", namespace, + "upgrade", + "--wait", + "ydb-operator", + YdbOperatorRemoteChart, + "--version", version, + "-f", pathToHelmValuesInLocalInstall, + } + + cmd := exec.Command("helm", args...) + cmd.Stdout = GinkgoWriter + cmd.Stderr = GinkgoWriter + + Expect(cmd.Run()).Should(Succeed()) +} + +func WaitUntilStorageReady(ctx context.Context, k8sClient client.Client, storageName, namespace string) { + Eventually(func() bool { + storage := &v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storageName, + Namespace: namespace, + }, storage) + if err != nil { + return false + } + + return meta.IsStatusConditionPresentAndEqual( + storage.Status.Conditions, + StorageInitializedCondition, + metav1.ConditionTrue, + ) && storage.Status.State == testobjects.ReadyStatus + }, Timeout, Interval).Should(BeTrue()) +} + +func WaitUntilDatabaseReady(ctx context.Context, k8sClient client.Client, databaseName, namespace string) { + Eventually(func() bool { + database := &v1alpha1.Database{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: databaseName, + Namespace: namespace, + }, database) + if err != nil { + return false + } + + return meta.IsStatusConditionPresentAndEqual( + database.Status.Conditions, + DatabaseInitializedCondition, + metav1.ConditionTrue, + ) && database.Status.State == testobjects.ReadyStatus + }, Timeout, Interval).Should(BeTrue()) +} + +func CheckPodsRunningAndReady(ctx context.Context, k8sClient client.Client, podLabelKey, podLabelValue string, nPods int32) { + Eventually(func(g Gomega) bool { + pods := corev1.PodList{} + g.Expect(k8sClient.List(ctx, &pods, client.InNamespace(testobjects.YdbNamespace), client.MatchingLabels{ + podLabelKey: podLabelValue, + })).Should(Succeed()) + g.Expect(len(pods.Items)).Should(BeEquivalentTo(nPods)) + for _, pod := range pods.Items { + g.Expect(pod.Status.Phase).Should(BeEquivalentTo("Running")) + g.Expect(podIsReady(pod.Status.Conditions)).Should(BeTrue()) + } + return true + }, Timeout, Interval).Should(BeTrue()) + + Consistently(func(g Gomega) bool { + pods := corev1.PodList{} + g.Expect(k8sClient.List(ctx, &pods, client.InNamespace(testobjects.YdbNamespace), client.MatchingLabels{ + podLabelKey: podLabelValue, + })).Should(Succeed()) + g.Expect(len(pods.Items)).Should(BeEquivalentTo(nPods)) + for _, pod := range pods.Items { + g.Expect(pod.Status.Phase).Should(BeEquivalentTo("Running")) + g.Expect(podIsReady(pod.Status.Conditions)).Should(BeTrue()) + } + return true + }, ConsistentConditionTimeout, Interval).Should(BeTrue()) +} + +func podIsReady(conditions []corev1.PodCondition) bool { + for _, condition := range conditions { + if condition.Type == corev1.PodReady && condition.Status == corev1.ConditionTrue { + return true + } + } + return false +} + +func BringYdbCliToPod(podName, podNamespace string) { + expectedCliLocation := fmt.Sprintf("%v/ydb/bin/ydb", os.ExpandEnv("$HOME")) + + _, err := os.Stat(expectedCliLocation) + Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Expected YDB CLI at path %s to exist", expectedCliLocation)) + + Eventually(func(g Gomega) error { + args := []string{ + "-n", + podNamespace, + "cp", + expectedCliLocation, + fmt.Sprintf("%v:/tmp/ydb", podName), + } + cmd := exec.Command("kubectl", args...) + return cmd.Run() + }, Timeout, Interval).Should(BeNil()) +} + +func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, databasePath string) { + tablePath := "testfolder/testtable" + + tableCreatingInterval := time.Second * 10 + + Eventually(func(g Gomega) { + args := []string{ + "-n", podNamespace, + "exec", podName, + "--", + "/tmp/ydb", + "-d", databasePath, + "-e", storageEndpoint, + "yql", + "-s", + fmt.Sprintf("CREATE TABLE `%s` (testColumnA Utf8, testColumnB Utf8, PRIMARY KEY (testColumnA));", tablePath), + } + output, _ := exec.Command("kubectl", args...).CombinedOutput() + fmt.Println(string(output)) + }, Timeout, tableCreatingInterval).Should(Succeed()) + + argsInsert := []string{ + "-n", podNamespace, + "exec", podName, + "--", + "/tmp/ydb", + "-d", databasePath, + "-e", storageEndpoint, + "yql", + "-s", + fmt.Sprintf("INSERT INTO `%s` (testColumnA, testColumnB) VALUES ('valueA', 'valueB');", tablePath), + } + output, err := exec.Command("kubectl", argsInsert...).CombinedOutput() + Expect(err).ShouldNot(HaveOccurred(), string(output)) + + argsSelect := []string{ + "-n", podNamespace, + "exec", podName, + "--", + "/tmp/ydb", + "-d", databasePath, + "-e", storageEndpoint, + "yql", + "--format", "csv", + "-s", + fmt.Sprintf("SELECT * FROM `%s`;", tablePath), + } + output, err = exec.Command("kubectl", argsSelect...).CombinedOutput() + Expect(err).ShouldNot(HaveOccurred(), string(output)) + Expect(strings.TrimSpace(string(output))).To(ContainSubstring("\"valueA\",\"valueB\"")) + + argsDrop := []string{ + "-n", podNamespace, + "exec", podName, + "--", + "/tmp/ydb", + "-d", databasePath, + "-e", storageEndpoint, + "yql", + "-s", + fmt.Sprintf("DROP TABLE `%s`;", tablePath), + } + output, err = exec.Command("kubectl", argsDrop...).CombinedOutput() + Expect(err).ShouldNot(HaveOccurred(), string(output)) +} + +func PortForward( + ctx context.Context, + svcName, svcNamespace, serverName string, + port int, + f func(int, string) error, +) { + Eventually(func(g Gomega) error { + args := []string{ + "-n", svcNamespace, + "port-forward", + fmt.Sprintf("svc/%s", svcName), + fmt.Sprintf(":%d", port), + } + + cmd := exec.CommandContext(ctx, "kubectl", args...) + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + + stderr, err := cmd.StderrPipe() + if err != nil { + return err + } + + if err = cmd.Start(); err != nil { + return err + } + + defer func() { + err := cmd.Process.Kill() + if err != nil { + _, _ = fmt.Fprintf(GinkgoWriter, "Unable to kill process: %s", err) + } + }() + + localPort := 0 + + scanner := bufio.NewScanner(stdout) + portForwardRegex := regexp.MustCompile(`Forwarding from 127.0.0.1:(\d+) ->`) + + for scanner.Scan() { + line := scanner.Text() + + matches := portForwardRegex.FindStringSubmatch(line) + if matches != nil { + localPort, err = strconv.Atoi(matches[1]) + if err != nil { + return err + } + break + } + } + + if localPort != 0 { + if err = f(localPort, serverName); err != nil { + return err + } + } else { + content, _ := io.ReadAll(stderr) + return fmt.Errorf("kubectl port-forward stderr: %s", content) + } + return nil + }, Timeout, Interval).Should(BeNil()) +} + +func DeleteStorageSafely(ctx context.Context, k8sClient client.Client, storage *v1alpha1.Storage) { + // not checking that deletion completed successfully + // because some tests delete storage themselves and + // it may already be deleted. + _ = k8sClient.Delete(ctx, storage) + + Eventually(func() bool { + fetched := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: storage.Name, + Namespace: testobjects.YdbNamespace, + }, &fetched) + return apierrors.IsNotFound(err) + }, Timeout, Interval).Should(BeTrue()) +} + +func DeleteDatabase(ctx context.Context, k8sClient client.Client, database *v1alpha1.Database) { + Expect(k8sClient.Delete(ctx, database)).To(Succeed()) + + Eventually(func() bool { + fetched := v1alpha1.Storage{} + err := k8sClient.Get(ctx, types.NamespacedName{ + Name: database.Name, + Namespace: testobjects.YdbNamespace, + }, &fetched) + return apierrors.IsNotFound(err) + }, Timeout, Interval).Should(BeTrue()) +} + +func DatabasePathWithDefaultDomain(database *v1alpha1.Database) string { + return fmt.Sprintf("/%s/%s", testobjects.DefaultDomain, database.Name) +} From 97f0b9741dc1565e4a96a40b59ac76790266b463 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Wed, 15 Jan 2025 21:07:09 +0800 Subject: [PATCH 53/70] New field additionalPodLabels (#237) --- .../unreleased/Added-20241204-122609.yaml | 3 + .../unreleased/Added-20241204-122633.yaml | 3 + .../unreleased/Changed-20241204-122659.yaml | 3 + .../unreleased/Changed-20241204-122713.yaml | 3 + .../unreleased/Fixed-20241204-122736.yaml | 3 + api/v1alpha1/database_types.go | 4 + api/v1alpha1/storage_types.go | 4 + api/v1alpha1/zz_generated.deepcopy.go | 14 + deploy/ydb-operator/crds/database.yaml | 382 +++++++++--------- deploy/ydb-operator/crds/databasenodeset.yaml | 182 +++++---- .../crds/remotedatabasenodeset.yaml | 182 +++++---- .../crds/remotestoragenodeset.yaml | 182 +++++---- deploy/ydb-operator/crds/storage.yaml | 382 +++++++++--------- deploy/ydb-operator/crds/storagenodeset.yaml | 182 +++++---- .../controllers/storage/controller_test.go | 43 +- internal/controllers/storage/init.go | 2 +- internal/labels/label.go | 56 +-- internal/resources/database.go | 57 ++- internal/resources/database_statefulset.go | 14 +- internal/resources/databasenodeset.go | 13 +- internal/resources/storage.go | 88 +++- internal/resources/storage_init_job.go | 28 -- internal/resources/storage_statefulset.go | 14 +- internal/resources/storagenodeset.go | 13 +- 24 files changed, 1018 insertions(+), 839 deletions(-) create mode 100644 .changes/unreleased/Added-20241204-122609.yaml create mode 100644 .changes/unreleased/Added-20241204-122633.yaml create mode 100644 .changes/unreleased/Changed-20241204-122659.yaml create mode 100644 .changes/unreleased/Changed-20241204-122713.yaml create mode 100644 .changes/unreleased/Fixed-20241204-122736.yaml diff --git a/.changes/unreleased/Added-20241204-122609.yaml b/.changes/unreleased/Added-20241204-122609.yaml new file mode 100644 index 00000000..b7524b8b --- /dev/null +++ b/.changes/unreleased/Added-20241204-122609.yaml @@ -0,0 +1,3 @@ +kind: Added +body: new field additionalPodLabels for Storage and Database CRD +time: 2024-12-04T12:26:09.597907+07:00 diff --git a/.changes/unreleased/Added-20241204-122633.yaml b/.changes/unreleased/Added-20241204-122633.yaml new file mode 100644 index 00000000..389dfcf0 --- /dev/null +++ b/.changes/unreleased/Added-20241204-122633.yaml @@ -0,0 +1,3 @@ +kind: Added +body: new method buildPodTemplateLabels to append additionalPodLabels for statefulset builders +time: 2024-12-04T12:26:33.654222+07:00 diff --git a/.changes/unreleased/Changed-20241204-122659.yaml b/.changes/unreleased/Changed-20241204-122659.yaml new file mode 100644 index 00000000..0968be5c --- /dev/null +++ b/.changes/unreleased/Changed-20241204-122659.yaml @@ -0,0 +1,3 @@ +kind: Changed +body: refactor package labels to separate methods buildLabels, buildSelectorLabels and buildeNodeSetLabels for each resource +time: 2024-12-04T12:26:59.096105+07:00 diff --git a/.changes/unreleased/Changed-20241204-122713.yaml b/.changes/unreleased/Changed-20241204-122713.yaml new file mode 100644 index 00000000..9bf0b3f9 --- /dev/null +++ b/.changes/unreleased/Changed-20241204-122713.yaml @@ -0,0 +1,3 @@ +kind: Changed +body: propagate labels ydb.tech/database-nodeset, ydb.tech/storage-nodeset and ydb.tech/remote-cluster with method makeCommonLabels between resource recasting +time: 2024-12-04T12:27:13.265234+07:00 diff --git a/.changes/unreleased/Fixed-20241204-122736.yaml b/.changes/unreleased/Fixed-20241204-122736.yaml new file mode 100644 index 00000000..4f4c6808 --- /dev/null +++ b/.changes/unreleased/Fixed-20241204-122736.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: additional kind worker to maintain affinity rules for blobstorage init job +time: 2024-12-04T12:27:36.97703+07:00 diff --git a/api/v1alpha1/database_types.go b/api/v1alpha1/database_types.go index 17c2ff5d..a9f59db6 100644 --- a/api/v1alpha1/database_types.go +++ b/api/v1alpha1/database_types.go @@ -165,6 +165,10 @@ type DatabaseNodeSpec struct { // +optional AdditionalLabels map[string]string `json:"additionalLabels,omitempty"` + // (Optional) Additional custom resource labels that are added to Pods + // +optional + AdditionalPodLabels map[string]string `json:"additionalPodLabels,omitempty"` + // (Optional) Additional custom resource annotations that are added to all resources // +optional AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"` diff --git a/api/v1alpha1/storage_types.go b/api/v1alpha1/storage_types.go index 5a51f07d..967440db 100644 --- a/api/v1alpha1/storage_types.go +++ b/api/v1alpha1/storage_types.go @@ -162,6 +162,10 @@ type StorageNodeSpec struct { // +optional AdditionalLabels map[string]string `json:"additionalLabels,omitempty"` + // (Optional) Additional custom resource labels that are added to Pods + // +optional + AdditionalPodLabels map[string]string `json:"additionalPodLabels,omitempty"` + // (Optional) Additional custom resource annotations that are added to all resources // +optional AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index d4d9dbde..57d7e4f8 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -504,6 +504,13 @@ func (in *DatabaseNodeSpec) DeepCopyInto(out *DatabaseNodeSpec) { (*out)[key] = val } } + if in.AdditionalPodLabels != nil { + in, out := &in.AdditionalPodLabels, &out.AdditionalPodLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.AdditionalAnnotations != nil { in, out := &in.AdditionalAnnotations, &out.AdditionalAnnotations *out = make(map[string]string, len(*in)) @@ -1631,6 +1638,13 @@ func (in *StorageNodeSpec) DeepCopyInto(out *StorageNodeSpec) { (*out)[key] = val } } + if in.AdditionalPodLabels != nil { + in, out := &in.AdditionalPodLabels, &out.AdditionalPodLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.AdditionalAnnotations != nil { in, out := &in.AdditionalAnnotations, &out.AdditionalAnnotations *out = make(map[string]string, len(*in)) diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index 124fc0f8..eae6f463 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -59,6 +59,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -2259,6 +2265,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that + are added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -3153,25 +3165,26 @@ spec: - storageUnits type: object securityContext: - description: SecurityContext holds security configuration that - will be applied to a container. Some fields are present in - both SecurityContext and PodSecurityContext. When both are - set, the values in SecurityContext take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -3189,60 +3202,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -3262,69 +3275,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 @@ -3771,24 +3779,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -3804,56 +3814,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -3873,62 +3887,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 284496c4..2417044a 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -60,6 +60,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -2385,24 +2391,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -2418,56 +2426,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2487,62 +2499,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index 4745a180..f24ffa2e 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -61,6 +61,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -2386,24 +2392,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -2419,56 +2427,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2488,62 +2500,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index 2699c1c7..651c504d 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -60,6 +60,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -2523,24 +2529,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -2556,56 +2564,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2625,62 +2637,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index 24cf8520..d989e383 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -59,6 +59,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -3336,6 +3342,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that + are added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -4416,25 +4428,26 @@ spec: type: object type: object securityContext: - description: SecurityContext holds security configuration that - will be applied to a container. Some fields are present in - both SecurityContext and PodSecurityContext. When both are - set, the values in SecurityContext take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -4452,60 +4465,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -4525,69 +4538,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 @@ -5022,24 +5030,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -5055,56 +5065,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -5124,62 +5138,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index e08cc36a..9ce14e79 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -59,6 +59,12 @@ spec: description: (Optional) Additional custom resource labels that are added to all resources type: object + additionalPodLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to Pods + type: object affinity: description: (Optional) If specified, the pod's scheduling constraints properties: @@ -2522,24 +2528,26 @@ spec: x-kubernetes-map-type: atomic type: array securityContext: - description: SecurityContext holds security configuration that will - be applied to a container. Some fields are present in both SecurityContext - and PodSecurityContext. When both are set, the values in SecurityContext - take precedence. + description: |- + SecurityContext holds security configuration that will be applied to a container. + Some fields are present in both SecurityContext and PodSecurityContext. When both + are set, the values in SecurityContext take precedence. 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.' + 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. + 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 @@ -2555,56 +2563,60 @@ spec: 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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 @@ -2624,62 +2636,64 @@ spec: 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. + 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". + 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." + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + 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. + 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. + 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. + 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: |- + 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 diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index f36a699b..e332cc27 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -168,12 +168,9 @@ var _ = Describe("Storage controller medium tests", func() { if err != nil { return err } - value, exist := foundStatefulSets.Items[0].Labels[testLabelKey] - if !exist { - return fmt.Errorf("label key `ydb-label` does not exist in StatefulSet. Current labels: %s", foundStatefulSets.Items[0].Labels) - } + value := foundStatefulSets.Items[0].Labels[testLabelKey] if value != testLabelValue { - return fmt.Errorf("label value `ydb-label` in StatefulSet does not equal `test`. Current labels: %s", foundStatefulSets.Items[0].Labels) + return fmt.Errorf("label value of `%s` in StatefulSet does not equal `%s`. Current labels: %s", testLabelKey, testLabelValue, foundStatefulSets.Items[0].Labels) } return nil }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) @@ -186,8 +183,42 @@ var _ = Describe("Storage controller medium tests", func() { }, }, )) + }) + + By("Check that additionalPodLabels propagated into podTemplate...", func() { + testLabelKey := "ydb-pod-label" + testLabelValue := "test-podTemplate" + By("set additional pod labels to Storage...") + Eventually(func() error { + foundStorage := v1alpha1.Storage{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: storageSample.Name, + Namespace: testobjects.YdbNamespace, + }, &foundStorage)) + foundStorage.Spec.AdditionalPodLabels = make(map[string]string) + foundStorage.Spec.AdditionalPodLabels[testLabelKey] = testLabelValue + return k8sClient.Update(ctx, &foundStorage) + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("check that additional pod labels was added...") + foundStatefulSets := appsv1.StatefulSetList{} + Eventually(func() error { + err := k8sClient.List(ctx, &foundStatefulSets, + client.InNamespace(testobjects.YdbNamespace), + ) + if err != nil { + return err + } + value := foundStatefulSets.Items[0].Spec.Template.Labels[testLabelKey] + if value != testLabelValue { + return fmt.Errorf("label value of `%s` in StatefulSet does not equal `%s`. Current labels: %s", testLabelKey, testLabelValue, foundStatefulSets.Items[0].Labels) + } + return nil + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + }) - By("check that delete StatefulSet event was detected...") + By("check that delete StatefulSet event was detected...", func() { + foundStatefulSets := appsv1.StatefulSetList{} Expect(k8sClient.List(ctx, &foundStatefulSets, client.InNamespace(testobjects.YdbNamespace))).ShouldNot(HaveOccurred()) Expect(len(foundStatefulSets.Items)).Should(Equal(1)) Expect(k8sClient.Delete(ctx, &foundStatefulSets.Items[0])).ShouldNot(HaveOccurred()) diff --git a/internal/controllers/storage/init.go b/internal/controllers/storage/init.go index e0e0ea18..a13dbab6 100644 --- a/internal/controllers/storage/init.go +++ b/internal/controllers/storage/init.go @@ -303,7 +303,7 @@ func (r *Reconciler) createInitBlobstorageJob( ctx context.Context, storage *resources.StorageClusterBuilder, ) error { - builder := resources.GetInitJobBuilder(storage.DeepCopy()) + builder := storage.GetInitJobBuilder() newResource := builder.Placeholder(storage) _, err := resources.CreateOrUpdateOrMaybeIgnore(ctx, r.Client, newResource, func() error { var err error diff --git a/internal/labels/label.go b/internal/labels/label.go index 19ff5d94..9c658075 100644 --- a/internal/labels/label.go +++ b/internal/labels/label.go @@ -1,9 +1,5 @@ package labels -import ( - "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" -) - // https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ const ( // NameKey The name of a higher level application this one is part of @@ -28,11 +24,9 @@ const ( // RemoteClusterKey The specialization of a remote k8s cluster RemoteClusterKey = "ydb.tech/remote-cluster" - StorageGeneration = "ydb.tech/storage-generation" - DatabaseGeneration = "ydb.tech/database-generation" - - StorageComponent = "storage-node" - DynamicComponent = "dynamic-node" + StorageComponent = "storage-node" + DynamicComponent = "dynamic-node" + BlobstorageInitComponent = "blobstorage-init" GRPCComponent = "grpc" InterconnectComponent = "interconnect" @@ -50,28 +44,6 @@ func Common(name string, defaultLabels Labels) Labels { return l } -func StorageLabels(cluster *v1alpha1.Storage) Labels { - l := Common(cluster.Name, cluster.Labels) - - l.Merge(cluster.Spec.AdditionalLabels) - l.Merge(map[string]string{ - ComponentKey: StorageComponent, - }) - - return l -} - -func DatabaseLabels(database *v1alpha1.Database) Labels { - l := Common(database.Name, database.Labels) - - l.Merge(database.Spec.AdditionalLabels) - l.Merge(map[string]string{ - ComponentKey: DynamicComponent, - }) - - return l -} - func (l Labels) AsMap() map[string]string { return l } @@ -98,16 +70,6 @@ func (l Labels) Merge(other map[string]string) map[string]string { return l } -func (l Labels) MergeInPlace(other map[string]string) map[string]string { - result := l.Copy() - - for k, v := range other { - result[k] = v - } - - return result -} - func makeCommonLabels(other map[string]string, instance string) map[string]string { common := make(map[string]string) @@ -122,5 +84,17 @@ func makeCommonLabels(other map[string]string, instance string) map[string]strin common[ManagedByKey] = "ydb-operator" + if storageNodeSetName, exist := other[StorageNodeSetComponent]; exist { + common[StorageNodeSetComponent] = storageNodeSetName + } + + if databaseNodeSetName, exist := other[DatabaseNodeSetComponent]; exist { + common[DatabaseNodeSetComponent] = databaseNodeSetName + } + + if remoteCluster, exist := other[RemoteClusterKey]; exist { + common[RemoteClusterKey] = remoteCluster + } + return common } diff --git a/internal/resources/database.go b/internal/resources/database.go index 2328207c..c2543680 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -32,15 +32,38 @@ func (b *DatabaseBuilder) Unwrap() *api.Database { return b.DeepCopy() } +func (b *DatabaseBuilder) buildSelectorLabels() labels.Labels { + l := labels.Common(b.Name, b.Labels) + l.Merge(map[string]string{labels.ComponentKey: labels.DynamicComponent}) + + return l +} + +func (b *DatabaseBuilder) buildLabels() labels.Labels { + l := b.buildSelectorLabels() + l.Merge(b.Spec.AdditionalLabels) + + return l +} + +func (b *DatabaseBuilder) buildNodeSetLabels(nodeSetSpecInline api.DatabaseNodeSetSpecInline) labels.Labels { + l := b.buildLabels() + l.Merge(nodeSetSpecInline.Labels) + l.Merge(map[string]string{labels.DatabaseNodeSetComponent: nodeSetSpecInline.Name}) + if nodeSetSpecInline.Remote != nil { + l.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) + } + + return l +} + func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { if b.Spec.ServerlessResources != nil { return []ResourceBuilder{} } - databaseLabels := labels.DatabaseLabels(b.Unwrap()) - - statefulSetLabels := databaseLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + databaseLabels := b.buildLabels() + databaseSelectorLabels := b.buildSelectorLabels() statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) @@ -149,7 +172,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Object: b, NameFormat: GRPCServiceNameFormat, Labels: grpcServiceLabels, - SelectorLabels: databaseLabels, + SelectorLabels: databaseSelectorLabels, Annotations: b.Spec.Service.GRPC.AdditionalAnnotations, Ports: []corev1.ServicePort{{ Name: api.GRPCServicePortName, @@ -162,7 +185,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Object: b, NameFormat: InterconnectServiceNameFormat, Labels: interconnectServiceLabels, - SelectorLabels: databaseLabels, + SelectorLabels: databaseSelectorLabels, Annotations: b.Spec.Service.Interconnect.AdditionalAnnotations, Headless: true, Ports: []corev1.ServicePort{{ @@ -176,7 +199,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Object: b, NameFormat: StatusServiceNameFormat, Labels: statusServiceLabels, - SelectorLabels: databaseLabels, + SelectorLabels: databaseSelectorLabels, Annotations: b.Spec.Service.Status.AdditionalAnnotations, Ports: []corev1.ServicePort{{ Name: api.StatusServicePortName, @@ -194,7 +217,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc Object: b, NameFormat: DatastreamsServiceNameFormat, Labels: datastreamsServiceLabels, - SelectorLabels: databaseLabels, + SelectorLabels: databaseSelectorLabels, Annotations: b.Spec.Service.Datastreams.AdditionalAnnotations, Ports: []corev1.ServicePort{{ Name: api.DatastreamsServicePortName, @@ -214,27 +237,23 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc RestConfig: restConfig, Name: b.Name, - Labels: statefulSetLabels, + Labels: databaseLabels, Annotations: statefulSetAnnotations, }, ) } else { - optionalBuilders = append(optionalBuilders, b.getNodeSetBuilders(databaseLabels)...) + optionalBuilders = append(optionalBuilders, b.getNodeSetBuilders()...) } return optionalBuilders } -func (b *DatabaseBuilder) getNodeSetBuilders(databaseLabels labels.Labels) []ResourceBuilder { +func (b *DatabaseBuilder) getNodeSetBuilders() []ResourceBuilder { var nodeSetBuilders []ResourceBuilder for _, nodeSetSpecInline := range b.Spec.NodeSets { - nodeSetLabels := databaseLabels.Copy() - nodeSetLabels.Merge(nodeSetSpecInline.Labels) - nodeSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: nodeSetSpecInline.Name}) - if nodeSetSpecInline.Remote != nil { - nodeSetLabels.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) - } + nodeSetName := fmt.Sprintf("%s-%s", b.Name, nodeSetSpecInline.Name) + nodeSetLabels := b.buildNodeSetLabels(nodeSetSpecInline) nodeSetAnnotations := CopyDict(b.Annotations) if nodeSetSpecInline.Annotations != nil { @@ -250,7 +269,7 @@ func (b *DatabaseBuilder) getNodeSetBuilders(databaseLabels labels.Labels) []Res &RemoteDatabaseNodeSetBuilder{ Object: b, - Name: b.Name + "-" + nodeSetSpecInline.Name, + Name: nodeSetName, Labels: nodeSetLabels, Annotations: nodeSetAnnotations, @@ -263,7 +282,7 @@ func (b *DatabaseBuilder) getNodeSetBuilders(databaseLabels labels.Labels) []Res &DatabaseNodeSetBuilder{ Object: b, - Name: b.Name + "-" + nodeSetSpecInline.Name, + Name: nodeSetName, Labels: nodeSetLabels, Annotations: nodeSetAnnotations, diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 2455f35e..8293a864 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -99,14 +99,26 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar { return envVars } +func (b *DatabaseStatefulSetBuilder) buildPodTemplateLabels() labels.Labels { + podTemplateLabels := labels.Labels{} + + podTemplateLabels.Merge(b.Labels) + podTemplateLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + podTemplateLabels.Merge(b.Spec.AdditionalPodLabels) + + return podTemplateLabels +} + func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpec { + podTemplateLabels := b.buildPodTemplateLabels() + domain := api.DefaultDomainName if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { domain = dnsAnnotation } podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: b.Labels, + Labels: podTemplateLabels, Annotations: b.Annotations, }, Spec: corev1.PodSpec{ diff --git a/internal/resources/databasenodeset.go b/internal/resources/databasenodeset.go index b3e1d041..478cc0b2 100644 --- a/internal/resources/databasenodeset.go +++ b/internal/resources/databasenodeset.go @@ -9,7 +9,6 @@ import ( api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" ) type DatabaseNodeSetBuilder struct { @@ -56,18 +55,10 @@ func (b *DatabaseNodeSetBuilder) Placeholder(cr client.Object) client.Object { func (b *DatabaseNodeSetResource) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { ydbCr := api.RecastDatabaseNodeSet(b.Unwrap()) - databaseLabels := labels.DatabaseLabels(ydbCr) + databaseBuilder := NewDatabase(ydbCr) statefulSetName := b.Name - statefulSetLabels := databaseLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: statefulSetName}) - - databaseNodeSetName := b.Labels[labels.DatabaseNodeSetComponent] - statefulSetLabels.Merge(map[string]string{labels.DatabaseNodeSetComponent: databaseNodeSetName}) - if remoteCluster, exist := b.Labels[labels.RemoteClusterKey]; exist { - statefulSetLabels.Merge(map[string]string{labels.RemoteClusterKey: remoteCluster}) - } - + statefulSetLabels := databaseBuilder.buildLabels() statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) diff --git a/internal/resources/storage.go b/internal/resources/storage.go index 9eaef577..77238adb 100644 --- a/internal/resources/storage.go +++ b/internal/resources/storage.go @@ -1,6 +1,8 @@ package resources import ( + "fmt" + "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/rest" @@ -29,11 +31,65 @@ func (b *StorageClusterBuilder) Unwrap() *api.Storage { return b.DeepCopy() } -func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { - storageLabels := labels.StorageLabels(b.Unwrap()) +func (b *StorageClusterBuilder) buildSelectorLabels(component string) labels.Labels { + l := labels.Common(b.Name, b.Labels) + l.Merge(map[string]string{labels.ComponentKey: component}) + + return l +} + +func (b *StorageClusterBuilder) buildLabels() labels.Labels { + l := b.buildSelectorLabels(labels.StorageComponent) + l.Merge(b.Spec.AdditionalLabels) + + return l +} - statefulSetLabels := storageLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) +func (b *StorageClusterBuilder) buildInitJobLabels() labels.Labels { + l := b.buildSelectorLabels(labels.BlobstorageInitComponent) + l.Merge(b.Spec.AdditionalLabels) + + if b.Spec.InitJob != nil { + l.Merge(b.Spec.InitJob.AdditionalLabels) + } + + return l +} + +func (b *StorageClusterBuilder) buildNodeSetLabels(nodeSetSpecInline api.StorageNodeSetSpecInline) labels.Labels { + l := b.buildLabels() + l.Merge(nodeSetSpecInline.Labels) + l.Merge(map[string]string{labels.StorageNodeSetComponent: nodeSetSpecInline.Name}) + if nodeSetSpecInline.Remote != nil { + l.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) + } + + return l +} + +func (b *StorageClusterBuilder) GetInitJobBuilder() ResourceBuilder { + jobName := fmt.Sprintf(InitJobNameFormat, b.Name) + jobLabels := b.buildInitJobLabels() + + jobAnnotations := CopyDict(b.Annotations) + if b.Spec.InitJob != nil { + for k, v := range b.Spec.InitJob.AdditionalAnnotations { + jobAnnotations[k] = v + } + } + + return &StorageInitJobBuilder{ + Storage: b.Unwrap(), + + Name: jobName, + Labels: jobLabels, + Annotations: jobAnnotations, + } +} + +func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { + storageLabels := b.buildLabels() + storageSelectorLabels := b.buildSelectorLabels(labels.StorageComponent) statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) @@ -105,12 +161,12 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R RestConfig: restConfig, Name: b.Name, - Labels: statefulSetLabels, + Labels: storageLabels, Annotations: statefulSetAnnotations, }, ) } else { - optionalBuilders = append(optionalBuilders, b.getNodeSetBuilders(storageLabels)...) + optionalBuilders = append(optionalBuilders, b.getNodeSetBuilders()...) } return append( @@ -119,7 +175,7 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R Object: b, NameFormat: GRPCServiceNameFormat, Labels: grpcServiceLabels, - SelectorLabels: storageLabels, + SelectorLabels: storageSelectorLabels, Annotations: b.Spec.Service.GRPC.AdditionalAnnotations, Ports: []corev1.ServicePort{{ Name: api.GRPCServicePortName, @@ -132,7 +188,7 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R Object: b, NameFormat: InterconnectServiceNameFormat, Labels: interconnectServiceLabels, - SelectorLabels: storageLabels, + SelectorLabels: storageSelectorLabels, Annotations: b.Spec.Service.Interconnect.AdditionalAnnotations, Headless: true, Ports: []corev1.ServicePort{{ @@ -146,7 +202,7 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R Object: b, NameFormat: StatusServiceNameFormat, Labels: statusServiceLabels, - SelectorLabels: storageLabels, + SelectorLabels: storageSelectorLabels, Annotations: b.Spec.Service.Status.AdditionalAnnotations, Ports: []corev1.ServicePort{{ Name: api.StatusServicePortName, @@ -158,16 +214,12 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R ) } -func (b *StorageClusterBuilder) getNodeSetBuilders(storageLabels labels.Labels) []ResourceBuilder { +func (b *StorageClusterBuilder) getNodeSetBuilders() []ResourceBuilder { var nodeSetBuilders []ResourceBuilder for _, nodeSetSpecInline := range b.Spec.NodeSets { - nodeSetLabels := storageLabels.Copy() - nodeSetLabels.Merge(nodeSetSpecInline.Labels) - nodeSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: nodeSetSpecInline.Name}) - if nodeSetSpecInline.Remote != nil { - nodeSetLabels.Merge(map[string]string{labels.RemoteClusterKey: nodeSetSpecInline.Remote.Cluster}) - } + nodeSetName := fmt.Sprintf("%s-%s", b.Name, nodeSetSpecInline.Name) + nodeSetLabels := b.buildNodeSetLabels(nodeSetSpecInline) nodeSetAnnotations := CopyDict(b.Annotations) if nodeSetSpecInline.Annotations != nil { @@ -183,7 +235,7 @@ func (b *StorageClusterBuilder) getNodeSetBuilders(storageLabels labels.Labels) &RemoteStorageNodeSetBuilder{ Object: b, - Name: b.Name + "-" + nodeSetSpecInline.Name, + Name: nodeSetName, Labels: nodeSetLabels, Annotations: nodeSetAnnotations, @@ -196,7 +248,7 @@ func (b *StorageClusterBuilder) getNodeSetBuilders(storageLabels labels.Labels) &StorageNodeSetBuilder{ Object: b, - Name: b.Name + "-" + nodeSetSpecInline.Name, + Name: nodeSetName, Labels: nodeSetLabels, Annotations: nodeSetAnnotations, diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index a18cbd7c..871ab535 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -3,7 +3,6 @@ package resources import ( "errors" "fmt" - "strconv" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -11,8 +10,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" "github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr" ) @@ -58,31 +55,6 @@ func (b *StorageInitJobBuilder) Placeholder(cr client.Object) client.Object { } } -func GetInitJobBuilder(storage *api.Storage) ResourceBuilder { - jobName := fmt.Sprintf(InitJobNameFormat, storage.Name) - jobLabels := labels.Common(storage.Name, make(map[string]string)) - jobAnnotations := make(map[string]string) - - if storage.Spec.InitJob != nil { - if storage.Spec.InitJob.AdditionalLabels != nil { - jobLabels.Merge(storage.Spec.InitJob.AdditionalLabels) - jobLabels[labels.StorageGeneration] = strconv.FormatInt(storage.ObjectMeta.Generation, 10) - } - if storage.Spec.InitJob.AdditionalAnnotations != nil { - jobAnnotations = CopyDict(storage.Spec.InitJob.AdditionalAnnotations) - jobAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(storage.Spec.Configuration) - } - } - - return &StorageInitJobBuilder{ - Storage: storage, - - Name: jobName, - Labels: jobLabels, - Annotations: jobAnnotations, - } -} - func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplateSpec { domain := api.DefaultDomainName if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 5a15fd23..1201d8f7 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -103,7 +103,19 @@ func (b *StorageStatefulSetBuilder) Build(obj client.Object) error { return nil } +func (b *StorageStatefulSetBuilder) buildPodTemplateLabels() labels.Labels { + podTemplateLabels := labels.Labels{} + + podTemplateLabels.Merge(b.Labels) + podTemplateLabels.Merge(map[string]string{labels.StatefulsetComponent: b.Name}) + podTemplateLabels.Merge(b.Spec.AdditionalPodLabels) + + return podTemplateLabels +} + func (b *StorageStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpec { + podTemplateLabels := b.buildPodTemplateLabels() + domain := api.DefaultDomainName if dnsAnnotation, ok := b.GetAnnotations()[api.DNSDomainAnnotation]; ok { domain = dnsAnnotation @@ -114,7 +126,7 @@ func (b *StorageStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpe podTemplate := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: b.Labels, + Labels: podTemplateLabels, Annotations: b.Annotations, }, Spec: corev1.PodSpec{ diff --git a/internal/resources/storagenodeset.go b/internal/resources/storagenodeset.go index 7f69425f..78a0964e 100644 --- a/internal/resources/storagenodeset.go +++ b/internal/resources/storagenodeset.go @@ -9,7 +9,6 @@ import ( api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations" - "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels" ) type StorageNodeSetBuilder struct { @@ -56,18 +55,10 @@ func (b *StorageNodeSetBuilder) Placeholder(cr client.Object) client.Object { func (b *StorageNodeSetResource) GetResourceBuilders(restConfig *rest.Config) []ResourceBuilder { ydbCr := api.RecastStorageNodeSet(b.Unwrap()) - storageLabels := labels.StorageLabels(ydbCr) + clusterBuilder := NewCluster(ydbCr) statefulSetName := b.Name - statefulSetLabels := storageLabels.Copy() - statefulSetLabels.Merge(map[string]string{labels.StatefulsetComponent: statefulSetName}) - - storageNodeSetName := b.Labels[labels.StorageNodeSetComponent] - statefulSetLabels.Merge(map[string]string{labels.StorageNodeSetComponent: storageNodeSetName}) - if remoteCluster, exist := b.Labels[labels.RemoteClusterKey]; exist { - statefulSetLabels.Merge(map[string]string{labels.RemoteClusterKey: remoteCluster}) - } - + statefulSetLabels := clusterBuilder.buildLabels() statefulSetAnnotations := CopyDict(b.Spec.AdditionalAnnotations) statefulSetAnnotations[annotations.ConfigurationChecksum] = SHAChecksum(b.Spec.Configuration) From 6f07d13fdb15d823b1975d129acd07c0cbaa4631 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Tue, 28 Jan 2025 01:09:57 +0800 Subject: [PATCH 54/70] fix bug: missing error handler for arg --auth-token-file (#283) * fix bug: missing error handler for arg --auth-token-file * fix golangci-lint --- .../unreleased/Added-20250124-141810.yaml | 3 + .../unreleased/Fixed-20250124-141631.yaml | 3 + api/v1alpha1/const.go | 14 +++- .../controllers/storage/controller_test.go | 78 +++++++++++++++++++ internal/resources/database_statefulset.go | 33 +++----- internal/resources/secret.go | 22 ------ internal/resources/storage_statefulset.go | 33 +++----- 7 files changed, 119 insertions(+), 67 deletions(-) create mode 100644 .changes/unreleased/Added-20250124-141810.yaml create mode 100644 .changes/unreleased/Fixed-20250124-141631.yaml diff --git a/.changes/unreleased/Added-20250124-141810.yaml b/.changes/unreleased/Added-20250124-141810.yaml new file mode 100644 index 00000000..58e21c15 --- /dev/null +++ b/.changes/unreleased/Added-20250124-141810.yaml @@ -0,0 +1,3 @@ +kind: Added +body: 'annotations overrides default secret name and key for arg --auth-token-file' +time: 2025-01-24T14:18:10.344319+08:00 diff --git a/.changes/unreleased/Fixed-20250124-141631.yaml b/.changes/unreleased/Fixed-20250124-141631.yaml new file mode 100644 index 00000000..31c864f9 --- /dev/null +++ b/.changes/unreleased/Fixed-20250124-141631.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: 'bug: missing error handler for arg --auth-token-file' +time: 2025-01-24T14:16:31.463111+08:00 diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index 6f6e9f6a..a9fe280d 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -28,18 +28,24 @@ const ( DiskPathPrefix = "/dev/kikimr_ssd" DiskNumberMaxDigits = 2 DiskFilePath = "/data" - YdbAuthToken = "ydb-auth-token-file" - ConfigDir = "/opt/ydb/cfg" - ConfigFileName = "config.yaml" + AuthTokenSecretName = "ydb-auth-token-file" + AuthTokenSecretKey = "ydb-auth-token-file" + AuthTokenFileArg = "--auth-token-file" DatabaseEncryptionKeySecretDir = "database_encryption" DatabaseEncryptionKeySecretFile = "key" DatabaseEncryptionKeyConfigFile = "key.txt" + ConfigDir = "/opt/ydb/cfg" + ConfigFileName = "config.yaml" + BinariesDir = "/opt/ydb/bin" DaemonBinaryName = "ydbd" + AdditionalSecretsDir = "/opt/ydb/secrets" + AdditionalVolumesDir = "/opt/ydb/volumes" + DefaultRootUsername = "root" DefaultRootPassword = "" DefaultDatabaseDomain = "Root" @@ -60,6 +66,8 @@ const ( AnnotationGRPCPublicHost = "ydb.tech/grpc-public-host" AnnotationNodeHost = "ydb.tech/node-host" AnnotationNodeDomain = "ydb.tech/node-domain" + AnnotationAuthTokenSecretName = "ydb.tech/auth-token-secret-name" + AnnotationAuthTokenSecretKey = "ydb.tech/auth-token-secret-key" AnnotationValueTrue = "true" diff --git a/internal/controllers/storage/controller_test.go b/internal/controllers/storage/controller_test.go index e332cc27..b23e2498 100644 --- a/internal/controllers/storage/controller_test.go +++ b/internal/controllers/storage/controller_test.go @@ -62,6 +62,23 @@ var _ = Describe("Storage controller medium tests", func() { }) It("Checking field propagation to objects", func() { + getStatefulSet := func(objName string) (appsv1.StatefulSet, error) { + foundStatefulSets := appsv1.StatefulSetList{} + err := k8sClient.List(ctx, &foundStatefulSets, client.InNamespace( + testobjects.YdbNamespace, + )) + if err != nil { + return appsv1.StatefulSet{}, err + } + for _, statefulSet := range foundStatefulSets.Items { + if statefulSet.Name == objName { + return statefulSet, nil + } + } + + return appsv1.StatefulSet{}, fmt.Errorf("Statefulset with name %s was not found", objName) + } + storageSample := testobjects.DefaultStorage(filepath.Join("..", "..", "..", "tests", "data", "storage-mirror-3-dc-config.yaml")) tmpFilesDir := "/tmp/mounted_volume" @@ -227,5 +244,66 @@ var _ = Describe("Storage controller medium tests", func() { return len(foundStatefulSets.Items) }, test.Timeout, test.Interval).Should(Equal(1)) }) + + By("check --auth-token-file arg in StatefulSet...", func() { + By("create auth-token Secret with default name...") + defaultAuthTokenSecret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: v1alpha1.AuthTokenSecretName, + Namespace: testobjects.YdbNamespace, + }, + StringData: map[string]string{ + v1alpha1.AuthTokenSecretKey: "StaffApiUserToken: 'default-token'", + }, + } + Expect(k8sClient.Create(ctx, defaultAuthTokenSecret)) + + By("append auth-token Secret inside Storage manifest...") + Eventually(func() error { + foundStorage := v1alpha1.Storage{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: testobjects.StorageName, + Namespace: testobjects.YdbNamespace, + }, &foundStorage)) + foundStorage.Spec.Secrets = []*corev1.LocalObjectReference{ + { + Name: v1alpha1.AuthTokenSecretName, + }, + } + return k8sClient.Update(ctx, &foundStorage) + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + checkAuthTokenArgs := func() error { + statefulSet, err := getStatefulSet(testobjects.StorageName) + if err != nil { + return err + } + podContainerArgs := statefulSet.Spec.Template.Spec.Containers[0].Args + var argExist bool + var currentArgValue string + authTokenFileArgValue := fmt.Sprintf("%s/%s/%s", + v1alpha1.AdditionalSecretsDir, + v1alpha1.AuthTokenSecretName, + v1alpha1.AuthTokenSecretKey, + ) + for idx, arg := range podContainerArgs { + if arg == v1alpha1.AuthTokenFileArg { + argExist = true + currentArgValue = podContainerArgs[idx+1] + break + } + } + if !argExist { + return fmt.Errorf("arg `%s` did not found in StatefulSet podTemplate args: %v", v1alpha1.AuthTokenFileArg, podContainerArgs) + } + if authTokenFileArgValue != currentArgValue { + return fmt.Errorf("current arg `%s` value `%s` did not match with expected: %s", v1alpha1.AuthTokenFileArg, currentArgValue, authTokenFileArgValue) + } + return nil + } + + By("check that --auth-token-file arg was added to Statefulset template...") + Eventually(checkAuthTokenArgs, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + }) }) }) diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 8293a864..06b5cbc5 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -1,10 +1,8 @@ package resources import ( - "context" "errors" "fmt" - "log" "regexp" "strconv" @@ -619,30 +617,23 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { ) } + authTokenSecretName := api.AuthTokenSecretName + authTokenSecretKey := api.AuthTokenSecretKey + if value, ok := b.ObjectMeta.Annotations[api.AnnotationAuthTokenSecretName]; ok { + authTokenSecretName = value + } + if value, ok := b.ObjectMeta.Annotations[api.AnnotationAuthTokenSecretKey]; ok { + authTokenSecretKey = value + } for _, secret := range b.Spec.Secrets { - exist, err := CheckSecretKey( - context.Background(), - b.GetNamespace(), - b.RestConfig, - &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: secret.Name, - }, - Key: api.YdbAuthToken, - }, - ) - if err != nil { - log.Default().Printf("Failed to inspect a secret %s: %s\n", secret.Name, err.Error()) - continue - } - if exist { + if secret.Name == authTokenSecretName { args = append(args, - "--auth-token-file", + api.AuthTokenFileArg, fmt.Sprintf( "%s/%s/%s", wellKnownDirForAdditionalSecrets, - secret.Name, - api.YdbAuthToken, + authTokenSecretName, + authTokenSecretKey, ), ) } diff --git a/internal/resources/secret.go b/internal/resources/secret.go index 675f74b8..d9c81a4a 100644 --- a/internal/resources/secret.go +++ b/internal/resources/secret.go @@ -13,28 +13,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -func CheckSecretKey( - ctx context.Context, - namespace string, - config *rest.Config, - secretKeyRef *corev1.SecretKeySelector, -) (bool, error) { - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return false, fmt.Errorf("failed to create kubernetes clientset, error: %w", err) - } - - getCtx, cancel := context.WithTimeout(ctx, time.Second) - defer cancel() - secret, err := clientset.CoreV1().Secrets(namespace).Get(getCtx, secretKeyRef.Name, metav1.GetOptions{}) - if err != nil { - return false, fmt.Errorf("failed to get secret %s, error: %w", secretKeyRef.Name, err) - } - - _, exist := secret.Data[secretKeyRef.Key] - return exist, nil -} - func GetSecretKey( ctx context.Context, namespace string, diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 1201d8f7..9c74dcb5 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -1,10 +1,8 @@ package resources import ( - "context" "errors" "fmt" - "log" "strconv" appsv1 "k8s.io/api/apps/v1" @@ -521,30 +519,23 @@ func (b *StorageStatefulSetBuilder) buildContainerArgs() ([]string, []string) { ) } + authTokenSecretName := api.AuthTokenSecretName + authTokenSecretKey := api.AuthTokenSecretKey + if value, ok := b.ObjectMeta.Annotations[api.AnnotationAuthTokenSecretName]; ok { + authTokenSecretName = value + } + if value, ok := b.ObjectMeta.Annotations[api.AnnotationAuthTokenSecretKey]; ok { + authTokenSecretKey = value + } for _, secret := range b.Spec.Secrets { - exist, err := CheckSecretKey( - context.Background(), - b.GetNamespace(), - b.RestConfig, - &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: secret.Name, - }, - Key: api.YdbAuthToken, - }, - ) - if err != nil { - log.Default().Printf("Failed to inspect a secret %s: %s\n", secret.Name, err.Error()) - continue - } - if exist { + if secret.Name == authTokenSecretName { args = append(args, - "--auth-token-file", + api.AuthTokenFileArg, fmt.Sprintf( "%s/%s/%s", wellKnownDirForAdditionalSecrets, - secret.Name, - api.YdbAuthToken, + authTokenSecretName, + authTokenSecretKey, ), ) } From 1ed91e3c40b86d310237b562f5c76f4939d1d732 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 01:10:14 +0800 Subject: [PATCH 55/70] Bump golang.org/x/net from 0.23.0 to 0.33.0 (#281) * Bump golang.org/x/net from 0.23.0 to 0.33.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.33.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] * changie info --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aleksei Kobzev --- .../unreleased/Security-20250127-170538.yaml | 3 ++ go.mod | 14 ++++----- go.sum | 29 +++++++++---------- 3 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 .changes/unreleased/Security-20250127-170538.yaml diff --git a/.changes/unreleased/Security-20250127-170538.yaml b/.changes/unreleased/Security-20250127-170538.yaml new file mode 100644 index 00000000..219ea97a --- /dev/null +++ b/.changes/unreleased/Security-20250127-170538.yaml @@ -0,0 +1,3 @@ +kind: Security +body: bump golang.org/x/net from 0.23.0 to 0.33.0 (by dependabot) +time: 2025-01-27T17:05:38.777767+08:00 diff --git a/go.mod b/go.mod index d862ad64..f0297899 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/banzaicloud/k8s-objectmatcher v1.7.0 github.com/go-logr/logr v1.2.4 github.com/golang-jwt/jwt/v4 v4.5.1 - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo/v2 v2.9.4 github.com/onsi/gomega v1.27.6 github.com/pkg/errors v0.9.1 @@ -63,14 +63,14 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.12.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect diff --git a/go.sum b/go.sum index fb940a91..a863f035 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -438,7 +438,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -464,8 +463,8 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -479,8 +478,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -506,11 +505,11 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -518,8 +517,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -542,8 +541,8 @@ golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 06b6f6385c6c6453b5fa87a8265a0634596c2a85 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Tue, 28 Jan 2025 01:10:30 +0800 Subject: [PATCH 56/70] fix remoteObj revision field (#232) * fix remoteObj revision is status * changie info --- .changes/unreleased/Fixed-20250127-125607.yaml | 3 +++ .../controllers/remotedatabasenodeset/remote_objects.go | 7 +++---- .../controllers/remotestoragenodeset/remote_objects.go | 7 +++---- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250127-125607.yaml diff --git a/.changes/unreleased/Fixed-20250127-125607.yaml b/.changes/unreleased/Fixed-20250127-125607.yaml new file mode 100644 index 00000000..59654796 --- /dev/null +++ b/.changes/unreleased/Fixed-20250127-125607.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: fix field resourceVersion inside .status.remoteResources.conditions +time: 2025-01-27T12:56:07.577721+08:00 diff --git a/internal/controllers/remotedatabasenodeset/remote_objects.go b/internal/controllers/remotedatabasenodeset/remote_objects.go index d600e93d..8b1305d5 100644 --- a/internal/controllers/remotedatabasenodeset/remote_objects.go +++ b/internal/controllers/remotedatabasenodeset/remote_objects.go @@ -60,7 +60,6 @@ func (r *Reconciler) syncRemoteObjects( for _, remoteObj := range remoteObjects { remoteObjName := remoteObj.GetName() remoteObjKind := remoteObj.GetObjectKind().GroupVersionKind().Kind - remoteObjRV := remoteObj.GetResourceVersion() var remoteResource *v1alpha1.RemoteResource for idx := range remoteDatabaseNodeSet.Status.RemoteResources { if resources.EqualRemoteResourceWithObject(&remoteDatabaseNodeSet.Status.RemoteResources[idx], remoteObj) { @@ -103,11 +102,11 @@ func (r *Reconciler) syncRemoteObjects( fmt.Sprintf("Failed to get resource %s with name %s: %s", remoteObjKind, remoteObjName, remoteGetErr), ) } - remoteDatabaseNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionFalse, remoteObjRV) - return r.updateStatusRemoteObjects(ctx, remoteDatabaseNodeSet, DefaultRequeueDelay) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, remoteGetErr } // Check object existence in local cluster + remoteObjRV := remoteObj.GetResourceVersion() localObj := resources.CreateResource(remoteObj) getErr := r.Client.Get(ctx, types.NamespacedName{ Name: localObj.GetName(), @@ -145,7 +144,7 @@ func (r *Reconciler) syncRemoteObjects( "Provisioning", fmt.Sprintf("RemoteSync CREATE resource %s with name %s", remoteObjKind, remoteObjName), ) - remoteDatabaseNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionFalse, remoteObjRV) + remoteDatabaseNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionTrue, remoteObjRV) return r.updateStatusRemoteObjects(ctx, remoteDatabaseNodeSet, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/remotestoragenodeset/remote_objects.go b/internal/controllers/remotestoragenodeset/remote_objects.go index a54f6a39..4f8c670f 100644 --- a/internal/controllers/remotestoragenodeset/remote_objects.go +++ b/internal/controllers/remotestoragenodeset/remote_objects.go @@ -60,7 +60,6 @@ func (r *Reconciler) syncRemoteObjects( for _, remoteObj := range remoteObjects { remoteObjName := remoteObj.GetName() remoteObjKind := remoteObj.GetObjectKind().GroupVersionKind().Kind - remoteObjRV := remoteObj.GetResourceVersion() var remoteResource *v1alpha1.RemoteResource for idx := range remoteStorageNodeSet.Status.RemoteResources { if resources.EqualRemoteResourceWithObject(&remoteStorageNodeSet.Status.RemoteResources[idx], remoteObj) { @@ -103,11 +102,11 @@ func (r *Reconciler) syncRemoteObjects( fmt.Sprintf("Failed to get resource %s with name %s: %s", remoteObjKind, remoteObjName, remoteGetErr), ) } - remoteStorageNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionFalse, remoteObjRV) - return r.updateStatusRemoteObjects(ctx, remoteStorageNodeSet, DefaultRequeueDelay) + return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, remoteGetErr } // Check object existence in local cluster + remoteObjRV := remoteObj.GetResourceVersion() localObj := resources.CreateResource(remoteObj) getErr := r.Client.Get(ctx, types.NamespacedName{ Name: localObj.GetName(), @@ -145,7 +144,7 @@ func (r *Reconciler) syncRemoteObjects( "Provisioning", fmt.Sprintf("RemoteSync CREATE resource %s with name %s", remoteObjKind, remoteObjName), ) - remoteStorageNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionFalse, remoteObjRV) + remoteStorageNodeSet.UpdateRemoteResourceStatus(remoteResource, metav1.ConditionTrue, remoteObjRV) return r.updateStatusRemoteObjects(ctx, remoteStorageNodeSet, StatusUpdateRequeueDelay) } From 1a3a3a7dcb1d7dcb80c92d7397831e9442cd4808 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Tue, 28 Jan 2025 13:54:05 +0800 Subject: [PATCH 57/70] use oldObj as statefulSet inside IgnoreChangesFunction (#286) * use oldObj as statefulSet inside IgnoreChangesFunction * fix typo --- .changes/unreleased/Fixed-20250127-141003.yaml | 3 +++ internal/controllers/database/sync.go | 4 ++-- internal/controllers/storage/sync.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250127-141003.yaml diff --git a/.changes/unreleased/Fixed-20250127-141003.yaml b/.changes/unreleased/Fixed-20250127-141003.yaml new file mode 100644 index 00000000..aa6c20f7 --- /dev/null +++ b/.changes/unreleased/Fixed-20250127-141003.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: panic when create object with .spec.pause is true +time: 2025-01-27T14:10:03.497565+08:00 diff --git a/internal/controllers/database/sync.go b/internal/controllers/database/sync.go index 6255d521..0ad5e9ad 100644 --- a/internal/controllers/database/sync.go +++ b/internal/controllers/database/sync.go @@ -359,8 +359,8 @@ func (r *Reconciler) waitForStatefulSetToScale( func shouldIgnoreDatabaseChange(database *resources.DatabaseBuilder) resources.IgnoreChangesFunction { return func(oldObj, newObj runtime.Object) bool { - if _, ok := newObj.(*appsv1.StatefulSet); ok { - if database.Spec.Pause && *oldObj.(*appsv1.StatefulSet).Spec.Replicas == 0 { + if statefulSet, ok := oldObj.(*appsv1.StatefulSet); ok { + if database.Spec.Pause && *statefulSet.Spec.Replicas == 0 { return true } } diff --git a/internal/controllers/storage/sync.go b/internal/controllers/storage/sync.go index ebf833ec..55cde3ce 100644 --- a/internal/controllers/storage/sync.go +++ b/internal/controllers/storage/sync.go @@ -292,8 +292,8 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( func shouldIgnoreStorageChange(storage *resources.StorageClusterBuilder) resources.IgnoreChangesFunction { return func(oldObj, newObj runtime.Object) bool { - if _, ok := newObj.(*appsv1.StatefulSet); ok { - if storage.Spec.Pause && *oldObj.(*appsv1.StatefulSet).Spec.Replicas == 0 { + if statefulSet, ok := oldObj.(*appsv1.StatefulSet); ok { + if storage.Spec.Pause && *statefulSet.Spec.Replicas == 0 { return true } } From c3664d0a8c5feafecd795cbf3dc21dda88b72576 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Tue, 28 Jan 2025 18:43:51 +0800 Subject: [PATCH 58/70] ObservedGeneration in conditions (#275) --- .../unreleased/Added-20250127-130609.yaml | 3 + internal/controllers/database/init.go | 63 +++--- internal/controllers/database/sync.go | 211 ++++++++++-------- internal/controllers/databasenodeset/sync.go | 132 ++++++----- internal/controllers/storage/init.go | 25 ++- internal/controllers/storage/sync.go | 201 +++++++++-------- internal/controllers/storagenodeset/sync.go | 136 ++++++----- internal/resources/remotedatabasenodeset.go | 2 +- internal/resources/remotestoragenodeset.go | 2 +- 9 files changed, 428 insertions(+), 347 deletions(-) create mode 100644 .changes/unreleased/Added-20250127-130609.yaml diff --git a/.changes/unreleased/Added-20250127-130609.yaml b/.changes/unreleased/Added-20250127-130609.yaml new file mode 100644 index 00000000..16003da3 --- /dev/null +++ b/.changes/unreleased/Added-20250127-130609.yaml @@ -0,0 +1,3 @@ +kind: Added +body: field ObservedGeneration inside .status.conditions +time: 2025-01-27T13:06:09.845302+08:00 diff --git a/internal/controllers/database/init.go b/internal/controllers/database/init.go index 910f6d6c..1a2770be 100644 --- a/internal/controllers/database/init.go +++ b/internal/controllers/database/init.go @@ -24,10 +24,11 @@ func (r *Reconciler) setInitPipelineStatus( ) (bool, ctrl.Result, error) { if database.Status.State == DatabasePreparing { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseInitializedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: "Database has not been initialized yet", + Type: DatabaseInitializedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Database has not been initialized yet", }) database.Status.State = DatabaseInitializing return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -58,16 +59,18 @@ func (r *Reconciler) setInitDatabaseCompleted( message string, ) (bool, ctrl.Result, error) { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseInitializedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: message, + Type: DatabaseInitializedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: message, }) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Tenant creation operation is completed", + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: "Tenant creation operation is completed", }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } @@ -90,10 +93,11 @@ func (r *Reconciler) checkCreateDatabaseOperation( errMessage, ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionFalse, - Reason: ReasonFailed, - Message: errMessage, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonFailed, + ObservedGeneration: database.Generation, + Message: errMessage, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } @@ -124,10 +128,11 @@ func (r *Reconciler) checkCreateDatabaseOperation( errMessage, ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionFalse, - Reason: ReasonCompleted, - Message: errMessage, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionFalse, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: errMessage, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } @@ -140,10 +145,11 @@ func (r *Reconciler) checkCreateDatabaseOperation( fmt.Sprintf("Tenant creation operation is not completed, operationID: %s", operationID), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: operationID, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: operationID, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } @@ -296,10 +302,11 @@ func (r *Reconciler) initializeTenant( fmt.Sprintf("Tenant creation operation in progress, operationID: %s", operationID), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: CreateDatabaseOperationCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: operationID, + Type: CreateDatabaseOperationCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: operationID, }) return r.updateStatus(ctx, database, DatabaseInitializationRequeueDelay) } diff --git a/internal/controllers/database/sync.go b/internal/controllers/database/sync.go index 0ad5e9ad..095f2b51 100644 --- a/internal/controllers/database/sync.go +++ b/internal/controllers/database/sync.go @@ -48,11 +48,6 @@ func (r *Reconciler) Sync(ctx context.Context, ydbCr *v1alpha1.Database) (ctrl.R return result, err } - stop, result, err = r.syncNodeSetSpecInline(ctx, &database) - if stop { - return result, err - } - if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabaseInitializedCondition) { return r.handleTenantCreation(ctx, &database) } @@ -87,17 +82,19 @@ func (r *Reconciler) setInitialStatus( if database.Spec.Pause { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePausedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Paused", + Type: DatabasePausedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Transitioning to state Paused", }) } else { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseReadyCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Ready", + Type: DatabaseReadyCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Transitioning to state Ready", }) } @@ -113,10 +110,11 @@ func (r *Reconciler) waitForClusterResources(ctx context.Context, database *reso if database.Status.State == DatabasePending { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePreparedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for sync resources for generation %d", database.Generation), + Type: DatabasePreparedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Waiting for sync resources", }) database.Status.State = DatabasePreparing return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -167,9 +165,10 @@ func (r *Reconciler) waitForClusterResources(ctx context.Context, database *reso ), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePreparedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: DatabasePreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, Message: fmt.Sprintf( "Referenced storage cluster (%s, %s) is not initialized", database.Spec.StorageClusterRef.Name, @@ -193,10 +192,11 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( if database.Status.State == DatabaseInitializing { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Waiting for NodeSets conditions to be Provisioned", + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Waiting for NodeSet resources to be Provisioned", }) database.Status.State = DatabaseProvisioning return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -242,8 +242,8 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( nodeSetConditions = nodeSetObject.(*v1alpha1.DatabaseNodeSet).Status.Conditions } - // TODO: also check observedGeneration to guarantee that compare with updated object - if !meta.IsStatusConditionTrue(nodeSetConditions, NodeSetProvisionedCondition) { + condition := meta.FindStatusCondition(nodeSetConditions, NodeSetProvisionedCondition) + if condition == nil || condition.ObservedGeneration != nodeSetObject.GetGeneration() || condition.Status != metav1.ConditionTrue { r.Recorder.Event( database, corev1.EventTypeNormal, @@ -255,9 +255,10 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( ), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, Message: fmt.Sprintf( "Waiting %s with name %s for condition NodeSetProvisioned to be True", nodeSetKind, @@ -270,10 +271,11 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabaseProvisionedCondition) { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully scaled to desired number of nodes", + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", database.Spec.Nodes), }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } @@ -290,10 +292,11 @@ func (r *Reconciler) waitForStatefulSetToScale( if database.Status.State == DatabaseInitializing { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", database.Spec.Nodes), + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: fmt.Sprintf("Waiting for scale to desired number of nodes: %d", database.Spec.Nodes), }) database.Status.State = DatabaseProvisioning return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -335,20 +338,22 @@ func (r *Reconciler) waitForStatefulSetToScale( fmt.Sprintf("Waiting for number of running pods to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, database.Spec.Nodes), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running pods does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, database.Spec.Nodes), + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, database.Spec.Nodes), }) return r.updateStatus(ctx, database, DefaultRequeueDelay) } if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabaseProvisionedCondition) { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", database.Spec.Nodes), + Type: DatabaseProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", database.Spec.Nodes), }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } @@ -437,10 +442,11 @@ func (r *Reconciler) handleResourcesSync( eventMessage+fmt.Sprintf(", failed to sync, error: %s", err), ) meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePreparedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Failed to sync resources for generation %d", database.Generation), + Type: DatabasePreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Failed to sync resources", }) return r.updateStatus(ctx, database, DefaultRequeueDelay) } else if result == controllerutil.OperationResultCreated || result == controllerutil.OperationResultUpdated { @@ -453,6 +459,28 @@ func (r *Reconciler) handleResourcesSync( } } + if err := r.syncNodeSetSpecInline(ctx, database); err != nil { + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: DatabasePreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, + Message: "Failed to sync NodeSet resources", + }) + return r.updateStatus(ctx, database, DefaultRequeueDelay) + } + + if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabasePreparedCondition) { + meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ + Type: DatabasePreparedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, + Message: "Successfully synced resources", + }) + return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) + } + r.Log.Info("complete step handleResourcesSync") return Continue, ctrl.Result{Requeue: false}, nil } @@ -469,15 +497,17 @@ func (r *Reconciler) updateStatus( meta.IsStatusConditionFalse(database.Status.Conditions, DatabaseProvisionedCondition) { if database.Spec.Pause { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: DatabasePausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, }) } else { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: DatabaseReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: database.Generation, }) } } @@ -526,9 +556,7 @@ func (r *Reconciler) updateStatus( func (r *Reconciler) syncNodeSetSpecInline( ctx context.Context, database *resources.DatabaseBuilder, -) (bool, ctrl.Result, error) { - r.Log.Info("running step syncNodeSetSpecInline") - +) error { databaseNodeSets := &v1alpha1.DatabaseNodeSetList{} if err := r.List(ctx, databaseNodeSets, client.InNamespace(database.Namespace), @@ -542,7 +570,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to list DatabaseNodeSets: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } for _, databaseNodeSet := range databaseNodeSets.Items { @@ -565,7 +593,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to delete DatabaseNodeSet: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } r.Recorder.Event( database, @@ -592,7 +620,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to list RemoteDatabaseNodeSets: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } for _, remoteDatabaseNodeSet := range remoteDatabaseNodeSets.Items { @@ -616,7 +644,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to delete RemoteDatabaseNodeSet: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } r.Recorder.Event( database, @@ -630,18 +658,7 @@ func (r *Reconciler) syncNodeSetSpecInline( } } - if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabasePreparedCondition) { - meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePreparedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully synced resources", - }) - return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) - } - - r.Log.Info("complete step syncNodeSetSpecInline") - return Continue, ctrl.Result{Requeue: false}, nil + return nil } func (r *Reconciler) handlePauseResume( @@ -653,16 +670,18 @@ func (r *Reconciler) handlePauseResume( if database.Status.State == DatabaseProvisioning { if database.Spec.Pause { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: DatabasePausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, }) database.Status.State = DatabasePaused } else { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: DatabaseReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, }) database.Status.State = DatabaseReady } @@ -672,10 +691,11 @@ func (r *Reconciler) handlePauseResume( if database.Status.State == DatabaseReady && database.Spec.Pause { r.Log.Info("`pause: true` was noticed, moving Database to state `Paused`") meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Paused", + Type: DatabaseReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: database.Generation, + Message: "Transitioning to state Paused", }) database.Status.State = DatabasePaused return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -684,10 +704,11 @@ func (r *Reconciler) handlePauseResume( if database.Status.State == DatabasePaused && !database.Spec.Pause { r.Log.Info("`pause: false` was noticed, moving Database to state `Ready`") meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Ready", + Type: DatabasePausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: database.Generation, + Message: "Transitioning to state Ready", }) database.Status.State = DatabaseReady return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) @@ -696,18 +717,20 @@ func (r *Reconciler) handlePauseResume( if database.Spec.Pause { if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabasePausedCondition) { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabasePausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: DatabasePausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } } else { if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabaseReadyCondition) { meta.SetStatusCondition(&database.Status.Conditions, metav1.Condition{ - Type: DatabaseReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: DatabaseReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: database.Generation, }) return r.updateStatus(ctx, database, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/databasenodeset/sync.go b/internal/controllers/databasenodeset/sync.go index 0e0b2cde..34f2147a 100644 --- a/internal/controllers/databasenodeset/sync.go +++ b/internal/controllers/databasenodeset/sync.go @@ -62,17 +62,19 @@ func (r *Reconciler) setInitialStatus( if databaseNodeSet.Spec.Pause { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Paused", + Type: NodeSetPausedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Transitioning to state Paused", }) } else { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Ready", + Type: NodeSetReadyCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Transitioning to state Ready", }) } @@ -102,10 +104,11 @@ func (r *Reconciler) handleResourcesSync( if databaseNodeSet.Status.State == DatabaseNodeSetPending { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for sync resources for generation %d", databaseNodeSet.Generation), + Type: NodeSetPreparedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Waiting for sync resources", }) databaseNodeSet.Status.State = DatabaseNodeSetPreparing return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) @@ -155,10 +158,11 @@ func (r *Reconciler) handleResourcesSync( eventMessage+fmt.Sprintf(", failed to sync, error: %s", err), ) meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Failed to sync resources for generation %d", databaseNodeSet.Generation), + Type: NodeSetPreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Failed to sync resources", }) return r.updateStatus(ctx, databaseNodeSet, DefaultRequeueDelay) } else if result == controllerutil.OperationResultCreated || result == controllerutil.OperationResultUpdated { @@ -173,10 +177,11 @@ func (r *Reconciler) handleResourcesSync( if !meta.IsStatusConditionTrue(databaseNodeSet.Status.Conditions, NodeSetPreparedCondition) { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully synced resources", + Type: NodeSetPreparedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Successfully synced resources", }) return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } @@ -193,10 +198,11 @@ func (r *Reconciler) waitForStatefulSetToScale( if databaseNodeSet.Status.State == DatabaseNodeSetPreparing { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", databaseNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", databaseNodeSet.Spec.Nodes), }) databaseNodeSet.Status.State = DatabaseNodeSetProvisioning return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) @@ -234,20 +240,22 @@ func (r *Reconciler) waitForStatefulSetToScale( fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, databaseNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, databaseNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: databaseNodeSet.Generation, + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, databaseNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, databaseNodeSet, DefaultRequeueDelay) } if !meta.IsStatusConditionTrue(databaseNodeSet.Status.Conditions, NodeSetProvisionedCondition) { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", databaseNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", databaseNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } @@ -267,15 +275,17 @@ func (r *Reconciler) updateStatus( meta.IsStatusConditionFalse(databaseNodeSet.Status.Conditions, NodeSetProvisionedCondition) { if databaseNodeSet.Spec.Pause { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: NodeSetPausedCondition, + Status: metav1.ConditionFalse, + ObservedGeneration: databaseNodeSet.Generation, + Reason: ReasonInProgress, }) } else { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: NodeSetReadyCondition, + Status: metav1.ConditionFalse, + ObservedGeneration: databaseNodeSet.Generation, + Reason: ReasonInProgress, }) } } @@ -340,16 +350,18 @@ func (r *Reconciler) handlePauseResume( if databaseNodeSet.Status.State == DatabaseNodeSetProvisioning { if databaseNodeSet.Spec.Pause { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetPausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, }) databaseNodeSet.Status.State = DatabaseNodeSetPaused } else { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, }) databaseNodeSet.Status.State = DatabaseNodeSetReady } @@ -359,10 +371,11 @@ func (r *Reconciler) handlePauseResume( if databaseNodeSet.Status.State == DatabaseNodeSetReady && databaseNodeSet.Spec.Pause { r.Log.Info("`pause: true` was noticed, moving DatabaseNodeSet to state `Paused`") meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Paused", + Type: NodeSetReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Transitioning to state Paused", }) databaseNodeSet.Status.State = DatabaseNodeSetPaused return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) @@ -371,10 +384,11 @@ func (r *Reconciler) handlePauseResume( if databaseNodeSet.Status.State == DatabaseNodeSetPaused && !databaseNodeSet.Spec.Pause { r.Log.Info("`pause: false` was noticed, moving DatabaseNodeSet to state `Ready`") meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Ready", + Type: NodeSetPausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: databaseNodeSet.Generation, + Message: "Transitioning to state Ready", }) databaseNodeSet.Status.State = DatabaseNodeSetReady return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) @@ -383,18 +397,20 @@ func (r *Reconciler) handlePauseResume( if databaseNodeSet.Spec.Pause { if !meta.IsStatusConditionTrue(databaseNodeSet.Status.Conditions, NodeSetPausedCondition) { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetPausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, }) return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } } else { if !meta.IsStatusConditionTrue(databaseNodeSet.Status.Conditions, NodeSetReadyCondition) { meta.SetStatusCondition(&databaseNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: databaseNodeSet.Generation, }) return r.updateStatus(ctx, databaseNodeSet, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/storage/init.go b/internal/controllers/storage/init.go index a13dbab6..ec2f2207 100644 --- a/internal/controllers/storage/init.go +++ b/internal/controllers/storage/init.go @@ -34,10 +34,11 @@ func (r *Reconciler) setInitPipelineStatus( ) (bool, ctrl.Result, error) { if storage.Status.State == StoragePreparing { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageInitializedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Storage has not been initialized yet", + Type: StorageInitializedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Storage has not been initialized yet", }) storage.Status.State = StorageInitializing return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -67,10 +68,11 @@ func (r *Reconciler) setInitStorageCompleted( message string, ) (bool, ctrl.Result, error) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageInitializedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: message, + Type: StorageInitializedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, + Message: message, }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } @@ -196,9 +198,10 @@ func (r *Reconciler) initializeBlobstorage( "Failed initBlobstorage Job, check Pod logs for additional info", ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageInitializedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: StorageInitializedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, }) if err := r.Delete(ctx, initJob, client.PropagationPolicy(metav1.DeletePropagationForeground)); err != nil { r.Recorder.Event( diff --git a/internal/controllers/storage/sync.go b/internal/controllers/storage/sync.go index 55cde3ce..60852d93 100644 --- a/internal/controllers/storage/sync.go +++ b/internal/controllers/storage/sync.go @@ -41,11 +41,6 @@ func (r *Reconciler) Sync(ctx context.Context, cr *v1alpha1.Storage) (ctrl.Resul return result, err } - stop, result, err = r.syncNodeSetSpecInline(ctx, &storage) - if stop { - return result, err - } - if !meta.IsStatusConditionTrue(storage.Status.Conditions, StorageInitializedCondition) { return r.handleBlobstorageInit(ctx, &storage) } @@ -100,17 +95,19 @@ func (r *Reconciler) setInitialStatus( if storage.Spec.Pause { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePausedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Paused", + Type: StoragePausedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Transitioning to state Paused", }) } else { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageReadyCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Ready", + Type: StorageReadyCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Transitioning to state Ready", }) } @@ -129,10 +126,11 @@ func (r *Reconciler) waitForStatefulSetToScale( if storage.Status.State == StorageInitializing { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", storage.Spec.Nodes), + Type: StorageProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: fmt.Sprintf("Waiting for scale to desired number of nodes: %d", storage.Spec.Nodes), }) storage.Status.State = StorageProvisioning return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -170,20 +168,22 @@ func (r *Reconciler) waitForStatefulSetToScale( fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storage.Spec.Nodes), ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storage.Spec.Nodes), + Type: StorageProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storage.Spec.Nodes), }) return r.updateStatus(ctx, storage, DefaultRequeueDelay) } if !meta.IsStatusConditionTrue(storage.Status.Conditions, StorageProvisionedCondition) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storage.Spec.Nodes), + Type: StorageProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storage.Spec.Nodes), }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } @@ -200,10 +200,11 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( if storage.Status.State == StorageInitializing { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Waiting for NodeSets conditions to be Provisioned", + Type: StorageProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Waiting for NodeSet resources to be Provisioned", }) storage.Status.State = StorageProvisioning return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -250,8 +251,8 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( nodeSetConditions = nodeSetObject.(*v1alpha1.StorageNodeSet).Status.Conditions } - // TODO: also check observedGeneration to guarantee that compare with updated object - if !meta.IsStatusConditionTrue(nodeSetConditions, NodeSetProvisionedCondition) { + condition := meta.FindStatusCondition(nodeSetConditions, NodeSetProvisionedCondition) + if condition == nil || condition.ObservedGeneration != nodeSetObject.GetGeneration() || condition.Status != metav1.ConditionTrue { r.Recorder.Event( storage, corev1.EventTypeNormal, @@ -263,9 +264,10 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( ), ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: StorageProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, Message: fmt.Sprintf( "Waiting %s with name %s for condition NodeSetProvisioned to be True", nodeSetKind, @@ -278,10 +280,11 @@ func (r *Reconciler) waitForNodeSetsToProvisioned( if !meta.IsStatusConditionTrue(storage.Status.Conditions, StorageProvisionedCondition) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully scaled to desired number of nodes", + Type: StorageProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storage.Spec.Nodes), }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } @@ -309,10 +312,11 @@ func (r *Reconciler) handleResourcesSync( if storage.Status.State == StoragePending { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePreparedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for sync resources for generation %d", storage.Generation), + Type: StoragePreparedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Waiting for sync resources", }) storage.Status.State = StoragePreparing return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -374,10 +378,11 @@ func (r *Reconciler) handleResourcesSync( eventMessage+fmt.Sprintf(", failed to sync, error: %s", err), ) meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePreparedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Failed to sync resources for generation %d", storage.Generation), + Type: StoragePreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Failed to sync resources", }) return r.updateStatus(ctx, storage, DefaultRequeueDelay) } else if result == controllerutil.OperationResultCreated || result == controllerutil.OperationResultUpdated { @@ -390,12 +395,24 @@ func (r *Reconciler) handleResourcesSync( } } + if err := r.syncNodeSetSpecInline(ctx, storage); err != nil { + meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ + Type: StoragePreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, + Message: "Failed to sync NodeSet resources", + }) + return r.updateStatus(ctx, storage, DefaultRequeueDelay) + } + if !meta.IsStatusConditionTrue(storage.Status.Conditions, StoragePreparedCondition) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePreparedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully synced resources", + Type: StoragePreparedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, + Message: "Successfully synced resources", }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } @@ -407,8 +424,7 @@ func (r *Reconciler) handleResourcesSync( func (r *Reconciler) syncNodeSetSpecInline( ctx context.Context, storage *resources.StorageClusterBuilder, -) (bool, ctrl.Result, error) { - r.Log.Info("running step syncNodeSetSpecInline") +) error { matchingFields := client.MatchingFields{ OwnerControllerField: storage.Name, } @@ -424,7 +440,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to list StorageNodeSets: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } for _, storageNodeSet := range storageNodeSets.Items { @@ -448,7 +464,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to delete StorageNodeSet: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } r.Recorder.Event( storage, @@ -473,7 +489,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to list RemoteStorageNodeSets: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } for _, remoteStorageNodeSet := range remoteStorageNodeSets.Items { @@ -497,7 +513,7 @@ func (r *Reconciler) syncNodeSetSpecInline( "ProvisioningFailed", fmt.Sprintf("Failed to delete RemoteStorageNodeSet: %s", err), ) - return Stop, ctrl.Result{RequeueAfter: DefaultRequeueDelay}, err + return err } r.Recorder.Event( storage, @@ -511,18 +527,7 @@ func (r *Reconciler) syncNodeSetSpecInline( } } - if !meta.IsStatusConditionTrue(storage.Status.Conditions, StoragePreparedCondition) { - meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePreparedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully synced resources", - }) - return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) - } - - r.Log.Info("complete step syncNodeSetSpecInline") - return Continue, ctrl.Result{Requeue: false}, nil + return nil } func (r *Reconciler) runSelfCheck( @@ -595,15 +600,17 @@ func (r *Reconciler) updateStatus( meta.IsStatusConditionFalse(storage.Status.Conditions, StorageProvisionedCondition) { if storage.Spec.Pause { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: StoragePausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, }) } else { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: StorageReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storage.Generation, }) } } @@ -657,16 +664,18 @@ func (r *Reconciler) handlePauseResume( if storage.Status.State == StorageProvisioning { if storage.Spec.Pause { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: StoragePausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, }) storage.Status.State = StoragePaused } else { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: StorageReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, }) storage.Status.State = StorageReady } @@ -676,10 +685,11 @@ func (r *Reconciler) handlePauseResume( if storage.Status.State == StorageReady && storage.Spec.Pause { r.Log.Info("`pause: true` was noticed, moving Storage to state `Paused`") meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Paused", + Type: StorageReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: storage.Generation, + Message: "Transitioning to state Paused", }) storage.Status.State = StoragePaused return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -688,10 +698,11 @@ func (r *Reconciler) handlePauseResume( if storage.Status.State == StoragePaused && !storage.Spec.Pause { r.Log.Info("`pause: false` was noticed, moving Storage to state `Ready`") meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Ready", + Type: StoragePausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: storage.Generation, + Message: "Transitioning to state Ready", }) storage.Status.State = StorageReady return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) @@ -700,18 +711,20 @@ func (r *Reconciler) handlePauseResume( if storage.Spec.Pause { if !meta.IsStatusConditionTrue(storage.Status.Conditions, StoragePausedCondition) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StoragePausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: StoragePausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } } else { if !meta.IsStatusConditionTrue(storage.Status.Conditions, StorageReadyCondition) { meta.SetStatusCondition(&storage.Status.Conditions, metav1.Condition{ - Type: StorageReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: StorageReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storage.Generation, }) return r.updateStatus(ctx, storage, StatusUpdateRequeueDelay) } diff --git a/internal/controllers/storagenodeset/sync.go b/internal/controllers/storagenodeset/sync.go index fc0b9ed4..12c7781a 100644 --- a/internal/controllers/storagenodeset/sync.go +++ b/internal/controllers/storagenodeset/sync.go @@ -62,17 +62,19 @@ func (r *Reconciler) setInitialStatus( if storageNodeSet.Spec.Pause { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Paused", + Type: NodeSetPausedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: "Transitioning to state Paused", }) } else { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: "Transitioning to state Ready", + Type: NodeSetReadyCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: "Transitioning to state Ready", }) } @@ -102,10 +104,11 @@ func (r *Reconciler) handleResourcesSync( if storageNodeSet.Status.State == StorageNodeSetPending { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for sync resources for generation %d", storageNodeSet.Generation), + Type: NodeSetPreparedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: "Waiting for sync resources", }) storageNodeSet.Status.State = StorageNodeSetPreparing return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) @@ -155,10 +158,11 @@ func (r *Reconciler) handleResourcesSync( eventMessage+fmt.Sprintf(", failed to sync, error: %s", err), ) meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Failed to sync resources for generation %d", storageNodeSet.Generation), + Type: NodeSetPreparedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: "Failed to sync resources", }) return r.updateStatus(ctx, storageNodeSet, DefaultRequeueDelay) } else if result == controllerutil.OperationResultCreated || result == controllerutil.OperationResultUpdated { @@ -173,10 +177,11 @@ func (r *Reconciler) handleResourcesSync( if !meta.IsStatusConditionTrue(storageNodeSet.Status.Conditions, NodeSetPreparedCondition) { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPreparedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: "Successfully synced resources", + Type: NodeSetPreparedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, + Message: "Successfully synced resources", }) return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) } @@ -193,10 +198,11 @@ func (r *Reconciler) waitForStatefulSetToScale( if storageNodeSet.Status.State == StorageNodeSetPreparing { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionUnknown, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", storageNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionUnknown, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: fmt.Sprintf("Waiting for scale to desired nodes: %d", storageNodeSet.Spec.Nodes), }) storageNodeSet.Status.State = StorageNodeSetProvisioning return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) @@ -234,20 +240,22 @@ func (r *Reconciler) waitForStatefulSetToScale( fmt.Sprintf("Waiting for number of running nodes to match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storageNodeSet.Spec.Nodes), ) meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, - Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storageNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, + Message: fmt.Sprintf("Number of running nodes does not match expected: %d != %d", foundStatefulSet.Status.ReadyReplicas, storageNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, storageNodeSet, DefaultRequeueDelay) } if !meta.IsStatusConditionTrue(storageNodeSet.Status.Conditions, NodeSetProvisionedCondition) { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetProvisionedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, - Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storageNodeSet.Spec.Nodes), + Type: NodeSetProvisionedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, + Message: fmt.Sprintf("Successfully scaled to desired number of nodes: %d", storageNodeSet.Spec.Nodes), }) return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) } @@ -267,15 +275,17 @@ func (r *Reconciler) updateStatus( meta.IsStatusConditionFalse(storageNodeSet.Status.Conditions, NodeSetProvisionedCondition) { if storageNodeSet.Spec.Pause { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: NodeSetPausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, }) } else { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonInProgress, + Type: NodeSetReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonInProgress, + ObservedGeneration: storageNodeSet.Generation, }) } } @@ -322,8 +332,8 @@ func (r *Reconciler) updateStatus( func shouldIgnoreStorageNodeSetChange(storageNodeSet *resources.StorageNodeSetResource) resources.IgnoreChangesFunction { return func(oldObj, newObj runtime.Object) bool { - if _, ok := newObj.(*appsv1.StatefulSet); ok { - if storageNodeSet.Spec.Pause && *oldObj.(*appsv1.StatefulSet).Spec.Replicas == 0 { + if statefulSet, ok := oldObj.(*appsv1.StatefulSet); ok { + if storageNodeSet.Spec.Pause && *statefulSet.Spec.Replicas == 0 { return true } } @@ -340,16 +350,18 @@ func (r *Reconciler) handlePauseResume( if storageNodeSet.Status.State == StorageNodeSetProvisioning { if storageNodeSet.Spec.Pause { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetPausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, }) storageNodeSet.Status.State = StorageNodeSetPaused } else { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, }) storageNodeSet.Status.State = StorageNodeSetReady } @@ -359,10 +371,11 @@ func (r *Reconciler) handlePauseResume( if storageNodeSet.Status.State == StorageNodeSetReady && storageNodeSet.Spec.Pause { r.Log.Info("`pause: true` was noticed, moving StorageNodeSet to state `Paused`") meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Paused", + Type: NodeSetReadyCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: storageNodeSet.Generation, + Message: "Transitioning to state Paused", }) storageNodeSet.Status.State = StorageNodeSetPaused return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) @@ -371,10 +384,11 @@ func (r *Reconciler) handlePauseResume( if storageNodeSet.Status.State == StorageNodeSetPaused && !storageNodeSet.Spec.Pause { r.Log.Info("`pause: false` was noticed, moving StorageNodeSet to state `Ready`") meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionFalse, - Reason: ReasonNotRequired, - Message: "Transitioning to state Ready", + Type: NodeSetPausedCondition, + Status: metav1.ConditionFalse, + Reason: ReasonNotRequired, + ObservedGeneration: storageNodeSet.Generation, + Message: "Transitioning to state Ready", }) storageNodeSet.Status.State = StorageNodeSetReady return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) @@ -383,18 +397,20 @@ func (r *Reconciler) handlePauseResume( if storageNodeSet.Spec.Pause { if !meta.IsStatusConditionTrue(storageNodeSet.Status.Conditions, NodeSetPausedCondition) { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetPausedCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetPausedCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, }) return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) } } else { if !meta.IsStatusConditionTrue(storageNodeSet.Status.Conditions, NodeSetReadyCondition) { meta.SetStatusCondition(&storageNodeSet.Status.Conditions, metav1.Condition{ - Type: NodeSetReadyCondition, - Status: metav1.ConditionTrue, - Reason: ReasonCompleted, + Type: NodeSetReadyCondition, + Status: metav1.ConditionTrue, + Reason: ReasonCompleted, + ObservedGeneration: storageNodeSet.Generation, }) return r.updateStatus(ctx, storageNodeSet, StatusUpdateRequeueDelay) } diff --git a/internal/resources/remotedatabasenodeset.go b/internal/resources/remotedatabasenodeset.go index 93fcf5c1..e4d776a8 100644 --- a/internal/resources/remotedatabasenodeset.go +++ b/internal/resources/remotedatabasenodeset.go @@ -204,7 +204,7 @@ func (b *RemoteDatabaseNodeSetResource) CreateRemoteResourceStatus( &b.Status.RemoteResources[len(b.Status.RemoteResources)-1].Conditions, metav1.Condition{ Type: RemoteResourceSyncedCondition, - Status: "Unknown", + Status: metav1.ConditionUnknown, Reason: ReasonInProgress, }, ) diff --git a/internal/resources/remotestoragenodeset.go b/internal/resources/remotestoragenodeset.go index c8dbf8d9..ad34c985 100644 --- a/internal/resources/remotestoragenodeset.go +++ b/internal/resources/remotestoragenodeset.go @@ -183,7 +183,7 @@ func (b *RemoteStorageNodeSetResource) CreateRemoteResourceStatus(remoteObj clie &b.Status.RemoteResources[len(b.Status.RemoteResources)-1].Conditions, metav1.Condition{ Type: RemoteResourceSyncedCondition, - Status: "Unknown", + Status: metav1.ConditionUnknown, Reason: ReasonInProgress, }, ) From 25b0d7ae4eb4475294ee0cb625059322527ad71d Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Tue, 28 Jan 2025 21:59:38 +0800 Subject: [PATCH 59/70] New field `ExternalPort` for GRPC Service to override `--grpc-public-port` arg (#278) --- .../unreleased/Added-20250104-143452.yaml | 3 + .../unreleased/Fixed-20250104-143747.yaml | 3 + .gitignore | 2 + Makefile | 22 +++-- api/v1alpha1/const.go | 1 + api/v1alpha1/service_types.go | 3 +- deploy/ydb-operator/crds/database.yaml | 3 + deploy/ydb-operator/crds/databasenodeset.yaml | 3 + .../crds/remotedatabasenodeset.yaml | 3 + .../crds/remotestoragenodeset.yaml | 3 + deploy/ydb-operator/crds/storage.yaml | 3 + deploy/ydb-operator/crds/storagenodeset.yaml | 3 + .../controllers/database/controller_test.go | 82 ++++++++++++++++++ internal/resources/database.go | 5 +- internal/resources/database_statefulset.go | 29 +++++-- internal/resources/service.go | 6 ++ tests/cfg/kind-cluster-config.yaml | 5 ++ tests/cfg/operator-local-values.yaml | 5 ++ tests/e2e/smoke_test.go | 35 ++++++++ tests/test-utils/test-utils.go | 85 +++++++++++++++++-- 20 files changed, 280 insertions(+), 24 deletions(-) create mode 100644 .changes/unreleased/Added-20250104-143452.yaml create mode 100644 .changes/unreleased/Fixed-20250104-143747.yaml diff --git a/.changes/unreleased/Added-20250104-143452.yaml b/.changes/unreleased/Added-20250104-143452.yaml new file mode 100644 index 00000000..d70253c6 --- /dev/null +++ b/.changes/unreleased/Added-20250104-143452.yaml @@ -0,0 +1,3 @@ +kind: Added +body: field externalPort for grpc service to override --grpc-public-port arg +time: 2025-01-04T14:34:52.706824+08:00 diff --git a/.changes/unreleased/Fixed-20250104-143747.yaml b/.changes/unreleased/Fixed-20250104-143747.yaml new file mode 100644 index 00000000..4a4439c7 --- /dev/null +++ b/.changes/unreleased/Fixed-20250104-143747.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: update the Makefile with the changes in GitHub CI +time: 2025-01-04T14:37:47.689565+08:00 diff --git a/.gitignore b/.gitignore index e3f63895..8d25f855 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties +log.json +log.txt bin/ config/ diff --git a/Makefile b/Makefile index 967c8c19..86c88e5a 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ VERSION ?= 0.1.0 IMG ?= cr.yandex/yc/ydb-operator:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.26 +# Image URL which uses in tests +YDB_IMAGE ?= $(shell grep "anchor_for_fetching_image_from_workflow" ./tests/**/*.go | grep -o -E '"cr\.yandex.*"' | tr -d '"') # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -65,25 +67,29 @@ vet: ## Run go vet against code. kind-init: if kind get clusters | grep "kind-ydb-operator"; then exit 0; fi; \ - kind create cluster --config e2e/kind-cluster-config.yaml --name kind-ydb-operator; \ - docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0; \ - kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator; \ - docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7; \ - kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 --name kind-ydb-operator + kind create cluster \ + --config tests/cfg/kind-cluster-config.yaml \ + --image=kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e \ + --name kind-ydb-operator + docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 + kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator + docker pull ${YDB_IMAGE} + kind load docker-image ${YDB_IMAGE} --name kind-ydb-operator kind-load: - docker tag cr.yandex/yc/ydb-operator:latest kind/ydb-operator:current + docker tag ${IMG} kind/ydb-operator:current kind load docker-image kind/ydb-operator:current --name kind-ydb-operator opts ?= '' .PHONY: unit-test unit-test: manifests generate fmt vet envtest ## Run unit tests - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 900s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out $(opts) + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" \ + go test -v -timeout 900s -p 1 ./internal/... -ginkgo.vv -coverprofile cover.out $(opts) .PHONY: e2e-test e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests - go test -v -timeout 3600s -p 1 ./e2e/... -ginkgo.v $(opts) + go test -v -timeout 3600s -p 1 ./tests/e2e/... -ginkgo.vv $(opts) .PHONY: test test: unit-test e2e-test ## Run all tests diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index a9fe280d..0fe9e0ec 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -64,6 +64,7 @@ const ( AnnotationDisableLivenessProbe = "ydb.tech/disable-liveness-probe" AnnotationDataCenter = "ydb.tech/data-center" AnnotationGRPCPublicHost = "ydb.tech/grpc-public-host" + AnnotationGRPCPublicPort = "ydb.tech/grpc-public-port" AnnotationNodeHost = "ydb.tech/node-host" AnnotationNodeDomain = "ydb.tech/node-domain" AnnotationAuthTokenSecretName = "ydb.tech/auth-token-secret-name" diff --git a/api/v1alpha1/service_types.go b/api/v1alpha1/service_types.go index 981cce60..8c540c74 100644 --- a/api/v1alpha1/service_types.go +++ b/api/v1alpha1/service_types.go @@ -21,7 +21,8 @@ type GRPCService struct { Service `json:""` TLSConfiguration *TLSConfiguration `json:"tls,omitempty"` - ExternalHost string `json:"externalHost,omitempty"` // TODO implementation + ExternalHost string `json:"externalHost,omitempty"` + ExternalPort int32 `json:"externalPort,omitempty"` IPDiscovery *IPDiscovery `json:"ipDiscovery,omitempty"` } diff --git a/deploy/ydb-operator/crds/database.yaml b/deploy/ydb-operator/crds/database.yaml index eae6f463..7493ceec 100644 --- a/deploy/ydb-operator/crds/database.yaml +++ b/deploy/ydb-operator/crds/database.yaml @@ -4075,6 +4075,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 2417044a..d5164b28 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -2687,6 +2687,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml index f24ffa2e..ac65fe56 100644 --- a/deploy/ydb-operator/crds/remotedatabasenodeset.yaml +++ b/deploy/ydb-operator/crds/remotedatabasenodeset.yaml @@ -2688,6 +2688,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/deploy/ydb-operator/crds/remotestoragenodeset.yaml b/deploy/ydb-operator/crds/remotestoragenodeset.yaml index 651c504d..ce30bb27 100644 --- a/deploy/ydb-operator/crds/remotestoragenodeset.yaml +++ b/deploy/ydb-operator/crds/remotestoragenodeset.yaml @@ -2715,6 +2715,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/deploy/ydb-operator/crds/storage.yaml b/deploy/ydb-operator/crds/storage.yaml index d989e383..1fed259e 100644 --- a/deploy/ydb-operator/crds/storage.yaml +++ b/deploy/ydb-operator/crds/storage.yaml @@ -5216,6 +5216,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index 9ce14e79..cf3ea5ee 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -2714,6 +2714,9 @@ spec: type: object externalHost: type: string + externalPort: + format: int32 + type: integer ipDiscovery: properties: enabled: diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index ee099129..467726a5 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -24,6 +24,7 @@ import ( . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/database" "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/storage" + "github.com/ydb-platform/ydb-kubernetes-operator/internal/resources" "github.com/ydb-platform/ydb-kubernetes-operator/internal/test" testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" ) @@ -306,4 +307,85 @@ var _ = Describe("Database controller medium tests", func() { Expect(args).To(ContainElements([]string{"--grpc-public-address-v4", "--grpc-public-target-name-override"})) }) + + It("Check externalPort GRPC Service field propagation", func() { + By("Create test database") + databaseSample = *testobjects.DefaultDatabase() + Expect(k8sClient.Create(ctx, &databaseSample)).Should(Succeed()) + + checkPublicPortArg := func(expectedGRPCPort string) error { + foundStatefulSet := appsv1.StatefulSet{} + Eventually(func() error { + return k8sClient.Get(ctx, + types.NamespacedName{ + Name: testobjects.DatabaseName, + Namespace: testobjects.YdbNamespace, + }, + &foundStatefulSet, + ) + }, test.Timeout, test.Interval).Should(Succeed()) + podContainerArgs := foundStatefulSet.Spec.Template.Spec.Containers[0].Args + for idx, argKey := range podContainerArgs { + if argKey == "--grpc-public-port" { + if podContainerArgs[idx+1] != expectedGRPCPort { + return fmt.Errorf( + "Found arg `--grpc-public-port` value %s does not match with expected: %s", + podContainerArgs[idx+1], + expectedGRPCPort, + ) + } + } + } + return nil + } + + By("Check that args `--grpc-public-host` and `--grpc-public-port` propagated to StatefulSet pods...") + Eventually( + checkPublicPortArg(fmt.Sprintf("%d", v1alpha1.GRPCPort)), + test.Timeout, + test.Interval).ShouldNot(HaveOccurred()) + + externalPort := int32(30001) + By("Update externalHost and externalPort for Database GRPC Service...", func() { + database := v1alpha1.Database{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: testobjects.DatabaseName, + Namespace: testobjects.YdbNamespace, + }, &database)) + database.Spec.Service.GRPC.ExternalPort = externalPort + Expect(k8sClient.Update(ctx, &database)).Should(Succeed()) + }) + + By("Check that type was updated for Database GRPC Service to NodePort...") + Eventually(func() error { + databaseGRPCService := corev1.Service{} + Expect(k8sClient.Get(ctx, types.NamespacedName{ + Name: fmt.Sprintf(resources.GRPCServiceNameFormat, databaseSample.Name), + Namespace: testobjects.YdbNamespace, + }, &databaseGRPCService)) + if databaseGRPCService.Spec.Type != corev1.ServiceTypeNodePort { + return fmt.Errorf( + "Found GRPC Service .spec.type %s does not match with expected: %s", + databaseGRPCService.Spec.Type, + corev1.ServiceTypeNodePort, + ) + } + for _, port := range databaseGRPCService.Spec.Ports { + if port.NodePort != externalPort { + return fmt.Errorf( + "Found GRPC Service NodePort value %d does not match with expected: %s", + port.NodePort, + fmt.Sprintf("%d", externalPort), + ) + } + } + return nil + }, test.Timeout, test.Interval).ShouldNot(HaveOccurred()) + + By("Check that args `--grpc-public-port` was updated in StatefulSet...") + Eventually( + checkPublicPortArg(fmt.Sprintf("%d", externalPort)), + test.Timeout, + test.Interval).ShouldNot(HaveOccurred()) + }) }) diff --git a/internal/resources/database.go b/internal/resources/database.go index c2543680..e2935036 100644 --- a/internal/resources/database.go +++ b/internal/resources/database.go @@ -175,8 +175,9 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc SelectorLabels: databaseSelectorLabels, Annotations: b.Spec.Service.GRPC.AdditionalAnnotations, Ports: []corev1.ServicePort{{ - Name: api.GRPCServicePortName, - Port: api.GRPCPort, + Name: api.GRPCServicePortName, + Port: api.GRPCPort, + NodePort: b.Spec.Service.GRPC.ExternalPort, }}, IPFamilies: b.Spec.Service.GRPC.IPFamilies, IPFamilyPolicy: b.Spec.Service.GRPC.IPFamilyPolicy, diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index 06b5cbc5..df84df23 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "regexp" - "strconv" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -74,6 +73,15 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar { var envVars []corev1.EnvVar envVars = append(envVars, + corev1.EnvVar{ + Name: "POD_NAME", // for `--grpc-public-host` flag + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ + APIVersion: "v1", + FieldPath: "metadata.name", + }, + }, + }, corev1.EnvVar{ Name: "NODE_NAME", // for `--grpc-public-host` flag ValueFrom: &corev1.EnvVarSource{ @@ -640,10 +648,11 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { } publicHostOption := "--grpc-public-host" - publicHost := fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Database.Name, b.GetNamespace(), domain) // FIXME .svc.cluster.local + publicHostDomain := fmt.Sprintf(api.InterconnectServiceFQDNFormat, b.Database.Name, b.GetNamespace(), domain) + publicHost := fmt.Sprintf("%s.%s", "$(POD_NAME)", publicHostDomain) if b.Spec.Service.GRPC.ExternalHost != "" { - publicHost = b.Spec.Service.GRPC.ExternalHost + publicHost = fmt.Sprintf("%s.%s", "$(POD_NAME)", b.Spec.Service.GRPC.ExternalHost) } if value, ok := b.ObjectMeta.Annotations[api.AnnotationGRPCPublicHost]; ok { publicHost = value @@ -667,22 +676,28 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { args = append( args, "--grpc-public-target-name-override", - fmt.Sprintf("%s.%s", "$(NODE_NAME)", targetNameOverride), + fmt.Sprintf("%s.%s", "$(POD_NAME)", targetNameOverride), ) } } publicPortOption := "--grpc-public-port" - publicPort := api.GRPCPort + publicPort := fmt.Sprintf("%d", api.GRPCPort) + if b.Spec.Service.GRPC.ExternalPort > 0 { + publicPort = fmt.Sprintf("%d", b.Spec.Service.GRPC.ExternalPort) + } + if value, ok := b.ObjectMeta.Annotations[api.AnnotationGRPCPublicPort]; ok { + publicPort = value + } args = append( args, publicHostOption, - fmt.Sprintf("%s.%s", "$(NODE_NAME)", publicHost), // fixme $(NODE_NAME) + publicHost, publicPortOption, - strconv.Itoa(publicPort), + publicPort, ) if value, ok := b.ObjectMeta.Annotations[api.AnnotationDataCenter]; ok { diff --git a/internal/resources/service.go b/internal/resources/service.go index 07a2e289..e32d1aaf 100644 --- a/internal/resources/service.go +++ b/internal/resources/service.go @@ -62,6 +62,12 @@ func (b *ServiceBuilder) Build(obj client.Object) error { service.Spec.ClusterIP = "None" } + for _, port := range service.Spec.Ports { + if port.NodePort > 0 { + service.Spec.Type = corev1.ServiceTypeNodePort + } + } + return nil } diff --git a/tests/cfg/kind-cluster-config.yaml b/tests/cfg/kind-cluster-config.yaml index 18829857..82348230 100644 --- a/tests/cfg/kind-cluster-config.yaml +++ b/tests/cfg/kind-cluster-config.yaml @@ -4,6 +4,11 @@ nodes: - role: control-plane - role: worker + extraPortMappings: + - containerPort: 30001 + hostPort: 30001 + listenAddress: "127.0.0.1" + protocol: tcp labels: topology.kubernetes.io/zone: az-1 worker: true diff --git a/tests/cfg/operator-local-values.yaml b/tests/cfg/operator-local-values.yaml index edc33299..f81cad01 100644 --- a/tests/cfg/operator-local-values.yaml +++ b/tests/cfg/operator-local-values.yaml @@ -1,3 +1,8 @@ +image: + pullPolicy: IfNotPresent + repository: kind/ydb-operator + tag: current + webhook: enabled: true diff --git a/tests/e2e/smoke_test.go b/tests/e2e/smoke_test.go index e473efd8..3562e913 100644 --- a/tests/e2e/smoke_test.go +++ b/tests/e2e/smoke_test.go @@ -733,6 +733,41 @@ var _ = Describe("Operator smoke test", func() { ExecuteSimpleTableE2ETest(podName, testobjects.YdbNamespace, storageEndpoint, databasePath) }) + It("Check externalPort for Database", func() { + By("create storage...") + Expect(k8sClient.Create(ctx, storageSample)).Should(Succeed()) + defer DeleteStorageSafely(ctx, k8sClient, storageSample) + By("create database...") + databaseSample.Spec.Nodes = 1 + databaseSample.Spec.NodeSelector = map[string]string{ + "topology.kubernetes.io/zone": "az-1", + } + databaseSample.Annotations = map[string]string{ + v1alpha1.AnnotationGRPCPublicHost: "localhost", + } + databaseSample.Spec.Service.GRPC.ExternalPort = 30001 + Expect(k8sClient.Create(ctx, databaseSample)).Should(Succeed()) + defer func() { + Expect(k8sClient.Delete(ctx, databaseSample)).Should(Succeed()) + }() + + By("waiting until Storage is ready...") + WaitUntilStorageReady(ctx, k8sClient, storageSample.Name, testobjects.YdbNamespace) + + By("checking that all the storage pods are running and ready...") + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-storage", storageSample.Spec.Nodes) + + By("waiting until database is ready...") + WaitUntilDatabaseReady(ctx, k8sClient, databaseSample.Name, testobjects.YdbNamespace) + + By("checking that all the database pods are running and ready...") + CheckPodsRunningAndReady(ctx, k8sClient, "ydb-cluster", "kind-database", databaseSample.Spec.Nodes) + + By("execute simple query with ydb-go-sdk...") + databasePath := DatabasePathWithDefaultDomain(databaseSample) + ExecuteSimpleTableE2ETestWithSDK(databaseSample.Name, testobjects.YdbNamespace, databasePath) + }) + AfterEach(func() { UninstallOperatorWithHelm(testobjects.YdbNamespace) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) diff --git a/tests/test-utils/test-utils.go b/tests/test-utils/test-utils.go index 43cb86ed..66761a10 100644 --- a/tests/test-utils/test-utils.go +++ b/tests/test-utils/test-utils.go @@ -3,6 +3,7 @@ package testutils import ( "bufio" "context" + "database/sql" "fmt" "io" "os" @@ -23,6 +24,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + ydb "github.com/ydb-platform/ydb-go-sdk/v3" + "github.com/ydb-platform/ydb-go-sdk/v3/retry" + v1alpha1 "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1" . "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" testobjects "github.com/ydb-platform/ydb-kubernetes-operator/tests/test-k8s-objects" @@ -34,11 +38,17 @@ const ( Interval = time.Second * 2 YdbOperatorRemoteChart = "ydb/ydb-operator" YdbOperatorReleaseName = "ydb-operator" + TestTablePath = "testfolder/testtable" ) var ( pathToHelmValuesInLocalInstall = filepath.Join("..", "cfg", "operator-local-values.yaml") pathToHelmValuesInRemoteInstall = filepath.Join("..", "cfg", "operator-values.yaml") + + createTableQuery = fmt.Sprintf("CREATE TABLE `%s` (testColumnA Utf8, testColumnB Utf8, PRIMARY KEY (testColumnA));", TestTablePath) + insertQuery = fmt.Sprintf("INSERT INTO `%s` (testColumnA, testColumnB) VALUES ('valueA', 'valueB');", TestTablePath) + selectQuery = fmt.Sprintf("SELECT testColumnA, testColumnB FROM `%s`;", TestTablePath) + dropTableQuery = fmt.Sprintf("DROP TABLE `%s`;", TestTablePath) ) func InstallLocalOperatorWithHelm(namespace string) { @@ -203,8 +213,6 @@ func BringYdbCliToPod(podName, podNamespace string) { } func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, databasePath string) { - tablePath := "testfolder/testtable" - tableCreatingInterval := time.Second * 10 Eventually(func(g Gomega) { @@ -217,7 +225,7 @@ func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, da "-e", storageEndpoint, "yql", "-s", - fmt.Sprintf("CREATE TABLE `%s` (testColumnA Utf8, testColumnB Utf8, PRIMARY KEY (testColumnA));", tablePath), + createTableQuery, } output, _ := exec.Command("kubectl", args...).CombinedOutput() fmt.Println(string(output)) @@ -232,7 +240,7 @@ func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, da "-e", storageEndpoint, "yql", "-s", - fmt.Sprintf("INSERT INTO `%s` (testColumnA, testColumnB) VALUES ('valueA', 'valueB');", tablePath), + insertQuery, } output, err := exec.Command("kubectl", argsInsert...).CombinedOutput() Expect(err).ShouldNot(HaveOccurred(), string(output)) @@ -247,7 +255,7 @@ func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, da "yql", "--format", "csv", "-s", - fmt.Sprintf("SELECT * FROM `%s`;", tablePath), + selectQuery, } output, err = exec.Command("kubectl", argsSelect...).CombinedOutput() Expect(err).ShouldNot(HaveOccurred(), string(output)) @@ -262,12 +270,77 @@ func ExecuteSimpleTableE2ETest(podName, podNamespace, storageEndpoint string, da "-e", storageEndpoint, "yql", "-s", - fmt.Sprintf("DROP TABLE `%s`;", tablePath), + dropTableQuery, } output, err = exec.Command("kubectl", argsDrop...).CombinedOutput() Expect(err).ShouldNot(HaveOccurred(), string(output)) } +func ExecuteSimpleTableE2ETestWithSDK(databaseName, databaseNamespace, databasePath string) { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + cc, err := ydb.Open( + ctx, + fmt.Sprintf("grpc://localhost:30001/%s", databasePath), + ) + Expect(err).ShouldNot(HaveOccurred()) + defer func() { _ = cc.Close(ctx) }() + + c, err := ydb.Connector(cc, + ydb.WithAutoDeclare(), + ydb.WithTablePathPrefix(fmt.Sprintf("%s/%s", databasePath, TestTablePath)), + ) + Expect(err).ShouldNot(HaveOccurred()) + defer func() { _ = c.Close() }() + + db := sql.OpenDB(c) + defer func() { _ = db.Close() }() + + err = retry.Do(ctx, db, func(ctx context.Context, cc *sql.Conn) error { + _, err = cc.ExecContext(ydb.WithQueryMode(ctx, ydb.SchemeQueryMode), createTableQuery) + if err != nil { + return err + } + return nil + }, retry.WithIdempotent(true)) + Expect(err).ShouldNot(HaveOccurred()) + + err = retry.DoTx(ctx, db, func(ctx context.Context, tx *sql.Tx) error { + if _, err = tx.ExecContext(ctx, insertQuery); err != nil { + return err + } + return nil + }, retry.WithIdempotent(true)) + Expect(err).ShouldNot(HaveOccurred()) + + var ( + testColumnA string + testColumnB string + ) + err = retry.Do(ctx, db, func(ctx context.Context, cc *sql.Conn) (err error) { + row := cc.QueryRowContext(ctx, selectQuery) + if err = row.Scan(&testColumnA, &testColumnB); err != nil { + return err + } + + return nil + }, retry.WithIdempotent(true)) + Expect(err).ShouldNot(HaveOccurred()) + Expect(testColumnA).To(BeEquivalentTo("valueA")) + Expect(testColumnB).To(BeEquivalentTo("valueB")) + + err = retry.Do(ctx, db, func(ctx context.Context, cc *sql.Conn) error { + _, err = cc.ExecContext(ydb.WithQueryMode(ctx, ydb.SchemeQueryMode), dropTableQuery) + if err != nil { + return err + } + + return nil + }, retry.WithIdempotent(true)) + Expect(err).ShouldNot(HaveOccurred()) +} + func PortForward( ctx context.Context, svcName, svcNamespace, serverName string, From 3a1af221e48ffb439ca3725fd0fabacfc15c4cb2 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Wed, 29 Jan 2025 13:34:03 +0100 Subject: [PATCH 60/70] Use correct operator version in e2e tests (#287) * fix: use correct operator version * fix: init job launching on the same nodes * fix: operator local values --- Makefile | 1 + tests/test-k8s-objects/objects.go | 3 +++ tests/test-utils/test-utils.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 86c88e5a..a3266722 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,7 @@ kind-init: --name kind-ydb-operator docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator + kubectl cluster-info --context kind-kind-ydb-operator # yes, kind prefixes all context with one more 'kind-' docker pull ${YDB_IMAGE} kind load docker-image ${YDB_IMAGE} --name kind-ydb-operator diff --git a/tests/test-k8s-objects/objects.go b/tests/test-k8s-objects/objects.go index 447f6c49..b4c1394c 100644 --- a/tests/test-k8s-objects/objects.go +++ b/tests/test-k8s-objects/objects.go @@ -109,6 +109,9 @@ func DefaultStorage(storageYamlConfigPath string) *v1alpha1.Storage { AdditionalLabels: map[string]string{"ydb-cluster": "kind-storage"}, Affinity: storageAntiAffinity, }, + InitJob: &v1alpha1.StorageInitJobSpec{ + AdditionalLabels: map[string]string{"ydb-cluster": "kind-storage-init"}, + }, }, } } diff --git a/tests/test-utils/test-utils.go b/tests/test-utils/test-utils.go index 66761a10..d06d013b 100644 --- a/tests/test-utils/test-utils.go +++ b/tests/test-utils/test-utils.go @@ -108,7 +108,7 @@ func UpgradeOperatorWithHelm(namespace, version string) { "ydb-operator", YdbOperatorRemoteChart, "--version", version, - "-f", pathToHelmValuesInLocalInstall, + "-f", pathToHelmValuesInRemoteInstall, } cmd := exec.Command("helm", args...) From c3f7de5a7578c2603135e629b9d5df5ae54c5295 Mon Sep 17 00:00:00 2001 From: Nikita Kozlovskii Date: Wed, 29 Jan 2025 16:18:16 +0100 Subject: [PATCH 61/70] append secrets and volumes from storage spec to init-job volumes (#282) * apend secrets and volumes from storage spec to init-job volumes * wip * rename grpcTLSVolumeName to GRPCTLSVolumeName * remove one test * add changie * fix test --- .../unreleased/Fixed-20250129-134226.yaml | 3 ++ internal/resources/database_statefulset.go | 6 +-- internal/resources/resource.go | 2 +- internal/resources/storage_init_job.go | 25 ++++++++-- internal/resources/storage_statefulset.go | 6 +-- tests/e2e/smoke_test.go | 48 +++++++++++++++++++ 6 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250129-134226.yaml diff --git a/.changes/unreleased/Fixed-20250129-134226.yaml b/.changes/unreleased/Fixed-20250129-134226.yaml new file mode 100644 index 00000000..2405bd52 --- /dev/null +++ b/.changes/unreleased/Fixed-20250129-134226.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: Passing additional secret volumes to blobstorage-init. The init container can now use them without issues. +time: 2025-01-29T13:42:26.145577+01:00 diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index df84df23..a27f977b 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -192,7 +192,7 @@ func (b *DatabaseStatefulSetBuilder) buildVolumes() []corev1.Volume { } if b.Spec.Service.GRPC.TLSConfiguration.Enabled { - volumes = append(volumes, buildTLSVolume(grpcTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) + volumes = append(volumes, buildTLSVolume(GRPCTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) } if b.Spec.Service.Interconnect.TLSConfiguration.Enabled { @@ -314,7 +314,7 @@ func (b *DatabaseStatefulSetBuilder) buildCaStorePatchingInitContainerVolumeMoun if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) @@ -482,7 +482,7 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) diff --git a/internal/resources/resource.go b/internal/resources/resource.go index c48965cf..81acea22 100644 --- a/internal/resources/resource.go +++ b/internal/resources/resource.go @@ -35,7 +35,7 @@ const ( StatusServiceNameFormat = "%s-status" DatastreamsServiceNameFormat = "%s-datastreams" - grpcTLSVolumeName = "grpc-tls-volume" + GRPCTLSVolumeName = "grpc-tls-volume" interconnectTLSVolumeName = "interconnect-tls-volume" datastreamsTLSVolumeName = "datastreams-tls-volume" statusTLSVolumeName = "status-tls-volume" diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index 871ab535..4308e29b 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -75,6 +75,7 @@ func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplate DNSConfig: &corev1.PodDNSConfig{ Searches: dnsConfigSearches, }, + InitContainers: b.Spec.InitContainers, }, } @@ -92,8 +93,7 @@ func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplate } } - // InitContainer only needed for CaBundle manipulation for now, - // may be probably used for other stuff later + // append an init container for updating the ca.crt if we have any certificates if b.AnyCertificatesAdded() { podTemplate.Spec.InitContainers = append( []corev1.Container{b.buildCaStorePatchingInitContainer()}, @@ -137,7 +137,7 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume { } if b.Spec.Service.GRPC.TLSConfiguration.Enabled { - volumes = append(volumes, buildTLSVolume(grpcTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) + volumes = append(volumes, buildTLSVolume(GRPCTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) } if b.Spec.OperatorConnection != nil { @@ -153,6 +153,21 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume { }) } + for _, secret := range b.Spec.Secrets { + volumes = append(volumes, corev1.Volume{ + Name: secret.Name, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: secret.Name, + }, + }, + }) + } + + for _, volume := range b.Spec.Volumes { + volumes = append(volumes, *volume) + } + if b.AnyCertificatesAdded() { volumes = append(volumes, corev1.Volume{ Name: systemCertsVolumeName, @@ -219,7 +234,7 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount { if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) @@ -302,7 +317,7 @@ func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainerVolumeMounts() if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) diff --git a/internal/resources/storage_statefulset.go b/internal/resources/storage_statefulset.go index 9c74dcb5..5fb87671 100644 --- a/internal/resources/storage_statefulset.go +++ b/internal/resources/storage_statefulset.go @@ -216,7 +216,7 @@ func (b *StorageStatefulSetBuilder) buildVolumes() []corev1.Volume { } if b.Spec.Service.GRPC.TLSConfiguration.Enabled { - volumes = append(volumes, buildTLSVolume(grpcTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) + volumes = append(volumes, buildTLSVolume(GRPCTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) } if b.Spec.Service.Interconnect.TLSConfiguration.Enabled { @@ -326,7 +326,7 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainerVolumeMount if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) @@ -438,7 +438,7 @@ func (b *StorageStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount { if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: grpcTLSVolumeName, + Name: GRPCTLSVolumeName, ReadOnly: true, MountPath: grpcTLSVolumeMountPath, }) diff --git a/tests/e2e/smoke_test.go b/tests/e2e/smoke_test.go index 3562e913..59e51c10 100644 --- a/tests/e2e/smoke_test.go +++ b/tests/e2e/smoke_test.go @@ -768,6 +768,54 @@ var _ = Describe("Operator smoke test", func() { ExecuteSimpleTableE2ETestWithSDK(databaseSample.Name, testobjects.YdbNamespace, databasePath) }) + It("Check init job with additional volumes and GRPCS enabled", func() { + By("create stls secrets...") + storageCert := testobjects.StorageCertificate() + + secret := storageCert.DeepCopy() + secret.Name = "another-secret" + + Expect(k8sClient.Create(ctx, storageCert)).Should(Succeed()) + Expect(k8sClient.Create(ctx, secret)).Should(Succeed()) + + By("create storage...") + storage := testobjects.DefaultStorage(filepath.Join("..", "data", "storage-mirror-3-dc-config-tls.yaml")) + + storage.Spec.Service.GRPC.TLSConfiguration = testobjects.TLSConfiguration( + testobjects.StorageCertificateSecretName, + ) + + storage.Spec.Secrets = []*corev1.LocalObjectReference{ + { + Name: secret.Name, + }, + } + + mountPath := fmt.Sprintf("%s/%s", v1alpha1.AdditionalSecretsDir, secret.Name) + + storage.Spec.InitContainers = []corev1.Container{ + { + Name: "init-container", + Image: storage.Spec.Image.Name, + Command: []string{"bash", "-xc"}, + Args: []string{fmt.Sprintf("ls -la %s", mountPath)}, + VolumeMounts: []corev1.VolumeMount{ + { + Name: secret.Name, + MountPath: mountPath, + ReadOnly: true, + }, + }, + }, + } + + Expect(k8sClient.Create(ctx, storage)).Should(Succeed()) + defer DeleteStorageSafely(ctx, k8sClient, storage) + + By("waiting until Storage is ready ...") + WaitUntilStorageReady(ctx, k8sClient, storage.Name, testobjects.YdbNamespace) + }) + AfterEach(func() { UninstallOperatorWithHelm(testobjects.YdbNamespace) Expect(k8sClient.Delete(ctx, &namespace)).Should(Succeed()) From 3ae10efa44f84a7653b9d4909f4c3de570e61c61 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:21:44 +0100 Subject: [PATCH 62/70] Release v0.6.0 (#288) Co-authored-by: Jorres --- .../unreleased/Added-20241113-181628.yaml | 3 -- .../unreleased/Added-20241118-222810.yaml | 4 --- .../unreleased/Added-20241204-122609.yaml | 3 -- .../unreleased/Added-20241204-122633.yaml | 3 -- .../unreleased/Added-20241204-153550.yaml | 3 -- .../unreleased/Added-20241209-182500.yaml | 3 -- .../unreleased/Added-20250104-143452.yaml | 3 -- .../unreleased/Added-20250124-141810.yaml | 3 -- .../unreleased/Added-20250127-130609.yaml | 3 -- .../unreleased/Changed-20241118-222537.yaml | 3 -- .../unreleased/Changed-20241204-122659.yaml | 3 -- .../unreleased/Changed-20241204-122713.yaml | 3 -- .../unreleased/Fixed-20241113-214512.yaml | 3 -- .../unreleased/Fixed-20241129-213809.yaml | 3 -- .../unreleased/Fixed-20241204-122736.yaml | 3 -- .../unreleased/Fixed-20250104-143747.yaml | 3 -- .../unreleased/Fixed-20250124-141631.yaml | 3 -- .../unreleased/Fixed-20250127-125607.yaml | 3 -- .../unreleased/Fixed-20250127-141003.yaml | 3 -- .../unreleased/Fixed-20250129-134226.yaml | 3 -- .../unreleased/Security-20241118-222433.yaml | 3 -- .../unreleased/Security-20250127-170538.yaml | 3 -- .changes/v0.6.0.md | 27 ++++++++++++++++++ CHANGELOG.md | 28 +++++++++++++++++++ deploy/ydb-operator/Chart.yaml | 4 +-- 25 files changed, 57 insertions(+), 69 deletions(-) delete mode 100644 .changes/unreleased/Added-20241113-181628.yaml delete mode 100644 .changes/unreleased/Added-20241118-222810.yaml delete mode 100644 .changes/unreleased/Added-20241204-122609.yaml delete mode 100644 .changes/unreleased/Added-20241204-122633.yaml delete mode 100644 .changes/unreleased/Added-20241204-153550.yaml delete mode 100644 .changes/unreleased/Added-20241209-182500.yaml delete mode 100644 .changes/unreleased/Added-20250104-143452.yaml delete mode 100644 .changes/unreleased/Added-20250124-141810.yaml delete mode 100644 .changes/unreleased/Added-20250127-130609.yaml delete mode 100644 .changes/unreleased/Changed-20241118-222537.yaml delete mode 100644 .changes/unreleased/Changed-20241204-122659.yaml delete mode 100644 .changes/unreleased/Changed-20241204-122713.yaml delete mode 100644 .changes/unreleased/Fixed-20241113-214512.yaml delete mode 100644 .changes/unreleased/Fixed-20241129-213809.yaml delete mode 100644 .changes/unreleased/Fixed-20241204-122736.yaml delete mode 100644 .changes/unreleased/Fixed-20250104-143747.yaml delete mode 100644 .changes/unreleased/Fixed-20250124-141631.yaml delete mode 100644 .changes/unreleased/Fixed-20250127-125607.yaml delete mode 100644 .changes/unreleased/Fixed-20250127-141003.yaml delete mode 100644 .changes/unreleased/Fixed-20250129-134226.yaml delete mode 100644 .changes/unreleased/Security-20241118-222433.yaml delete mode 100644 .changes/unreleased/Security-20250127-170538.yaml create mode 100644 .changes/v0.6.0.md diff --git a/.changes/unreleased/Added-20241113-181628.yaml b/.changes/unreleased/Added-20241113-181628.yaml deleted file mode 100644 index ac1658a2..00000000 --- a/.changes/unreleased/Added-20241113-181628.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: starting with this release, deploying to dockerhub (ydbplatform/ydb-kubernetes-operator) -time: 2024-11-13T18:16:28.275365313+01:00 diff --git a/.changes/unreleased/Added-20241118-222810.yaml b/.changes/unreleased/Added-20241118-222810.yaml deleted file mode 100644 index 7c6c51ef..00000000 --- a/.changes/unreleased/Added-20241118-222810.yaml +++ /dev/null @@ -1,4 +0,0 @@ -kind: Added -body: 'added the ability to create metadata announce for customize dns domain (default: - cluster.local)' -time: 2024-11-18T22:28:10.452679+03:00 diff --git a/.changes/unreleased/Added-20241204-122609.yaml b/.changes/unreleased/Added-20241204-122609.yaml deleted file mode 100644 index b7524b8b..00000000 --- a/.changes/unreleased/Added-20241204-122609.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: new field additionalPodLabels for Storage and Database CRD -time: 2024-12-04T12:26:09.597907+07:00 diff --git a/.changes/unreleased/Added-20241204-122633.yaml b/.changes/unreleased/Added-20241204-122633.yaml deleted file mode 100644 index 389dfcf0..00000000 --- a/.changes/unreleased/Added-20241204-122633.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: new method buildPodTemplateLabels to append additionalPodLabels for statefulset builders -time: 2024-12-04T12:26:33.654222+07:00 diff --git a/.changes/unreleased/Added-20241204-153550.yaml b/.changes/unreleased/Added-20241204-153550.yaml deleted file mode 100644 index a324b32b..00000000 --- a/.changes/unreleased/Added-20241204-153550.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: compatibility tests running automatically on each new tag -time: 2024-12-04T15:35:50.352507104+01:00 diff --git a/.changes/unreleased/Added-20241209-182500.yaml b/.changes/unreleased/Added-20241209-182500.yaml deleted file mode 100644 index 74088f43..00000000 --- a/.changes/unreleased/Added-20241209-182500.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: customize Database and Storage container securityContext -time: 2024-12-09T18:25:00.648464+01:00 diff --git a/.changes/unreleased/Added-20250104-143452.yaml b/.changes/unreleased/Added-20250104-143452.yaml deleted file mode 100644 index d70253c6..00000000 --- a/.changes/unreleased/Added-20250104-143452.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: field externalPort for grpc service to override --grpc-public-port arg -time: 2025-01-04T14:34:52.706824+08:00 diff --git a/.changes/unreleased/Added-20250124-141810.yaml b/.changes/unreleased/Added-20250124-141810.yaml deleted file mode 100644 index 58e21c15..00000000 --- a/.changes/unreleased/Added-20250124-141810.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: 'annotations overrides default secret name and key for arg --auth-token-file' -time: 2025-01-24T14:18:10.344319+08:00 diff --git a/.changes/unreleased/Added-20250127-130609.yaml b/.changes/unreleased/Added-20250127-130609.yaml deleted file mode 100644 index 16003da3..00000000 --- a/.changes/unreleased/Added-20250127-130609.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Added -body: field ObservedGeneration inside .status.conditions -time: 2025-01-27T13:06:09.845302+08:00 diff --git a/.changes/unreleased/Changed-20241118-222537.yaml b/.changes/unreleased/Changed-20241118-222537.yaml deleted file mode 100644 index 53d107cc..00000000 --- a/.changes/unreleased/Changed-20241118-222537.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Changed -body: up CONTROLLER_GEN_VERSION to 0.16.5 and ENVTEST_VERSION to release-0.17 -time: 2024-11-18T22:25:37.274092+03:00 diff --git a/.changes/unreleased/Changed-20241204-122659.yaml b/.changes/unreleased/Changed-20241204-122659.yaml deleted file mode 100644 index 0968be5c..00000000 --- a/.changes/unreleased/Changed-20241204-122659.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Changed -body: refactor package labels to separate methods buildLabels, buildSelectorLabels and buildeNodeSetLabels for each resource -time: 2024-12-04T12:26:59.096105+07:00 diff --git a/.changes/unreleased/Changed-20241204-122713.yaml b/.changes/unreleased/Changed-20241204-122713.yaml deleted file mode 100644 index 9bf0b3f9..00000000 --- a/.changes/unreleased/Changed-20241204-122713.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Changed -body: propagate labels ydb.tech/database-nodeset, ydb.tech/storage-nodeset and ydb.tech/remote-cluster with method makeCommonLabels between resource recasting -time: 2024-12-04T12:27:13.265234+07:00 diff --git a/.changes/unreleased/Fixed-20241113-214512.yaml b/.changes/unreleased/Fixed-20241113-214512.yaml deleted file mode 100644 index b5688449..00000000 --- a/.changes/unreleased/Fixed-20241113-214512.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: e2e tests and unit tests flapped because of the race between storage finalizers and uninstalling operator helm chart -time: 2024-11-13T21:45:12.19273022+01:00 diff --git a/.changes/unreleased/Fixed-20241129-213809.yaml b/.changes/unreleased/Fixed-20241129-213809.yaml deleted file mode 100644 index bb3a9eb1..00000000 --- a/.changes/unreleased/Fixed-20241129-213809.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: regenerate CRDs in upload-artifacts workflow (as opposed to manually) -time: 2024-11-29T21:38:09.848071991+01:00 diff --git a/.changes/unreleased/Fixed-20241204-122736.yaml b/.changes/unreleased/Fixed-20241204-122736.yaml deleted file mode 100644 index 4f4c6808..00000000 --- a/.changes/unreleased/Fixed-20241204-122736.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: additional kind worker to maintain affinity rules for blobstorage init job -time: 2024-12-04T12:27:36.97703+07:00 diff --git a/.changes/unreleased/Fixed-20250104-143747.yaml b/.changes/unreleased/Fixed-20250104-143747.yaml deleted file mode 100644 index 4a4439c7..00000000 --- a/.changes/unreleased/Fixed-20250104-143747.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: update the Makefile with the changes in GitHub CI -time: 2025-01-04T14:37:47.689565+08:00 diff --git a/.changes/unreleased/Fixed-20250124-141631.yaml b/.changes/unreleased/Fixed-20250124-141631.yaml deleted file mode 100644 index 31c864f9..00000000 --- a/.changes/unreleased/Fixed-20250124-141631.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: 'bug: missing error handler for arg --auth-token-file' -time: 2025-01-24T14:16:31.463111+08:00 diff --git a/.changes/unreleased/Fixed-20250127-125607.yaml b/.changes/unreleased/Fixed-20250127-125607.yaml deleted file mode 100644 index 59654796..00000000 --- a/.changes/unreleased/Fixed-20250127-125607.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: fix field resourceVersion inside .status.remoteResources.conditions -time: 2025-01-27T12:56:07.577721+08:00 diff --git a/.changes/unreleased/Fixed-20250127-141003.yaml b/.changes/unreleased/Fixed-20250127-141003.yaml deleted file mode 100644 index aa6c20f7..00000000 --- a/.changes/unreleased/Fixed-20250127-141003.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: panic when create object with .spec.pause is true -time: 2025-01-27T14:10:03.497565+08:00 diff --git a/.changes/unreleased/Fixed-20250129-134226.yaml b/.changes/unreleased/Fixed-20250129-134226.yaml deleted file mode 100644 index 2405bd52..00000000 --- a/.changes/unreleased/Fixed-20250129-134226.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: Passing additional secret volumes to blobstorage-init. The init container can now use them without issues. -time: 2025-01-29T13:42:26.145577+01:00 diff --git a/.changes/unreleased/Security-20241118-222433.yaml b/.changes/unreleased/Security-20241118-222433.yaml deleted file mode 100644 index af068092..00000000 --- a/.changes/unreleased/Security-20241118-222433.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Security -body: bump golang-jwt to v4.5.1 (by dependabot) -time: 2024-11-18T22:24:33.337464+03:00 diff --git a/.changes/unreleased/Security-20250127-170538.yaml b/.changes/unreleased/Security-20250127-170538.yaml deleted file mode 100644 index 219ea97a..00000000 --- a/.changes/unreleased/Security-20250127-170538.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Security -body: bump golang.org/x/net from 0.23.0 to 0.33.0 (by dependabot) -time: 2025-01-27T17:05:38.777767+08:00 diff --git a/.changes/v0.6.0.md b/.changes/v0.6.0.md new file mode 100644 index 00000000..aeffbf29 --- /dev/null +++ b/.changes/v0.6.0.md @@ -0,0 +1,27 @@ +## v0.6.0 - 2025-01-29 +### Added +* starting with this release, deploying to dockerhub (ydbplatform/ydb-kubernetes-operator) +* added the ability to create metadata announce for customize dns domain (default: cluster.local) +* new field additionalPodLabels for Storage and Database CRD +* new method buildPodTemplateLabels to append additionalPodLabels for statefulset builders +* compatibility tests running automatically on each new tag +* customize Database and Storage container securityContext +* field externalPort for grpc service to override --grpc-public-port arg +* annotations overrides default secret name and key for arg --auth-token-file +* field ObservedGeneration inside .status.conditions +### Changed +* up CONTROLLER_GEN_VERSION to 0.16.5 and ENVTEST_VERSION to release-0.17 +* refactor package labels to separate methods buildLabels, buildSelectorLabels and buildeNodeSetLabels for each resource +* propagate labels ydb.tech/database-nodeset, ydb.tech/storage-nodeset and ydb.tech/remote-cluster with method makeCommonLabels between resource recasting +### Fixed +* e2e tests and unit tests flapped because of the race between storage finalizers and uninstalling operator helm chart +* regenerate CRDs in upload-artifacts workflow (as opposed to manually) +* additional kind worker to maintain affinity rules for blobstorage init job +* update the Makefile with the changes in GitHub CI +* bug: missing error handler for arg --auth-token-file +* fix field resourceVersion inside .status.remoteResources.conditions +* panic when create object with .spec.pause is true +* Passing additional secret volumes to blobstorage-init. The init container can now use them without issues. +### Security +* bump golang-jwt to v4.5.1 (by dependabot) +* bump golang.org/x/net from 0.23.0 to 0.33.0 (by dependabot) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94e0e4cb..b7593b9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,34 @@ # Changelog +## v0.6.0 - 2025-01-29 +### Added +* starting with this release, deploying to dockerhub (ydbplatform/ydb-kubernetes-operator) +* added the ability to create metadata announce for customize dns domain (default: cluster.local) +* new field additionalPodLabels for Storage and Database CRD +* new method buildPodTemplateLabels to append additionalPodLabels for statefulset builders +* compatibility tests running automatically on each new tag +* customize Database and Storage container securityContext +* field externalPort for grpc service to override --grpc-public-port arg +* annotations overrides default secret name and key for arg --auth-token-file +* field ObservedGeneration inside .status.conditions +### Changed +* up CONTROLLER_GEN_VERSION to 0.16.5 and ENVTEST_VERSION to release-0.17 +* refactor package labels to separate methods buildLabels, buildSelectorLabels and buildeNodeSetLabels for each resource +* propagate labels ydb.tech/database-nodeset, ydb.tech/storage-nodeset and ydb.tech/remote-cluster with method makeCommonLabels between resource recasting +### Fixed +* e2e tests and unit tests flapped because of the race between storage finalizers and uninstalling operator helm chart +* regenerate CRDs in upload-artifacts workflow (as opposed to manually) +* additional kind worker to maintain affinity rules for blobstorage init job +* update the Makefile with the changes in GitHub CI +* bug: missing error handler for arg --auth-token-file +* fix field resourceVersion inside .status.remoteResources.conditions +* panic when create object with .spec.pause is true +* Passing additional secret volumes to blobstorage-init. The init container can now use them without issues. +### Security +* bump golang-jwt to v4.5.1 (by dependabot) +* bump golang.org/x/net from 0.23.0 to 0.33.0 (by dependabot) + ## v0.5.32 - 2024-11-05 ### Fixed * Chart.yaml version is bumped up automatically when a new release PR is created diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 297e7771..e80d4fe9 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.5.32" +version: "0.6.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.32" +appVersion: "0.6.0" From 84db0f332a49ebb61c899da9229506b658adc1da Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Thu, 30 Jan 2025 10:57:34 +0100 Subject: [PATCH 63/70] Fix AWS CLI <-> S3 compatibility (#290) --- .github/workflows/upload-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 030106fe..1f5a8191 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -36,7 +36,7 @@ jobs: - name: install-aws-cli uses: unfor19/install-aws-cli-action@v1 with: - version: 2 + version: "2.22.35" - name: initialize-aws-cli run: | aws configure set aws_access_key_id ${{ secrets.CI_PUBLIC_HELM_S3_KEY_IDENTIFIER }} From 5522cd11c5ecf4f9cdf338ab189d737848c177a4 Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Thu, 30 Jan 2025 11:18:36 +0100 Subject: [PATCH 64/70] Allow tag creation from job (#291) --- .github/workflows/upload-artifacts.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 1f5a8191..5e5376f7 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -8,6 +8,9 @@ on: - 'CHANGELOG.md' workflow_dispatch: +permissions: + contents: write + jobs: tag-and-release: runs-on: ubuntu-latest From 1d1153513cda55822203e4a8e80f520e826ca72e Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Thu, 30 Jan 2025 11:39:10 +0100 Subject: [PATCH 65/70] Allow dispatching `compatibility-tests` workflow from `upload-artifacts` (#292) --- .github/workflows/compatibility-tests.yaml | 8 +++++--- .github/workflows/tmp-workflow.yaml | 18 ++++++++++++++++++ .github/workflows/upload-artifacts.yml | 5 +++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/tmp-workflow.yaml diff --git a/.github/workflows/compatibility-tests.yaml b/.github/workflows/compatibility-tests.yaml index db7af57c..3114bcbc 100644 --- a/.github/workflows/compatibility-tests.yaml +++ b/.github/workflows/compatibility-tests.yaml @@ -1,10 +1,9 @@ name: compatibility-tests on: - push: - tags: - - '*' workflow_dispatch: + repository_dispatch: + types: [compatibility-tests] jobs: test-compatibility: @@ -56,6 +55,9 @@ jobs: PREVIOUS_VERSION="0.5.30" fi + echo "Current version is $NEW_VERSION" + echo "Will be tested for compatibility from $PREVIOUS_VERSION" + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV diff --git a/.github/workflows/tmp-workflow.yaml b/.github/workflows/tmp-workflow.yaml new file mode 100644 index 00000000..38f5cbab --- /dev/null +++ b/.github/workflows/tmp-workflow.yaml @@ -0,0 +1,18 @@ +name: tmp + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + tag-and-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: dispatch-compatibility-tests + uses: peter-evans/repository-dispatch@v3 + with: + event-type: compatibility-tests diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 5e5376f7..40da712e 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -131,3 +131,8 @@ jobs: tag_name: ${{ env.VERSION }} env: GITHUB_TOKEN: ${{ github.token }} + + - name: dispatch-compatibility-tests + uses: peter-evans/repository-dispatch@v3 + with: + event-type: compatibility-tests From cf0af29aa99220f4e97ff7a916618e25cf73fd8a Mon Sep 17 00:00:00 2001 From: Egor Tarasov Date: Thu, 30 Jan 2025 11:48:14 +0100 Subject: [PATCH 66/70] Cleanup compatibility test debug artifacts (#293) --- .github/workflows/compatibility-tests.yaml | 7 ------- .github/workflows/tmp-workflow.yaml | 18 ------------------ 2 files changed, 25 deletions(-) delete mode 100644 .github/workflows/tmp-workflow.yaml diff --git a/.github/workflows/compatibility-tests.yaml b/.github/workflows/compatibility-tests.yaml index 3114bcbc..931c0bcd 100644 --- a/.github/workflows/compatibility-tests.yaml +++ b/.github/workflows/compatibility-tests.yaml @@ -48,13 +48,6 @@ jobs: exit 1 fi - # remove after creating 0.6.0 tag. - # Basically, we are incompatible with 0.4, and while there is no 0.6 (and prev minor being 0.5), - # we will run compat tests from previous patch version - if [ "$PREVIOUS_VERSION" = "0.4.42" ]; then - PREVIOUS_VERSION="0.5.30" - fi - echo "Current version is $NEW_VERSION" echo "Will be tested for compatibility from $PREVIOUS_VERSION" diff --git a/.github/workflows/tmp-workflow.yaml b/.github/workflows/tmp-workflow.yaml deleted file mode 100644 index 38f5cbab..00000000 --- a/.github/workflows/tmp-workflow.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: tmp - -on: - workflow_dispatch: - -permissions: - contents: write - -jobs: - tag-and-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: dispatch-compatibility-tests - uses: peter-evans/repository-dispatch@v3 - with: - event-type: compatibility-tests From ed6c344f51d5926e1b815dd27c10287883fa07d9 Mon Sep 17 00:00:00 2001 From: Nikita Kozlovskii Date: Wed, 12 Feb 2025 10:14:26 +0100 Subject: [PATCH 67/70] fix blobstorage-init-job, fix passing interconnect volume (#294) * fix blobstorage-init-job, fix passing interconnect volume * add changie --- .../unreleased/Fixed-20250210-112112.yaml | 3 + internal/resources/storage_init_job.go | 69 +++++++++---------- 2 files changed, 35 insertions(+), 37 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250210-112112.yaml diff --git a/.changes/unreleased/Fixed-20250210-112112.yaml b/.changes/unreleased/Fixed-20250210-112112.yaml new file mode 100644 index 00000000..e1f24365 --- /dev/null +++ b/.changes/unreleased/Fixed-20250210-112112.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: fix passing interconnet TLS volume in blobstorage-init job +time: 2025-02-10T11:21:12.37515+01:00 diff --git a/internal/resources/storage_init_job.go b/internal/resources/storage_init_job.go index 4308e29b..51da7006 100644 --- a/internal/resources/storage_init_job.go +++ b/internal/resources/storage_init_job.go @@ -136,6 +136,10 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume { }, } + if b.Spec.Service.Interconnect.TLSConfiguration.Enabled { + volumes = append(volumes, buildTLSVolume(interconnectTLSVolumeName, b.Spec.Service.Interconnect.TLSConfiguration)) + } + if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumes = append(volumes, buildTLSVolume(GRPCTLSVolumeName, b.Spec.Service.GRPC.TLSConfiguration)) } @@ -222,16 +226,7 @@ func (b *StorageInitJobBuilder) buildInitJobContainer() corev1.Container { // to return container } -func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount { - volumeMounts := []corev1.VolumeMount{ - { - Name: configVolumeName, - ReadOnly: true, - MountPath: fmt.Sprintf("%s/%s", api.ConfigDir, api.ConfigFileName), - SubPath: api.ConfigFileName, - }, - } - +func (b *StorageInitJobBuilder) appendTLSVolumeMounts(volumeMounts []corev1.VolumeMount) []corev1.VolumeMount { if b.Spec.Service.GRPC.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: GRPCTLSVolumeName, @@ -240,12 +235,11 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount { }) } - if b.Spec.OperatorConnection != nil { - secretName := fmt.Sprintf(OperatorTokenSecretNameFormat, b.Storage.Name) + if b.Spec.Service.Interconnect.TLSConfiguration.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: operatorTokenVolumeName, + Name: interconnectTLSVolumeName, ReadOnly: true, - MountPath: fmt.Sprintf("%s/%s", wellKnownDirForAdditionalSecrets, secretName), + MountPath: interconnectTLSVolumeMountPath, }) } @@ -260,6 +254,29 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount { MountPath: systemCertsDir, }) } + return volumeMounts +} + +func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount { + volumeMounts := []corev1.VolumeMount{ + { + Name: configVolumeName, + ReadOnly: true, + MountPath: fmt.Sprintf("%s/%s", api.ConfigDir, api.ConfigFileName), + SubPath: api.ConfigFileName, + }, + } + + if b.Spec.OperatorConnection != nil { + secretName := fmt.Sprintf(OperatorTokenSecretNameFormat, b.Storage.Name) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: operatorTokenVolumeName, + ReadOnly: true, + MountPath: fmt.Sprintf("%s/%s", wellKnownDirForAdditionalSecrets, secretName), + }) + } + + volumeMounts = b.appendTLSVolumeMounts(volumeMounts) return volumeMounts } @@ -301,29 +318,7 @@ func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainer() corev1.Conta } func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainerVolumeMounts() []corev1.VolumeMount { - volumeMounts := []corev1.VolumeMount{} - - if b.AnyCertificatesAdded() { - volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: localCertsVolumeName, - MountPath: localCertsDir, - }) - - volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: systemCertsVolumeName, - MountPath: systemCertsDir, - }) - } - - if b.Spec.Service.GRPC.TLSConfiguration.Enabled { - volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: GRPCTLSVolumeName, - ReadOnly: true, - MountPath: grpcTLSVolumeMountPath, - }) - } - - return volumeMounts + return b.appendTLSVolumeMounts([]corev1.VolumeMount{}) } func (b *StorageInitJobBuilder) buildBlobStorageInitCommandArgs() ([]string, []string) { From 1ca6c032552880e6a893c45f39d38bacfa4b65af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:38:23 +0100 Subject: [PATCH 68/70] Release v0.6.1 (#295) Co-authored-by: nikitka <95808+nikitka@users.noreply.github.com> --- .changes/unreleased/Fixed-20250210-112112.yaml | 3 --- .changes/v0.6.1.md | 3 +++ CHANGELOG.md | 4 ++++ deploy/ydb-operator/Chart.yaml | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 .changes/unreleased/Fixed-20250210-112112.yaml create mode 100644 .changes/v0.6.1.md diff --git a/.changes/unreleased/Fixed-20250210-112112.yaml b/.changes/unreleased/Fixed-20250210-112112.yaml deleted file mode 100644 index e1f24365..00000000 --- a/.changes/unreleased/Fixed-20250210-112112.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: fix passing interconnet TLS volume in blobstorage-init job -time: 2025-02-10T11:21:12.37515+01:00 diff --git a/.changes/v0.6.1.md b/.changes/v0.6.1.md new file mode 100644 index 00000000..2f7a24f4 --- /dev/null +++ b/.changes/v0.6.1.md @@ -0,0 +1,3 @@ +## v0.6.1 - 2025-02-12 +### Fixed +* fix passing interconnet TLS volume in blobstorage-init job diff --git a/CHANGELOG.md b/CHANGELOG.md index b7593b9d..99daea0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## v0.6.1 - 2025-02-12 +### Fixed +* fix passing interconnet TLS volume in blobstorage-init job + ## v0.6.0 - 2025-01-29 ### Added * starting with this release, deploying to dockerhub (ydbplatform/ydb-kubernetes-operator) diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index e80d4fe9..504b463a 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.6.0" +version: "0.6.1" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.6.0" +appVersion: "0.6.1" From b2d3704bfd52aaef46773bd9a58ffbed05ebe835 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 24 Feb 2025 15:12:20 +0800 Subject: [PATCH 69/70] Fix prefix with POD_NAME in `--grpc-public-host` arg (#296) --- .../unreleased/Fixed-20250223-222850.yaml | 3 + .golangci.yml | 26 +----- .../controllers/database/controller_test.go | 85 +++++++++++++------ internal/resources/database_statefulset.go | 4 + 4 files changed, 66 insertions(+), 52 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250223-222850.yaml diff --git a/.changes/unreleased/Fixed-20250223-222850.yaml b/.changes/unreleased/Fixed-20250223-222850.yaml new file mode 100644 index 00000000..d951ee77 --- /dev/null +++ b/.changes/unreleased/Fixed-20250223-222850.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: 'bug: regression with pod name in grpc-public-host arg' +time: 2025-02-23T22:28:50.688471+08:00 diff --git a/.golangci.yml b/.golangci.yml index 1dc7fd9d..38c43fd7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,7 +35,8 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number print-issued-lines: true @@ -61,13 +62,6 @@ linters-settings: # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; # default is false: such cases aren't reported by default. check-blank: false - govet: - # report about shadowed variables - shadow: true - fieldalignment: true - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 gofmt: # simplify code: gofmt with `-s` option, true by default simplify: true @@ -85,9 +79,6 @@ linters-settings: - G101 - G115 - G601 # no longer actual since 1.22 - fieldalignment: - # print struct with more effective memory layout or not, false by default - suggest-new: true misspell: # Correct spellings using locale preferences for US or UK. # Default is to use a neutral variety of English. @@ -118,17 +109,7 @@ linters-settings: - name: empty-block - name: superfluous-else - name: unreachable-code - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false unparam: - # call graph construction algorithm (cha, rta). In general, use cha for libraries, - # and rta for programs with main packages. Default is cha. - algo: cha - # Inspect exported functions, default is false. Set to true if no external program/library imports your code. # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: # if it's called for subdir of a project it can't find external interfaces. All text editor integrations @@ -192,9 +173,6 @@ issues: # Default value for this option is true. exclude-use-default: true - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 diff --git a/internal/controllers/database/controller_test.go b/internal/controllers/database/controller_test.go index 467726a5..a36e0694 100644 --- a/internal/controllers/database/controller_test.go +++ b/internal/controllers/database/controller_test.go @@ -308,40 +308,47 @@ var _ = Describe("Database controller medium tests", func() { Expect(args).To(ContainElements([]string{"--grpc-public-address-v4", "--grpc-public-target-name-override"})) }) + checkContainerArg := func(expectedArgKey, expectedArgValue string) error { + foundStatefulSet := appsv1.StatefulSet{} + Eventually(func() error { + return k8sClient.Get(ctx, + types.NamespacedName{ + Name: testobjects.DatabaseName, + Namespace: testobjects.YdbNamespace, + }, + &foundStatefulSet, + ) + }, test.Timeout, test.Interval).Should(Succeed()) + podContainerArgs := foundStatefulSet.Spec.Template.Spec.Containers[0].Args + for idx, argKey := range podContainerArgs { + if argKey == expectedArgKey { + if podContainerArgs[idx+1] != expectedArgValue { + return fmt.Errorf( + "Found arg `%s` value %s does not match with expected: %s", + expectedArgKey, + podContainerArgs[idx+1], + expectedArgValue, + ) + } + } + } + return nil + } + It("Check externalPort GRPC Service field propagation", func() { By("Create test database") databaseSample = *testobjects.DefaultDatabase() + databaseSample.Spec.Service.GRPC.ExternalHost = fmt.Sprintf("%s.%s", testobjects.YdbNamespace, "k8s.external.net") Expect(k8sClient.Create(ctx, &databaseSample)).Should(Succeed()) - checkPublicPortArg := func(expectedGRPCPort string) error { - foundStatefulSet := appsv1.StatefulSet{} - Eventually(func() error { - return k8sClient.Get(ctx, - types.NamespacedName{ - Name: testobjects.DatabaseName, - Namespace: testobjects.YdbNamespace, - }, - &foundStatefulSet, - ) - }, test.Timeout, test.Interval).Should(Succeed()) - podContainerArgs := foundStatefulSet.Spec.Template.Spec.Containers[0].Args - for idx, argKey := range podContainerArgs { - if argKey == "--grpc-public-port" { - if podContainerArgs[idx+1] != expectedGRPCPort { - return fmt.Errorf( - "Found arg `--grpc-public-port` value %s does not match with expected: %s", - podContainerArgs[idx+1], - expectedGRPCPort, - ) - } - } - } - return nil - } - By("Check that args `--grpc-public-host` and `--grpc-public-port` propagated to StatefulSet pods...") Eventually( - checkPublicPortArg(fmt.Sprintf("%d", v1alpha1.GRPCPort)), + checkContainerArg("--grpc-public-host", fmt.Sprintf("%s.%s", "$(POD_NAME)", databaseSample.Spec.Service.GRPC.ExternalHost)), + test.Timeout, + test.Interval).ShouldNot(HaveOccurred()) + + Eventually( + checkContainerArg("--grpc-public-port", fmt.Sprintf("%d", v1alpha1.GRPCPort)), test.Timeout, test.Interval).ShouldNot(HaveOccurred()) @@ -384,7 +391,29 @@ var _ = Describe("Database controller medium tests", func() { By("Check that args `--grpc-public-port` was updated in StatefulSet...") Eventually( - checkPublicPortArg(fmt.Sprintf("%d", externalPort)), + checkContainerArg("--grpc-public-port", fmt.Sprintf("%d", externalPort)), + test.Timeout, + test.Interval).ShouldNot(HaveOccurred()) + }) + + It("Checking args propagation from annotation to StatefulSet", func() { + By("Check that Database with annotations was created...") + databaseSample = *testobjects.DefaultDatabase() + databaseSample.Annotations = map[string]string{ + v1alpha1.AnnotationGRPCPublicHost: fmt.Sprintf("%s.%s", testobjects.YdbNamespace, "k8s.external.net"), + v1alpha1.AnnotationGRPCPublicPort: fmt.Sprintf("%d", 30001), + } + Expect(k8sClient.Create(ctx, &databaseSample)).Should(Succeed()) + + By("Check that args `--grpc-public-host` propagated to StatefulSet pods...") + Eventually( + checkContainerArg("--grpc-public-host", fmt.Sprintf("%s.%s.%s", "$(POD_NAME)", testobjects.YdbNamespace, "k8s.external.net")), + test.Timeout, + test.Interval).ShouldNot(HaveOccurred()) + + By("Check that args `--grpc-public-port` propagated to StatefulSet pods...") + Eventually( + checkContainerArg("--grpc-public-port", fmt.Sprintf("%d", 30001)), test.Timeout, test.Interval).ShouldNot(HaveOccurred()) }) diff --git a/internal/resources/database_statefulset.go b/internal/resources/database_statefulset.go index a27f977b..fa04465b 100644 --- a/internal/resources/database_statefulset.go +++ b/internal/resources/database_statefulset.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "regexp" + "strings" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -657,6 +658,9 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) { if value, ok := b.ObjectMeta.Annotations[api.AnnotationGRPCPublicHost]; ok { publicHost = value } + if !(strings.HasPrefix(publicHost, "$(POD_NAME)") || strings.HasPrefix(publicHost, "$(NODE_NAME)")) { + publicHost = fmt.Sprintf("%s.%s", "$(POD_NAME)", publicHost) + } if b.Spec.Service.GRPC.IPDiscovery != nil && b.Spec.Service.GRPC.IPDiscovery.Enabled { targetNameOverride := b.Spec.Service.GRPC.IPDiscovery.TargetNameOverride From 3245f6f0ec475d5512be2a7dd34eef8a99ed5381 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 15:34:36 +0800 Subject: [PATCH 70/70] Release v0.6.2 (#298) Co-authored-by: kobzonega <122476665+kobzonega@users.noreply.github.com> --- .changes/unreleased/Fixed-20250223-222850.yaml | 3 --- .changes/v0.6.2.md | 3 +++ CHANGELOG.md | 4 ++++ deploy/ydb-operator/Chart.yaml | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 .changes/unreleased/Fixed-20250223-222850.yaml create mode 100644 .changes/v0.6.2.md diff --git a/.changes/unreleased/Fixed-20250223-222850.yaml b/.changes/unreleased/Fixed-20250223-222850.yaml deleted file mode 100644 index d951ee77..00000000 --- a/.changes/unreleased/Fixed-20250223-222850.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kind: Fixed -body: 'bug: regression with pod name in grpc-public-host arg' -time: 2025-02-23T22:28:50.688471+08:00 diff --git a/.changes/v0.6.2.md b/.changes/v0.6.2.md new file mode 100644 index 00000000..f7d29295 --- /dev/null +++ b/.changes/v0.6.2.md @@ -0,0 +1,3 @@ +## v0.6.2 - 2025-02-24 +### Fixed +* bug: regression with pod name in grpc-public-host arg diff --git a/CHANGELOG.md b/CHANGELOG.md index 99daea0c..b27a5f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## v0.6.2 - 2025-02-24 +### Fixed +* bug: regression with pod name in grpc-public-host arg + ## v0.6.1 - 2025-02-12 ### Fixed * fix passing interconnet TLS volume in blobstorage-init job diff --git a/deploy/ydb-operator/Chart.yaml b/deploy/ydb-operator/Chart.yaml index 504b463a..6bf8e4ed 100644 --- a/deploy/ydb-operator/Chart.yaml +++ b/deploy/ydb-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.6.1" +version: "0.6.2" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.6.1" +appVersion: "0.6.2"