Skip to main content

Network Policy

In Kubernetes or OpenShift you can set Network Policies for your application or microservice.(The networkPolicy object)
This page explains you how.


1. In your manifest repository's main branch, you will find the values.yaml file, it showld be in the following folder structure [environment]/[project]/[application]

2. In the values.yaml file, search for the Additional Customizations section, you will find it like this:


## Additional Customizations #################################################

3. Bellow the section title, add the following configuration and change the values as you need:

  # - Network Policy
networkPolicy:
# Enable Network Policy: true or false
enabled: false
additionalLabels:
#key: value
annotations:
#key: value
ingress:
#- from:
# - ipBlock:
# cidr: 172.17.0.0/16
# except:
# - 172.17.1.0/24
# - namespaceSelector:
# matchLabels:
# project: myproject
# - podSelector:
# matchLabels:
# role: frontend
# ports:
# - protocol: TCP
# port: 6379
egress:
# - to:
# - ipBlock:
# cidr: 10.0.0.0/24
# ports:
# - protocol: TCP
# port: 5978
# Additional labels for Deployment
additionalLabels:
#key: value
#####

4. Commit and enjoy! ✨