Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failureDomainSelector with matchExpressions / matchLabels #2973

Open
jisnardo opened this issue May 7, 2024 · 0 comments
Open

failureDomainSelector with matchExpressions / matchLabels #2973

jisnardo opened this issue May 7, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jisnardo
Copy link

jisnardo commented May 7, 2024

/kind bug

Using failureDomainSelector with vspherecluster.

What steps did you take and what happened:

case 1:

failureDomainSelector: {}

status:
...
  failureDomains:
    cpd1:
      controlPlane: true
    cpd2:
      controlPlane: true
    cpd3:
      controlPlane: true

As expected.

case 2:

failureDomainSelector:
  matchExpressions:
  - key: cpd
    operator: In
    values:
      - cpd1

No status failureDomains.

case 3:

failureDomainSelector:
  matchLabels:
    cpd: cpd1

No status failureDomains.

What did you expect to happen:

case 2:

failureDomainSelector:
  matchExpressions:
  - key: cpd
    operator: In
    values:
      - cpd1
status:
...
  failureDomains:
    cpd1:
      controlPlane: true

case 3:

failureDomainSelector:
  matchLabels:
    cpd: cpd1
status:
...
  failureDomains:
    cpd1:
      controlPlane: true

Anything else you would like to add:

Deployed failure domains.

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereFailureDomain
...
  labels:
    cpd: cpd1
k get vspherefailuredomains.infrastructure.cluster.x-k8s.io 
NAME    AGE
cpd1    99m
cpd2    69d
cpd3    25d
k get vspherefailuredomains.infrastructure.cluster.x-k8s.io -l cpd=cpd1
NAME   AGE
cpd1   100m

crd.

  failureDomainSelector:
    description: FailureDomainSelector is the label selector to use for
      failure domain selection for the control plane nodes of the cluster.
      If not set (`nil`), selecting failure domains will be disabled.
      An empty value (`{}`) selects all existing failure domains. A valid
      selector will select all failure domains which match the selector.
    properties:
      matchExpressions:
        description: matchExpressions is a list of label selector requirements.
          The requirements are ANDed.
        items:
          description: A label selector requirement is a selector that
            contains values, a key, and an operator that relates the key
            and values.
          properties:
            key:
              description: key is the label key that the selector applies
                to.
              type: string
            operator:
              description: operator represents a key's relationship to
                a set of values. Valid operators are In, NotIn, Exists
                and DoesNotExist.
              type: string
            values:
              description: values is an array of string values. If the
                operator is In or NotIn, the values array must be non-empty.
                If the operator is Exists or DoesNotExist, the values
                array must be empty. This array is replaced during a strategic
                merge patch.
              items:
                type: string
              type: array
          required:
          - key
          - operator
          type: object
        type: array
      matchLabels:
        additionalProperties:
          type: string
        description: matchLabels is a map of {key,value} pairs. A single
          {key,value} in the matchLabels map is equivalent to an element
          of matchExpressions, whose key field is "key", the operator
          is "In", and the values array contains only "value". The requirements
          are ANDed.
        type: object
    type: object
    x-kubernetes-map-type: atomic

Environment:

  • Cluster-api-provider-vsphere version: clusterctl init --core=cluster-api:v1.6.2 --bootstrap=kubeadm:v1.6.2 --control-plane=kubeadm:v1.6.2 --infrastructure=vsphere:v1.9.1 --ipam=in-cluster:v0.1.0
  • Kubernetes version: v1.28.0
  • OS (e.g. from /etc/os-release): Ubuntu 22.04

Cluster API vSphere image - Ubuntu 22.04 and Kubernetes v1.28.0

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants