Skip to content

Add scheduling controls to Mesh Ingress#1892

Merged
rooftopcellist merged 1 commit intoansible:develfrom
dhageman:meshconstraints
Jun 12, 2024
Merged

Add scheduling controls to Mesh Ingress#1892
rooftopcellist merged 1 commit intoansible:develfrom
dhageman:meshconstraints

Conversation

@dhageman
Copy link
Copy Markdown
Contributor

@dhageman dhageman commented Jun 5, 2024

SUMMARY

The goal of this pull request is to add scheduling controls to Mesh Ingress resources. The design is intended to align with the controls already available on the other AWX resources.

ISSUE TYPE
  • New or Enhanced Feature
ADDITIONAL INFORMATION

@dhageman dhageman marked this pull request as draft June 5, 2024 18:07
@dhageman dhageman force-pushed the meshconstraints branch 2 times, most recently from 6cad92e to 316f7c4 Compare June 5, 2024 22:15
@dhageman dhageman marked this pull request as ready for review June 5, 2024 22:16
@rooftopcellist
Copy link
Copy Markdown
Member

@dhageman It looks like the x-descriptor entries are missing

@dhageman
Copy link
Copy Markdown
Contributor Author

Tested with the following custom resource:


---
apiVersion: awx.ansible.com/v1alpha1
kind: AWXMeshIngress
metadata:
  name: mesh-test-1
  namespace: awx
spec:
  deployment_name: awx
  ingress_type: route
  external_hostname: mesh-test-1.apps.rosa.cus-svtb6k.fald.p3.openshiftapps.com
  node_selector: |
    topology.kubernetes.io/zone: us-east-1a
  tolerations: |
    - key: "dedicated"
      operator: "Equal"
      value: "AWX"
      effect: "NoSchedule"

Result shown in pod (truncated for brevity):

  nodeName: ip-10-0-10-39.ec2.internal
  nodeSelector:
    topology.kubernetes.io/zone: us-east-1a
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext:
    fsGroup: 1000870000
    seLinuxOptions:
      level: s0:c30,c0
    seccompProfile:
      type: RuntimeDefault
  serviceAccount: mesh-test-1
  serviceAccountName: mesh-test-1
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoSchedule
    key: dedicated
    operator: Equal
    value: AWX
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300

@dhageman
Copy link
Copy Markdown
Contributor Author

Confirm affinity with the following resource:

---
apiVersion: awx.ansible.com/v1alpha1
kind: AWXMeshIngress
metadata:
  name: mesh-test-2
  namespace: awx
spec:
  deployment_name: awx
  ingress_type: route
  external_hostname: mesh-test-2.apps.rosa.cus-svtb6k.fald.p3.openshiftapps.com
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - us-east-1a
            - us-east-1b
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: topology.kubernetes.io/zone
              operator: In
              values:
              - us-east-1c
          topologyKey: topology.kubernetes.io/zone

Resulting deployment had (truncated for brevity):


spec:
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - preference:
          matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - us-east-1a
            - us-east-1b
        weight: 1
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: topology.kubernetes.io/zone
              operator: In
              values:
              - us-east-1c
          topologyKey: topology.kubernetes.io/zone
        weight: 100

@dhageman
Copy link
Copy Markdown
Contributor Author

NAME                                                              READY   STATUS      RESTARTS   AGE
36156c30f2b4b643fa5246e0f31d17e18c58d466608f9945e516c555b8wpbrh   0/1     Completed   0          27m
awx-migration-24.5.0-d2dbj                                        0/1     Completed   0          24m
awx-operator-controller-manager-7f45fd5f75-jz5pj                  2/2     Running     0          27m
awx-postgres-15-0                                                 1/1     Running     0          25m
awx-qh9xc                                                         1/1     Running     0          27m
awx-task-d95548494-gdzjz                                          4/4     Running     0          24m
awx-web-644c5f8f8d-vh4gp                                          3/3     Running     0          24m
mesh-test-1-646687d87b-2qpwr                                      1/1     Running     0          9m20s
mesh-test-2-85ffb967d9-2rdzq                                      1/1     Running     0          4m16s

@dhageman
Copy link
Copy Markdown
Contributor Author

@rooftopcellist - I have the x-descriptor entries added to the pull request now. Thank you for reminding me to add those!

@rooftopcellist rooftopcellist merged commit 13abaab into ansible:devel Jun 12, 2024
@dhageman dhageman deleted the meshconstraints branch November 17, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants