From 5d19c684de5c1c73035f89d37552e126f31d0ef2 Mon Sep 17 00:00:00 2001 From: Rohmilchkaese Date: Thu, 23 Jul 2026 16:27:01 +0800 Subject: [PATCH 1/3] fix(helm): drop duplicate Tenant CRD from the chart crds/tenant.yaml and crds/tenant-crd.yaml were byte-identical copies of the same CustomResourceDefinition, and tracked_tenant_crds_match_generated_schema asserted the generated schema against both, which kept the two in lockstep rather than flagging the duplication. Helm renders every file in crds/, so installing the chart submits tenants.rustfs.com twice. Argo CD surfaces this as two resources sharing a name within one application. Keep crds/tenant-crd.yaml, which matches the policybinding-crd.yaml naming, and point the test at the two files it actually tracks. The PolicyBinding half of the rendered output had no assertion at all before. --- deploy/rustfs-operator/crds/tenant.yaml | 2657 ----------------------- src/lib.rs | 8 +- 2 files changed, 4 insertions(+), 2661 deletions(-) delete mode 100755 deploy/rustfs-operator/crds/tenant.yaml diff --git a/deploy/rustfs-operator/crds/tenant.yaml b/deploy/rustfs-operator/crds/tenant.yaml deleted file mode 100755 index 0a9de80..0000000 --- a/deploy/rustfs-operator/crds/tenant.yaml +++ /dev/null @@ -1,2657 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: tenants.rustfs.com -spec: - group: rustfs.com - names: - categories: [] - kind: Tenant - plural: tenants - shortNames: - - tenant - singular: tenant - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.currentState - name: State - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Auto-generated derived type for TenantSpec via `CustomResource` - properties: - spec: - properties: - buckets: - description: Buckets that should exist in the RustFS tenant. - items: - properties: - deletionPolicy: - enum: - - Retain - type: string - name: - maxLength: 63 - minLength: 3 - pattern: ^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$ - type: string - x-kubernetes-validations: - - message: bucket name must be a valid RustFS/S3 bucket name - rule: self != 'rustfs' && !self.matches('^(\\d+\\.){3}\\d+$') && !self.contains('..') && !self.contains('.-') && !self.contains('-.') - objectLock: - nullable: true - type: boolean - region: - nullable: true - type: string - required: - - name - type: object - maxItems: 1024 - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - containerSecurityContext: - description: |- - Override the default RustFS container SecurityContext for every Pool in this Tenant. - Pool-level values take precedence. - nullable: true - 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 - appArmorProfile: - description: appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of AppArmor profile will be applied. Valid options are: - Localhost - a profile pre-loaded on the node. - RuntimeDefault - the container runtime's default profile. - Unconfined - no AppArmor enforcement. - type: string - required: - - type - type: object - 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: - type: string - type: array - drop: - description: Removed capabilities - items: - 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 be set if type is "Localhost". Must NOT be set for any other type. - type: string - type: - 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. - 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. 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 - createServiceAccountRbac: - description: |- - Deprecated compatibility field. The operator never grants Kubernetes API permissions to - Tenant workloads. Configure a custom ServiceAccount and manage any required RBAC explicitly. - nullable: true - type: boolean - credsSecret: - description: |- - Optional reference to a Secret containing RustFS credentials. - The Secret must contain 'accesskey' and 'secretkey' keys (both required, minimum 8 characters each). - If not specified, credentials can be provided via environment variables in 'env'. - Priority: Secret credentials > Environment variables > RustFS built-in defaults. - For production use, always configure credentials via Secret or environment variables. - nullable: true - properties: - name: - description: 'Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - required: - - name - type: object - encryption: - description: |- - Encryption / KMS configuration for server-side encryption. - When enabled, the operator injects KMS environment variables and mounts - secrets into RustFS pods so the in-process `rustfs-kms` library is configured. - nullable: true - properties: - backend: - default: local - description: 'KMS backend: `local` or `vault`.' - enum: - - local - - vault - type: string - defaultKeyId: - description: Optional default SSE key id (`RUSTFS_KMS_DEFAULT_KEY_ID`). - nullable: true - type: string - enabled: - default: false - description: Enable server-side encryption. When `false`, all other fields are ignored. - type: boolean - kmsSecret: - description: Secret holding `vault-token` when using Vault. - nullable: true - properties: - name: - description: 'Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - required: - - name - type: object - local: - description: 'Local: optional key directory override.' - nullable: true - properties: - allowInsecureDevDefaults: - default: false - description: |- - Explicitly allow RustFS development-only insecure KMS defaults. - - When true, the operator sets `RUSTFS_KMS_ALLOW_INSECURE_DEV_DEFAULTS=true`, allowing - Local KMS to start without a master key and store key material as plaintext-dev-only. - Do not use this in production. - type: boolean - keyDirectory: - description: |- - Absolute directory for KMS key files. - - Must be in a subdirectory under a RustFS data PVC mount. Defaults to the first data PVC mount - under `persistence.path`, for example `/data/rustfs0/.kms-keys`. - nullable: true - type: string - masterKeySecretRef: - description: |- - Secret key selector for `RUSTFS_KMS_LOCAL_MASTER_KEY`. - - Required for Local KMS unless `allowInsecureDevDefaults` is explicitly set to `true`. - The referenced Secret key should contain the local master key string used to encrypt - Local KMS key files at rest. - nullable: true - properties: - key: - description: Secret data key containing the local master key string. - minLength: 1 - type: string - name: - description: Secret name in the Tenant namespace. - minLength: 1 - type: string - required: - - key - - name - type: object - type: object - vault: - description: 'Vault: HTTP(S) endpoint (required when `backend: vault`).' - nullable: true - properties: - endpoint: - description: Vault server URL (e.g. `https://vault.example.com:8200`). - type: string - required: - - endpoint - type: object - type: object - x-kubernetes-validations: - - message: Local KMS requires local.masterKeySecretRef unless local.allowInsecureDevDefaults is true - rule: '!self.enabled || self.backend != ''local'' || (has(self.local) && (has(self.local.masterKeySecretRef) || (has(self.local.allowInsecureDevDefaults) && self.local.allowInsecureDevDefaults == true)))' - env: - description: |- - Additional RustFS container environment variables. - - `RUSTFS_KMS_*` is reserved; configure KMS through `spec.encryption`. - items: - description: EnvVar represents an environment variable present in a Container. - properties: - name: - description: Name of the environment variable. Must be 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 "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - - name - type: object - 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.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - 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.' - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - 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. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. 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 defined - type: boolean - required: - - key - - name - type: object - type: object - required: - - name - type: object - type: array - image: - nullable: true - type: string - imagePullPolicy: - description: |- - Image pull policy for containers. - - Always: Always pull the image - - Never: Never pull the image - - IfNotPresent: Pull the image if not present locally (default) - - https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy - enum: - - Always - - Never - - IfNotPresent - - null - nullable: true - type: string - imagePullSecret: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - nullable: true - properties: - name: - description: 'Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - required: - - name - type: object - lifecycle: - description: Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted. - nullable: true - 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' - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name. 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 - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - sleep: - description: Sleep represents the duration that the container should sleep before being terminated. - properties: - seconds: - description: Seconds is the number of seconds to sleep. - format: int64 - type: integer - required: - - seconds - 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. - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - 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' - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - items: - type: string - type: array - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - properties: - name: - description: The header field name. 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 - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - required: - - port - type: object - sleep: - description: Sleep represents the duration that the container should sleep before being terminated. - properties: - seconds: - description: Seconds is the number of seconds to sleep. - format: int64 - type: integer - required: - - seconds - 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. - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - 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 - type: object - logging: - description: |- - Logging configuration for RustFS - - Controls how RustFS outputs logs. Defaults to stdout (cloud-native best practice). - Can also configure emptyDir (temporary) or persistent (PVC-backed) logging. - nullable: true - properties: - mode: - default: stdout - description: |- - Logging mode: stdout, emptyDir, or persistent - - - stdout: Output logs to stdout/stderr (default, recommended for cloud-native) - - emptyDir: Write logs to an emptyDir volume (temporary, lost on Pod restart) - - persistent: Write logs to a PersistentVolumeClaim (persisted across restarts) - enum: - - stdout - - emptydir - - persistent - type: string - mountPath: - description: |- - Custom mount path for log directory - Defaults to /logs if not specified - nullable: true - type: string - storageClass: - description: |- - Storage class for persistent logs (only used when mode=persistent) - If not specified, uses the cluster's default StorageClass - nullable: true - type: string - storageSize: - description: |- - Storage size for persistent logs (only used when mode=persistent) - Defaults to 5Gi if not specified - nullable: true - type: string - type: object - mountPath: - default: /data - nullable: true - type: string - podDeletionPolicyWhenNodeIsDown: - description: |- - Controls how the operator handles Pods when the node hosting them is down (NotReady/Unknown). - - Typical use-case: a StatefulSet Pod gets stuck in Terminating when the node goes down. - Setting this to `ForceDelete` allows the operator to force delete the Pod object so the - StatefulSet controller can recreate it elsewhere. - Force deletion requires the Node object to be deleted or marked with an effective - `node.kubernetes.io/out-of-service` taint that the target Pod does not tolerate. - Before using force policies, operators must confirm the node is powered off or - otherwise isolated; deleting the Node object is treated as that operational assertion. - - Values: DoNothing | Delete | ForceDelete | DeleteStatefulSetPod | DeleteDeploymentPod | DeleteBothStatefulSetAndDeploymentPod - enum: - - DoNothing - - Delete - - ForceDelete - - DeleteStatefulSetPod - - DeleteDeploymentPod - - DeleteBothStatefulSetAndDeploymentPod - - null - nullable: true - type: string - podManagementPolicy: - description: |- - Pod management policy for StatefulSets - - OrderedReady: Respect the ordering guarantees demonstrated - - Parallel: launch or terminate all Pods in parallel, and not to wait for Pods to become Running - and Ready or completely terminated prior to launching or terminating another Pod - - https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy - enum: - - OrderedReady - - Parallel - - null - nullable: true - type: string - policies: - description: Canned policies that should be applied to the RustFS tenant. - items: - properties: - deletionPolicy: - enum: - - Retain - type: string - document: - properties: - configMapKeyRef: - properties: - key: - maxLength: 253 - minLength: 1 - type: string - name: - maxLength: 253 - minLength: 1 - type: string - required: - - key - - name - type: object - required: - - configMapKeyRef - type: object - name: - maxLength: 253 - minLength: 1 - pattern: ^\S+$ - type: string - required: - - document - - name - type: object - maxItems: 256 - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - poolLifecycle: - description: Explicit lifecycle requests for pool decommissioning. - nullable: true - properties: - decommissionRequests: - items: - properties: - action: - enum: - - Start - - Cancel - type: string - cancelRequestedAt: - nullable: true - type: string - poolName: - maxLength: 63 - minLength: 1 - type: string - reason: - maxLength: 1024 - nullable: true - type: string - requestId: - maxLength: 128 - minLength: 1 - type: string - requestedAt: - nullable: true - type: string - required: - - action - - poolName - - requestId - type: object - maxItems: 32 - type: array - x-kubernetes-list-map-keys: - - poolName - x-kubernetes-list-type: map - pvcRetentionPolicy: - enum: - - Retain - type: string - type: object - pools: - items: - description: |- - Kubernetes scheduling and placement configuration for pools. - Groups related scheduling fields for better code organization. - Uses #[serde(flatten)] to maintain flat YAML structure. - properties: - affinity: - description: Affinity is a group of affinity scheduling rules. - nullable: true - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. - items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements by node's fields. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - mismatchLabelKeys: - description: MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - mismatchLabelKeys: - description: MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - mismatchLabelKeys: - description: MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - mismatchLabelKeys: - description: MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - items: - type: string - type: array - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - containerSecurityContext: - description: |- - RustFS container SecurityContext overrides for this Pool. - Values are merged over Tenant-level container settings and operator defaults. - nullable: true - 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 - appArmorProfile: - description: appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of AppArmor profile will be applied. Valid options are: - Localhost - a profile pre-loaded on the node. - RuntimeDefault - the container runtime's default profile. - Unconfined - no AppArmor enforcement. - type: string - required: - - type - type: object - 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: - type: string - type: array - drop: - description: Removed capabilities - items: - 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 be set if type is "Localhost". Must NOT be set for any other type. - type: string - type: - 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. - 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. 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 - name: - maxLength: 63 - minLength: 1 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - type: string - nodeSelector: - additionalProperties: - type: string - description: NodeSelector is a selector which must be true for the pod to fit on a node. - nullable: true - type: object - persistence: - properties: - annotations: - additionalProperties: - type: string - nullable: true - type: object - labels: - additionalProperties: - type: string - nullable: true - type: object - path: - nullable: true - type: string - x-kubernetes-validations: - - message: path must be not empty when specified - rule: self != '' - volumeClaimTemplate: - description: PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes - nullable: true - 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' - 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.' - 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. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - 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. - 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. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - 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. - 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' - properties: - limits: - additionalProperties: - description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation." - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation." - 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. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - selector: - description: selector is a label query over volumes to consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - 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' - type: string - volumeAttributesClassName: - description: 'volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it''s not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.' - 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. - type: string - volumeName: - description: volumeName is the binding reference to the PersistentVolume backing this claim. - type: string - type: object - volumesPerServer: - format: int32 - type: integer - x-kubernetes-validations: - - message: volumesPerServer must be greater than 0 - rule: self > 0 - - message: volumesPerServer is immutable - rule: self == oldSelf - required: - - volumesPerServer - type: object - priorityClassName: - description: PriorityClassName indicates the pod's priority. Overrides tenant-level priority class. - nullable: true - type: string - resources: - description: Resources describes the compute resource requirements for the pool's containers. - nullable: true - properties: - claims: - 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. - type: string - required: - - name - type: object - type: array - limits: - additionalProperties: - description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation." - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation." - 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. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - securityContext: - description: |- - Pod SecurityContext overrides for this Pool. - Values override Tenant-level Pod SecurityContext settings. - nullable: true - properties: - fsGroup: - description: GID applied to all volumes mounted in the Pod (`fsGroup`). - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - runAsGroup: - description: GID to run the container process as. - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - runAsNonRoot: - description: Enforce non-root execution. - nullable: true - type: boolean - runAsUser: - description: UID to run the container process as. - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - seccompProfile: - description: Seccomp profile applied to all containers in the Pod. - nullable: true - 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 be set if type is "Localhost". Must NOT be set for any other type. - type: string - type: - 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 - type: object - servers: - format: int32 - type: integer - x-kubernetes-validations: - - message: servers must be greater than 0 - rule: self > 0 - - message: servers is immutable - rule: self == oldSelf - tolerations: - description: Tolerations allow pods to schedule onto nodes with matching taints. - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - nullable: true - type: array - topologySpreadConstraints: - description: TopologySpreadConstraints describes how pods should spread across topology domains. - 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. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - 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. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector. - - This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default). - items: - type: string - type: array - 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.' - 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. - - 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. - 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. - - 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. - - 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. - 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. - type: string - required: - - maxSkew - - topologyKey - - whenUnsatisfiable - type: object - nullable: true - type: array - required: - - name - - persistence - - servers - type: object - maxItems: 32 - minItems: 1 - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - priorityClassName: - nullable: true - type: string - rpcSecret: - description: |- - Optional Secret key selector for RustFS internode RPC authentication. - - When configured, the operator maps this key to `RUSTFS_RPC_SECRET` for every - RustFS Pod. Keep it stable while rotating `credsSecret`. When omitted, the - operator does not set `RUSTFS_RPC_SECRET`; RustFS resolves it from its own - credential configuration. Secret updates enqueue every Tenant that references - the Secret, so one externally managed Secret can be shared by multiple Tenants. - nullable: true - properties: - key: - minLength: 1 - type: string - name: - minLength: 1 - type: string - required: - - key - - name - type: object - scheduler: - nullable: true - type: string - securityContext: - description: |- - Override the default Pod SecurityContext for every Pool in this Tenant. - Pool-level values take precedence. - nullable: true - properties: - fsGroup: - description: GID applied to all volumes mounted in the Pod (`fsGroup`). - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - runAsGroup: - description: GID to run the container process as. - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - runAsNonRoot: - description: Enforce non-root execution. - nullable: true - type: boolean - runAsUser: - description: UID to run the container process as. - format: int64 - maximum: 2147483647.0 - minimum: 0.0 - nullable: true - type: integer - seccompProfile: - description: Seccomp profile applied to all containers in the Pod. - nullable: true - 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 be set if type is "Localhost". Must NOT be set for any other type. - type: string - type: - 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 - type: object - serviceAccountName: - nullable: true - type: string - tls: - nullable: true - properties: - caTrust: - nullable: true - properties: - caSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - clientCaSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - source: - default: CertificateSecretCa - enum: - - CertificateSecretCa - - SecretRef - - SystemCa - type: string - trustLeafCertificateAsCa: - default: false - type: boolean - trustSystemCa: - default: false - type: boolean - type: object - certManager: - nullable: true - properties: - caTrust: - nullable: true - properties: - caSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - clientCaSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - source: - default: CertificateSecretCa - enum: - - CertificateSecretCa - - SecretRef - - SystemCa - type: string - trustLeafCertificateAsCa: - default: false - type: boolean - trustSystemCa: - default: false - type: boolean - type: object - certificateName: - nullable: true - type: string - commonName: - nullable: true - type: string - dnsNames: - items: - type: string - type: array - duration: - nullable: true - type: string - includeGeneratedDnsNames: - nullable: true - type: boolean - issuerRef: - nullable: true - properties: - group: - default: cert-manager.io - type: string - kind: - default: Issuer - type: string - name: - type: string - required: - - name - type: object - manageCertificate: - default: false - type: boolean - privateKey: - nullable: true - properties: - algorithm: - nullable: true - type: string - encoding: - nullable: true - type: string - rotationPolicy: - nullable: true - type: string - size: - format: int32 - nullable: true - type: integer - type: object - renewBefore: - nullable: true - type: string - secretName: - nullable: true - type: string - secretType: - nullable: true - type: string - usages: - items: - type: string - type: array - type: object - certificates: - items: - properties: - certManager: - properties: - caTrust: - nullable: true - properties: - caSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - clientCaSecretRef: - nullable: true - properties: - key: - default: ca.crt - type: string - name: - type: string - required: - - name - type: object - source: - default: CertificateSecretCa - enum: - - CertificateSecretCa - - SecretRef - - SystemCa - type: string - trustLeafCertificateAsCa: - default: false - type: boolean - trustSystemCa: - default: false - type: boolean - type: object - certificateName: - nullable: true - type: string - commonName: - nullable: true - type: string - dnsNames: - items: - type: string - type: array - duration: - nullable: true - type: string - includeGeneratedDnsNames: - nullable: true - type: boolean - issuerRef: - nullable: true - properties: - group: - default: cert-manager.io - type: string - kind: - default: Issuer - type: string - name: - type: string - required: - - name - type: object - manageCertificate: - default: false - type: boolean - privateKey: - nullable: true - properties: - algorithm: - nullable: true - type: string - encoding: - nullable: true - type: string - rotationPolicy: - nullable: true - type: string - size: - format: int32 - nullable: true - type: integer - type: object - renewBefore: - nullable: true - type: string - secretName: - nullable: true - type: string - secretType: - nullable: true - type: string - usages: - items: - type: string - type: array - type: object - default: - default: false - type: boolean - hosts: - items: - type: string - type: array - name: - type: string - required: - - certManager - - name - type: object - type: array - enableInternodeHttps: - default: false - type: boolean - mode: - default: disabled - enum: - - disabled - - external - - certManager - type: string - mountPath: - default: /var/run/rustfs/tls - type: string - requireSanMatch: - default: true - type: boolean - rotationStrategy: - default: Rollout - enum: - - Rollout - - HotReload - type: string - type: object - users: - description: Regular users that should exist in the RustFS tenant. - items: - properties: - credsSecret: - description: Optional credentials Secret reference. Defaults to a Secret named after the user. - nullable: true - properties: - name: - maxLength: 253 - minLength: 1 - type: string - required: - - name - type: object - deletionPolicy: - enum: - - Retain - type: string - name: - maxLength: 253 - minLength: 1 - pattern: ^\S+$ - type: string - policies: - description: Canned policies to map directly to this user. - items: - maxLength: 253 - minLength: 1 - pattern: ^\S+$ - type: string - maxItems: 64 - minItems: 1 - type: array - x-kubernetes-list-type: set - required: - - name - type: object - maxItems: 256 - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - x-kubernetes-validations: - - message: user policies must contain at least one policy - rule: self.all(x, has(x.policies) && x.policies.size() > 0) - - message: user credential Secret references must be unique - rule: 'self.all(x, self.exists_one(y, (has(x.credsSecret) ? x.credsSecret.name : x.name) == (has(y.credsSecret) ? y.credsSecret.name : y.name)))' - required: - - pools - type: object - status: - nullable: true - properties: - availableReplicas: - format: int32 - type: integer - certificates: - properties: - tls: - nullable: true - properties: - caSecretRef: - nullable: true - properties: - key: - nullable: true - type: string - name: - type: string - resourceVersion: - nullable: true - type: string - required: - - name - type: object - certificateRef: - nullable: true - properties: - apiVersion: - type: string - kind: - type: string - name: - type: string - observedGeneration: - format: int64 - nullable: true - type: integer - ready: - nullable: true - type: boolean - reason: - nullable: true - type: string - required: - - apiVersion - - kind - - name - type: object - certificates: - items: - properties: - certificateRef: - nullable: true - properties: - apiVersion: - type: string - kind: - type: string - name: - type: string - observedGeneration: - format: int64 - nullable: true - type: integer - ready: - nullable: true - type: boolean - reason: - nullable: true - type: string - required: - - apiVersion - - kind - - name - type: object - default: - default: false - type: boolean - dnsNames: - items: - type: string - type: array - hosts: - items: - type: string - type: array - managedCertificate: - nullable: true - type: boolean - name: - type: string - serverSecretRef: - properties: - key: - nullable: true - type: string - name: - type: string - resourceVersion: - nullable: true - type: string - required: - - name - type: object - required: - - name - - serverSecretRef - type: object - type: array - clientCaSecretRef: - nullable: true - properties: - key: - nullable: true - type: string - name: - type: string - resourceVersion: - nullable: true - type: string - required: - - name - type: object - dnsNames: - items: - type: string - type: array - expiresInSeconds: - format: int64 - nullable: true - type: integer - ipAddresses: - items: - type: string - type: array - lastErrorMessage: - nullable: true - type: string - lastErrorReason: - nullable: true - type: string - lastRolloutTriggerTime: - nullable: true - type: string - lastValidatedTime: - nullable: true - type: string - managedCertificate: - nullable: true - type: boolean - mode: - type: string - mountPath: - nullable: true - type: string - notAfter: - nullable: true - type: string - notBefore: - nullable: true - type: string - observedHash: - nullable: true - type: string - ready: - type: boolean - rotationStrategy: - nullable: true - type: string - sanMatched: - nullable: true - type: boolean - serverSecretRef: - nullable: true - properties: - key: - nullable: true - type: string - name: - type: string - resourceVersion: - nullable: true - type: string - required: - - name - type: object - trustSource: - nullable: true - type: string - required: - - mode - - ready - type: object - type: object - conditions: - description: Kubernetes standard conditions - items: - description: Kubernetes standard condition for Tenant resources - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status to another - nullable: true - type: string - message: - description: Human-readable message indicating details about the transition - type: string - observedGeneration: - description: The generation of the Tenant resource that this condition reflects - format: int64 - nullable: true - type: integer - reason: - description: One-word CamelCase reason for the condition's last transition - type: string - status: - description: Status of the condition (True, False, Unknown) - type: string - type: - description: |- - Type of condition (Ready, Reconciling, Degraded, SpecValid, CredentialsReady, KmsReady, - TlsReady, PoolsReady, WorkloadsReady, ProvisioningReady) - type: string - required: - - message - - reason - - status - - type - type: object - type: array - currentState: - type: string - observedGeneration: - description: The generation observed by the operator - format: int64 - nullable: true - type: integer - pools: - items: - properties: - currentReplicas: - description: Number of pods with current revision - format: int32 - nullable: true - type: integer - currentRevision: - description: Current revision hash of the StatefulSet - nullable: true - type: string - decommission: - description: Decommission progress and cleanup status for this pool. - nullable: true - properties: - cleanup: - nullable: true - properties: - pvcRetentionPolicy: - nullable: true - type: string - state: - enum: - - Pending - - StatefulSetDeleting - - PvcRetained - type: string - statefulSetDeletedAt: - nullable: true - type: string - required: - - state - type: object - completedAt: - nullable: true - type: string - endpointSetHash: - nullable: true - type: string - lastError: - nullable: true - properties: - message: - nullable: true - type: string - reason: - nullable: true - type: string - type: object - lastPollTime: - nullable: true - type: string - phase: - enum: - - Pending - - Running - - Complete - - Canceled - - Failed - - null - nullable: true - type: string - progress: - nullable: true - properties: - bytesFailed: - format: int64 - nullable: true - type: integer - bytesMigrated: - format: int64 - nullable: true - type: integer - objectsFailed: - format: int64 - nullable: true - type: integer - objectsMigrated: - format: int64 - nullable: true - type: integer - type: object - requestId: - nullable: true - type: string - rustfsPoolId: - nullable: true - type: string - startedAt: - nullable: true - type: string - type: object - lastUpdateTime: - description: Last time the pool status was updated - nullable: true - type: string - lifecycleState: - description: Lifecycle state of the pool, separate from StatefulSet rollout state. - enum: - - Active - - Decommissioning - - Decommissioned - - DecommissionCanceled - - DecommissionFailed - - null - nullable: true - type: string - name: - description: Pool name from Tenant spec. Optional for backward compatibility with older status. - nullable: true - type: string - readyReplicas: - description: Number of pods with Ready condition - format: int32 - nullable: true - type: integer - replicas: - description: Total number of non-terminated pods targeted by this pool's StatefulSet - format: int32 - nullable: true - type: integer - ssName: - description: Name of the StatefulSet for this pool - type: string - state: - description: Current state of the pool - type: string - updateRevision: - description: Update revision hash of the StatefulSet (different from current during rollout) - nullable: true - type: string - updatedReplicas: - description: Number of pods with updated revision - format: int32 - nullable: true - type: integer - workloadState: - description: Workload rollout state of this pool. Mirrors `state` for compatibility. - nullable: true - type: string - required: - - ssName - - state - type: object - type: array - provisioning: - properties: - buckets: - items: - properties: - desiredHash: - nullable: true - type: string - lastAppliedAccessKeyHash: - nullable: true - type: string - lastAppliedGeneration: - format: int64 - nullable: true - type: integer - lastAppliedHash: - nullable: true - type: string - lastTransitionTime: - nullable: true - type: string - message: - nullable: true - type: string - name: - type: string - objectLock: - nullable: true - type: boolean - observedSecretName: - nullable: true - type: string - observedSecretResourceVersion: - nullable: true - type: string - policies: - items: - type: string - type: array - reason: - type: string - region: - nullable: true - type: string - state: - type: string - required: - - name - - reason - - state - type: object - type: array - observedGeneration: - format: int64 - nullable: true - type: integer - phase: - enum: - - Pending - - Ready - - Failed - - null - nullable: true - type: string - policies: - items: - properties: - desiredHash: - nullable: true - type: string - lastAppliedAccessKeyHash: - nullable: true - type: string - lastAppliedGeneration: - format: int64 - nullable: true - type: integer - lastAppliedHash: - nullable: true - type: string - lastTransitionTime: - nullable: true - type: string - message: - nullable: true - type: string - name: - type: string - objectLock: - nullable: true - type: boolean - observedSecretName: - nullable: true - type: string - observedSecretResourceVersion: - nullable: true - type: string - policies: - items: - type: string - type: array - reason: - type: string - region: - nullable: true - type: string - state: - type: string - required: - - name - - reason - - state - type: object - type: array - users: - items: - properties: - desiredHash: - nullable: true - type: string - lastAppliedAccessKeyHash: - nullable: true - type: string - lastAppliedGeneration: - format: int64 - nullable: true - type: integer - lastAppliedHash: - nullable: true - type: string - lastTransitionTime: - nullable: true - type: string - message: - nullable: true - type: string - name: - type: string - objectLock: - nullable: true - type: boolean - observedSecretName: - nullable: true - type: string - observedSecretResourceVersion: - nullable: true - type: string - policies: - items: - type: string - type: array - reason: - type: string - region: - nullable: true - type: string - state: - type: string - required: - - name - - reason - - state - type: object - type: array - type: object - required: - - availableReplicas - - currentState - - pools - type: object - required: - - spec - title: Tenant - type: object - served: true - storage: true - subresources: - status: {} diff --git a/src/lib.rs b/src/lib.rs index 39e3eb0..b65886f 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -1623,17 +1623,17 @@ mod controller_watch_tests { #[test] fn tracked_tenant_crds_match_generated_schema() { let yaml = render_crds_yaml().expect("CRDs render to YAML"); - let (tenant, _) = yaml + let (tenant, policy_binding) = yaml .split_once("---\n") .expect("Tenant and PolicyBinding CRDs should be separated"); assert_eq!( tenant, - include_str!("../deploy/rustfs-operator/crds/tenant.yaml") + include_str!("../deploy/rustfs-operator/crds/tenant-crd.yaml") ); assert_eq!( - tenant, - include_str!("../deploy/rustfs-operator/crds/tenant-crd.yaml") + policy_binding, + include_str!("../deploy/rustfs-operator/crds/policybinding-crd.yaml") ); } From b83b6295b1dd935c74adcfb2404d656fde75f72c Mon Sep 17 00:00:00 2001 From: Rohmilchkaese Date: Thu, 23 Jul 2026 16:27:50 +0800 Subject: [PATCH 2/3] fix(crd): omit empty categories from generated CRDs kube-rs derives names.categories as Some(vec![]) for types that declare no category attribute, so the generated CRDs ship `categories: []`. The API server prunes empty arrays, so the stored object carries no categories key at all. Tools that compare a rendered manifest against the live object then diff a desired [] against an absent field and report the CRD as permanently drifted. On Argo CD the sync itself reports 'successfully synced (all tasks run)' and the application immediately reads OutOfSync again, while kubectl diff against the same cluster is clean - which makes it awkward to track down. Normalize an empty categories list to None before serializing, and regenerate the tracked CRDs. Adds a regression test asserting the rendered CRDs carry no categories key, and one asserting a populated list is left untouched. --- .../crds/policybinding-crd.yaml | 1 - deploy/rustfs-operator/crds/tenant-crd.yaml | 1 - src/lib.rs | 56 ++++++++++++++++++- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/deploy/rustfs-operator/crds/policybinding-crd.yaml b/deploy/rustfs-operator/crds/policybinding-crd.yaml index bbb5bd6..c4a7dbf 100644 --- a/deploy/rustfs-operator/crds/policybinding-crd.yaml +++ b/deploy/rustfs-operator/crds/policybinding-crd.yaml @@ -5,7 +5,6 @@ metadata: spec: group: sts.rustfs.com names: - categories: [] kind: PolicyBinding plural: policybindings shortNames: diff --git a/deploy/rustfs-operator/crds/tenant-crd.yaml b/deploy/rustfs-operator/crds/tenant-crd.yaml index 0a9de80..e8aab6b 100644 --- a/deploy/rustfs-operator/crds/tenant-crd.yaml +++ b/deploy/rustfs-operator/crds/tenant-crd.yaml @@ -5,7 +5,6 @@ metadata: spec: group: rustfs.com names: - categories: [] kind: Tenant plural: tenants shortNames: diff --git a/src/lib.rs b/src/lib.rs index b65886f..50453ad 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,6 +30,7 @@ use hyper_util::service::TowerToHyperService; use k8s_openapi::api::apps::v1 as appsv1; use k8s_openapi::api::core::v1 as corev1; use k8s_openapi::api::rbac::v1 as rbacv1; +use k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::CustomResourceDefinition; use k8s_openapi::apimachinery::pkg::apis::meta::v1 as metav1; use kube::core::{ ApiResource, DynamicObject, GroupVersionKind, PartialObjectMeta, PartialObjectMetaExt, @@ -975,9 +976,34 @@ fn deduplicate_tenant_refs(refs: Vec>) -> Vec Result { - let tenant = serde_yaml_ng::to_string(&Tenant::crd())?; - let policy_binding = serde_yaml_ng::to_string(&PolicyBinding::crd())?; + let mut tenant_crd = Tenant::crd(); + normalize_crd(&mut tenant_crd); + let mut policy_binding_crd = PolicyBinding::crd(); + normalize_crd(&mut policy_binding_crd); + + let tenant = serde_yaml_ng::to_string(&tenant_crd)?; + let policy_binding = serde_yaml_ng::to_string(&policy_binding_crd)?; Ok(format!("{tenant}---\n{policy_binding}")) } @@ -1020,6 +1046,32 @@ mod controller_watch_tests { assert_eq!(resource.plural, "certificates"); } + #[test] + fn rendered_crds_omit_empty_categories() { + let yaml = render_crds_yaml().expect("CRDs render"); + + // The API server prunes empty arrays, so emitting `categories: []` leaves + // GitOps tooling diffing a desired [] against an absent field forever. + assert!( + !yaml.contains("categories:"), + "rendered CRDs must not carry an empty categories list:\n{yaml}" + ); + } + + #[test] + fn normalize_crd_keeps_populated_categories() { + let mut crd = Tenant::crd(); + crd.spec.names.categories = Some(vec!["storage".to_owned()]); + + normalize_crd(&mut crd); + + assert_eq!( + crd.spec.names.categories, + Some(vec!["storage".to_owned()]), + "normalization must only drop empty category lists" + ); + } + #[tokio::test] async fn tenant_trigger_continues_after_an_applied_tenant_is_deleted() { let index = Arc::new(tenant_reference_index::TenantReferenceIndex::default()); From 39f1120153c314e083cf4d98adbdb7bc0712e25d Mon Sep 17 00:00:00 2001 From: Rohmilchkaese Date: Thu, 23 Jul 2026 16:46:43 +0800 Subject: [PATCH 3/3] docs: point CRD upgrade commands at tenant-crd.yaml The upgrade instructions applied deploy/rustfs-operator/crds/tenant.yaml, which this branch removes as a duplicate. Anyone following them would hit a missing path before the Tenant CRD was applied. Covers the chart README and both language versions of the operator user guide. The remaining tenant.yaml references are examples/ files and a tutorial-local manifest, which are unaffected. --- deploy/rustfs-operator/README.md | 2 +- docs/operator-user-guide.md | 2 +- docs/operator-user-guide.zh-CN.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/rustfs-operator/README.md b/deploy/rustfs-operator/README.md index 9d3cc8f..b8eb386 100755 --- a/deploy/rustfs-operator/README.md +++ b/deploy/rustfs-operator/README.md @@ -339,7 +339,7 @@ To upgrade the operator: ```bash kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ - -f deploy/rustfs-operator/crds/tenant.yaml + -f deploy/rustfs-operator/crds/tenant-crd.yaml kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ -f deploy/rustfs-operator/crds/policybinding-crd.yaml diff --git a/docs/operator-user-guide.md b/docs/operator-user-guide.md index 40fa796..70525b8 100644 --- a/docs/operator-user-guide.md +++ b/docs/operator-user-guide.md @@ -94,7 +94,7 @@ Upgrade an existing installation: # Helm does not upgrade CRDs stored in a chart's crds/ directory. kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ - -f deploy/rustfs-operator/crds/tenant.yaml + -f deploy/rustfs-operator/crds/tenant-crd.yaml kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ -f deploy/rustfs-operator/crds/policybinding-crd.yaml diff --git a/docs/operator-user-guide.zh-CN.md b/docs/operator-user-guide.zh-CN.md index 2357dd6..225cdad 100644 --- a/docs/operator-user-guide.zh-CN.md +++ b/docs/operator-user-guide.zh-CN.md @@ -96,7 +96,7 @@ kubectl logs -n rustfs-system \ # Helm 不会升级 Chart crds/ 目录中已经存在的 CRD。 kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ - -f deploy/rustfs-operator/crds/tenant.yaml + -f deploy/rustfs-operator/crds/tenant-crd.yaml kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ -f deploy/rustfs-operator/crds/policybinding-crd.yaml