UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit bf58d538 authored by Andrew Kesterson's avatar Andrew Kesterson
Browse files

Fixes #1996 : Add combined network policies docs

parent e31ebca9
No related branches found
No related tags found
No related merge requests found
Pipeline #3202092 passed
# Using Network Policies in Big Bang
## What are Network Policies
Kubernetes allows Big Bang operators to utilize [Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) to control the network traffic into or out of the various pods of a Kubernetes cluster. These network policies allow you to restrict incoming and outgoing traffic to or from a given set of pods using selectors. [Selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) allow you to select which pods a given networkPolicy will apply to.
Network Policies are added as needed to supplement other good security practices; such as proper usage of TLS, only exposing necessary ports, and using other standard controls. However, Network Policies allow you to express additional control over what can connect to the pods in your cluster from outside; which pods in your kubernetes cluster can speak to each other internally; and which things those pods can initiate connections to outside of the cluster.
## Enabling or Disabling Network Policies
BigBang packages and community addons ship with various network policies already configured. You can turn these networking policies on and off by setting a global flag and a per-component flag.
```
# This will turn support on or off for network policies writ-large across the bigbang suite
networkPolicies:
enabled: [true|false]
# For bigbang packages (such as minio, istio, etc), this will turn on or off support for network policies in a specific component
addons:
COMPONENT_NAME:
values:
networkPolicies:
enabled: [true|false]
# For community addons (such as jira), this will turn on or off support for network policies in a specific package
package:
COMPOONENT_NAME:
values:
networkPolicies:
enabled: [true|false]
```
## Crafting and Delivering Additional Network Policies
Sometimes you will want to apply additional [Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) to further isolate certain pods in your deployment. BigBang has adopted standardized mechanisms for crafting and deploying these Network Policies through the values provided to your BigBang components or community add-ons.
For BigBang packaged components, you place these rules inside of the values for the given component:
```
addons:
COMPONENT_NAME:
values:
networkPolicies:
enabled: true
additionalPolicies:
- name: example-egress-policy-all-pods
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 172.20.0.0/12
- name: example-ingress-policy-all-pods
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- ipBlock:
cidr: 172.20.0.0/12
```
For community addons (such as JIRA), you add these rules inside of the values for the package:
```
packages:
PACKAGE_NAME:
values:
networkPolicies:
enabled: true
additionalPolicies:
- name: example-egress-policy-all-pods
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 172.20.0.0/12
- name: example-ingress-policy-all-pods
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- ipBlock:
cidr: 172.20.0.0/12
```
In either case, the `additionalPolicies` entry should be a list of YAML objects, each describing a single [Network Policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/). You can add as many of these as you like. Consult [the upstream Kubernetes documentation](https://kubernetes.io/docs/concepts/services-networking/network-policies/) for more information on Network Policies, and what you can do with them.
## References
* [Kubernetes Network Policies Documentation](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
* [Kubernetes Labels and Selectors Documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
* [Big Bang Developer Guide for Package Implementation](../../developer/develop-package.md)
* [Big Bang Developer Guide for Package Integration regarding Network Policies](../../developer/package-integration/network-policies.md)
For more information regarding the behavior of a specific component or community addon, you should always reference the documentation for the specific BigBang component (or community addon) in question. Information specific to any given component or community addon is outside the scope of this documentation.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment