Skip to content

Imported service not respective topology awareness hints #263

Open
@techmouse84

Description

@techmouse84

Tested in EKS 1.24

Verified with the following setup .
curling the imported service from an ubuntu pod will show that it's randomly distributed across the 2 pods.
Expects imported service to respect topology awareness and hits only 1 pod.

apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: monitoring
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.14.2
          ports:
            - containerPort: 80
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - nginx
            topologyKey: failure-domain.beta.kubernetes.io/zone

---

kind: Service
apiVersion: v1
metadata:
  namespace: monitoring
  name: nginx-service
  annotations:
    service.kubernetes.io/topology-aware-hints: Auto
spec:
  selector:
    app: nginx
  ports:
    - port: 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions