zozo6015
zozo6015

Reputation: 577

why does kubernetes networkPolicy delays the request

I have a networkPolicy attached to a pod that looks like this:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: api-egress
spec:
  podSelector:
    matchLabels:
      app: 
  egress:
    - ports:
        - protocol: TCP
          port: 3306
      to:
        - ipBlock:
            cidr: 10.100.100.199/32
    - ports:
        - protocol: TCP
          port: 443
      to:
        - ipBlock:
            cidr: 10.100.100.198/32
    - ports:
        - protocol: TCP
          port: 6379
      to:
        - podSelector:
            matchLabels:
              app: redis
    - ports:
        - protocol: TCP
          port: 5672
      to:
        - podSelector:
            matchLabels:
              app.kubernetes.io/instance: queue
    - ports:
        - protocol: TCP
          port: 8118
      to:
        - podSelector:
            matchLabels:
              app: support
    - ports:
        - protocol: TCP
          port: 8000
      to:
        - podSelector:
            matchLabels:
              app: ocket
  policyTypes:
    - Egress

When the network policy is applied I can see on the application side that there is a delay of 2.5minutes in one auth request to the api while if it's not there the same request is finished in 861ms.

Anyone can explain why is this delay there and how can I improve it?

Upvotes: 1

Views: 173

Answers (0)

Related Questions