Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The NetworkPolicy brakes access to the service #86

Open
behoof4mind opened this issue Dec 12, 2024 · 0 comments
Open

The NetworkPolicy brakes access to the service #86

behoof4mind opened this issue Dec 12, 2024 · 0 comments

Comments

@behoof4mind
Copy link

Hello,

We have noticed that the default network policy do not allow to have connections towards gdscan.

# Source: vaas/templates/gdscan/networkpolicy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: gdscan
  labels:
    helm.sh/chart: vaas-2.4.0
    app.kubernetes.io/name: gdscan
    app.kubernetes.io/instance: gdata-vaas
    app.kubernetes.io/namespace: default
    app.kubernetes.io/managed-by: Helm
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/name: gdscan
      app.kubernetes.io/instance: gdata-vaas
      app.kubernetes.io/namespace: default
  policyTypes:
  - Ingress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              app.kubernetes.io/name: gateway
      ports:
        - port: 8080 # Upload

But to make service work we also need access to gdscan from our application. So to achieve it we use our custom policy which have additional selector fields:

  - from:
    - podSelector:
        matchLabels:
          app.kubernetes.io/instance: gdata-vaas
          app.kubernetes.io/name: gateway
    - namespaceSelector:
        matchLabels:
          app.kubernetes.io/part-of: <OUR_APP_NAME>
      podSelector:
        matchLabels:
          app.kubernetes.io/component: <OUR_APP_COMPONENT>
          app.kubernetes.io/instance: <OUR_APP_NAME>

Correct me if I am wrong, but application need to have TCP connection not only to the Gateway, but to the Gdscan as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant