aws / aws-cloud-map-mcs-controller-for-k8s

K8s controller implementing Multi-Cluster Services API based on AWS Cloud Map.
https://aws.amazon.com/blogs/opensource/kubernetes-multi-cluster-service-discovery-using-open-source-aws-cloud-map-mcs-controller/
Apache License 2.0
88 stars 28 forks source link

Imported service not respective topology awareness hints #263

Open techmouse84 opened 1 year ago

techmouse84 commented 1 year ago

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
runakash commented 1 year ago

Hello techmouse84 - We do not support Topology Aware Hints yet. Even mcs spec references the deprecated Topology API. We can definitely have a look into integrating in future milestones.