Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-8892

anti-affinity rule not getting applied to tekton-chains-controller

XMLWordPrintable

      Description of problem:

      anti-affinity rule not getting applied to tekton-chains-controller

      Prerequisites (if any, like setup, operators/versions):

      Install 1.20 operator on a OCP environment

      Steps to Reproduce

      1. Get the pods of openshift-pipelines namespace
      2. Get the yaml of chains-controller and check affinity rule in spec
      oc get po tekton-chains-controller-0 -n openshift-pipelines -oyaml | yq '.spec'

      Actual results:

      anti-affinity rule not getting applied to tekton-chains-controller

      oc get po tekton-chains-controller-0 -n openshift-pipelines -oyaml | yq '.spec'
      containers:
        - env:
            - name: SYSTEM_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: METRICS_DOMAIN
              value: tekton.dev/chains
            - name: CONFIG_OBSERVABILITY_NAME
              value: tekton-chains-config-observability
            - name: CONFIG_LEADERELECTION_NAME
              value: tekton-chains-config-leader-election
            - name: KUBERNETES_MIN_VERSION
              value: v1.0.0
            - name: STATEFUL_SERVICE_NAME
              value: tekton-chains-controller
            - name: STATEFUL_CONTROLLER_ORDINAL
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
       

       

      Expected results:

      **

      spec of chains-controller should have affinity rule added as below

      $ oc get po tekton-pipelines-remote-resolvers-0 -n openshift-pipelines -oyaml | yq '.spec'
      
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/os
                    operator: NotIn
                    values:
                      - windows
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/component: resolvers
                    app.kubernetes.io/instance: default
                    app.kubernetes.io/name: resolvers
                    app.kubernetes.io/part-of: tekton-pipelines
                topologyKey: kubernetes.io/hostname
              weight: 100

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

      PFA yaml files with & without affinity for reference.
      chains_controller_spec.yaml

        1. chains_controller_spec.yaml
          4 kB
          Sai Raju Manthina
        2. remote_resolvers_spec.yaml
          5 kB
          Sai Raju Manthina

              jkhelil abdeljawed khelil
              rh-ee-smanthin Sai Raju Manthina
              Sai Raju Manthina Sai Raju Manthina
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: