---
title: "Make your FortiGate firewalls work with Kubernetes: How Calico enables Fortinet firewalls to secure Kubernetes workloads"
source: "https://wordpress-1075849-4005834.cloudwaysapps.com/blog/make-your-fortigate-firewalls-work-with-kubernetes-how-calico-enables-fortinet-firewalls-to-secure-kubernetes-workloads/"
description: "Learn about Calico’s integration with Fortinet’s FortiGate and FortiManager solutions to extend the firewall capability to Kubernetes."
---

[Technical Blog](https://wordpress-1075849-4005834.cloudwaysapps.com/category/technical-blog/)

# Make your FortiGate firewalls work with Kubernetes: How Calico enables Fortinet firewalls to secure Kubernetes workloads

By [Rui De Abreu](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/rui-de-abreu/) on May 23, 2023 • 8 min read

## FortiGate firewalls

FortiGate firewalls are highly popular and extensively utilized for perimeter-based security in a wide range of applications, including monolithic applications developed and deployed using the traditional waterfall model. These firewalls establish a secure perimeter around applications, effectively managing inbound and outbound traffic for the organization. FortiGate relies on IP addresses for implementing “allow/deny” policies.

The use of IP addresses is effective for non-cloud native applications, where static IP addresses serve as definitive network identifiers. However, in a Kubernetes environment, workloads have dynamic IP addresses that change whenever they are restarted or scaled out to different nodes. This dynamic nature poses challenges when utilizing FortiGate with Kubernetes workloads, requiring continuous updates to firewall rules and the opening of large CIDR ranges for node-based access. This introduces security and compliance risks, as workloads running on these CIDR ranges gain unrestricted access to external or public services.

To facilitate the usage of FortiGate firewalls with Kubernetes workloads, it becomes crucial to identify workloads that necessitate access to external resources and assign them fixed IP addresses for utilization in FortiGate firewall rules. The integration of Calico with FortiGate firewalls and FortiManager offers an elegant solution, enabling the use of FortiGate firewalls while retaining existing controls and adapting current tools to the Kubernetes environment. This integration provides two options for seamless operation:

- Calico integration with FortiGate firewalls.

- Calico integration with FortiManager.

The subsequent sections will delve into these integrations in detail.

## Calico integration with FortiGate devices:

Calico allows you to maintain the same workload access controls in place by using the IP address of the microservices at a particular moment in time. These IPs are pushed to the FortiGate devices, which are then updated to ensure that the firewall rules stay valid. Below we depict how this integration would work:

![Diagram showing the tigera-firewall-controller pod using a REST API to update FortiGate firewall rules. The pod is in a K8s](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image8-2.png)Fig 1: Calico-FortiGate integration overview

A summarized sequence of steps to enable this integration is as follows:

- A REST API administrator must be created in the FortiGate device. This is the user the Tigera firewall controller will leverage to make CRUD (Create, Read, Update and Delete) operations for the address groups in the firewall. We should associate a profile to this user that only can access Policy & Objects resources:

![FortiGate's administrator list showing a "tigera_admin" REST API user with a custom API profile](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image4-4.png)Fig 2: FortiGate Administrators configuration page
![Fortinet admin profile settings for a Tigera API user, showing access control permissions](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image6-2.png)Fig 3: FortiGate Admin Profiles configuration page

- We must capture this information in a kubernetes secret.

- Additionally, we must create a configmap where we specify the details on how to connect to the FortiGate firewall (there could be multiple devices listed there). Such configmap will make reference to the secret we previously configured:

```
`$ kubectl get cm -n tigera-firewall-controller tigera-firewall-controller-configs -oyaml apiVersion: v1 kind: ConfigMap metadata: name: tigera-firewall-controller-configs namespace: tigera-firewall-controller data: tigera.firewall.fortigate: "- name: fortinetn ip: 172.16.1.160n apikey: n secretKeyRef:n name: fortigaten key: apikey-fortigaten" tigera.firewall.fortimgr: |`
```

*First configmap manifest used by Tigera Firewall Controller*

- As part of the configuration, we must create a second config map which will determine how these addresses will be advertised to the FortiGate device, as we can decide to use the node IP to advertise those (likely if we are using an overlay), or actually advertise the current pod addresses if we are using a flat network (as we can advertise these addresses to the FortiGate device from Calico by means of BGP, if required). In our case we will advertise the current pod addresses to FortiGate:

```
`$ kubectl get cm -n tigera-firewall-controller tigera-firewall-controller -oyaml apiVersion: v1 kind: ConfigMap metadata: name: tigera-firewall-controller namespace: tigera-firewall-controller data: tigera.firewall.addressSelection: pod tigera.firewall.policy.selector: projectcalico.org/tier == 'fortinet'`
```

*Second Configmap manifest used by Tigera Firewall Controller*

This same config map will determine which Calico Tier resource will be used to control the pods we want to include in these address groups at Fortinet side. In our case, this Tier is called “fortinet”, and it is matching two endpoints:

![Screenshot showing the "fortinet" Calico Tier with "2 endpoints" matching, as mentioned in the context](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image7-3.png)Fig. 4: Calico Enterprise Policies Board

Calico lets you create policy tiers for such situations. For more information on policy tiers in Calico, please check this [link](https://docs.tigera.io/calico-enterprise/latest/network-policy/policy-tiers/tiered-policy).

The policy that matches these endpoints  is a Global Policy, which allows all traffic coming from them (the enforcement would be done in the FortiGate firewall). The Calico policy’s purpose is to select the endpoints from which we will advertise the address to the Fortinet firewall.

```
`$ kubectl get globalnetworkpolicies.crd fortinet.fortigate -oyaml apiVersion: crd.projectcalico.org/v1 kind: GlobalNetworkPolicy metadata: labels: projectcalico.org/tier: fortinet name: fortinet.fortigate spec: egress: - action: Allow destination: {} source: {} order: 0 selector: app == "app2" tier: fortinet types: - Egress`
```

*Global Network Policy manifest*

- Then, we must apply some standard manifests to deploy the Tigera firewall controller deployment as part of the procedure. This controller uses the configmap mentioned earlier to communicate with the FortiGate firewall.

As a result of this process, the IP address of the pods will be available in the FortiGate device as an address group that we can use in the firewall rules. This effectively maintains the same paradigm where an application can be associated with a particular IP when traversing the firewall:

```
`$ kubectl get pod -n app2 -ocustom-columns="NAME":.metadata.name,"IP":.status.podIP NAME IP app2-deployment-5d75d7ff89-bsj9j 10.244.7.217 app2-deployment-5d75d7ff89-lgjhp 10.244.97.16`
```

*Pod output from kubectl command*

![Screenshot of Kubernetes network policies showing pod IP address ranges defined as subnets](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image10-2.png)Fig.5: FortiGate Addresses UI page

For a detailed step-by-step configuration, please go to this [link](https://docs.tigera.io/calico-enterprise/latest/network-policy/policy-firewalls/fortinet-integration/firewall-integration).

# Calico integration with FortiManager:

An alternative to pushing the IP address of selected pods to our firewall devices is to use our existing tools to implement microsegmentation at the pod level within our kubernetes environment. This is achieved by creating rules in FortiManager, which are then implemented as Calico security policies in kubernetes.

- A REST API administrator must be created in FortiManager. We will associate a profile to this user with read/write access to Policy & Objects only:

![FortiManager Administrators view showing the "tigera_api_user_profile" with Read & Write JSON API access](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image9-1.png)Fig 6: FortiManager Administrator configuration page

- This same configuration must be captured in a kubernetes secret.

- Then we will have a configmap where we specify the details on how to connect to FortiManager, and we will make reference to the secret we previously configured:

```
`$ kubectl get cm -n tigera-firewall-controller tigera-fortimanager-controller-configs -oyaml apiVersion: v1 kind: ConfigMap metadata: name: tigera-fortimanager-controller-configs namespace: tigera-firewall-controller data: tigera.firewall.fortimanager-policies: | - name: fortimgr ip: 172.16.1.149 username: tigera_ew_fortimanager_admin adom: root packagename: calico-ew tier: fortimanager password: secretKeyRef: name: fortimgr key: pwd-fortimgr`
```

*Configmap manifest used by Tigera Firewall Controller in this integration*

Part of the configuration is specifying the ADOM, and Packagename we are using in FortiManager. Similarly to the previous integration, we need to specify a Calico Tier resource,  but this time it will be used as the destination Tier for all Calico policies we create based on the configuration done on FortiManager.

- Once this is done, we must apply some standard manifests to deploy the Tigera firewall controller deployment as part of the procedure. This controller uses the configmap mentioned above to communicate with the FortiManager device.

## How are firewall rules created in FortiManager mapped to Calico policies?

With Calico, we use native Kubernetes mechanisms such as labels to select the pods we want to secure, or to match the traffic. Therefore, the first step is to define the address groups in FortiManager. These address groups must be empty because those endpoints exist as pods in our Kubernetes cluster. Let’s take the following diagram as an example:

![Diagram showing traffic blocked from a CentOS pod to an app1 pod in Kubernetes, illustrating the need to define address](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image15.png)Fig 7: Example of communication between two microservices

In the example above, we want to restrict the traffic from the CentOS pod to the app1 pod, which is exposed through the app-1-svc.ns1.svc.cluster.local kubernetes service. We must create two corresponding address groups in FortiManager. Those are called `k8s-app-1-consumer`, and `k8s-app-1-service`:

![FortiManager's "Edit Address Group" window, showing "k8s-app-1-service" group creation for Kubernetes pod traffic restriction](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image3-3.png)Fig 8: FortiManager Address Group configurations

![Screenshot of the "Edit Address Group" panel with "k8s-app-1-consumer" as the group name](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image1-6.png)

![Kubectl command output showing pod labels, including tigera.io address groups](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image2-5.png)Fig 9: Pod labels output from kubectl command

Before configuring anything else, we can see the CentOS pod can reach the app-1 service:

![Terminal output showing a successful `curl` command from the CentOS pod to the `app-1` service, indicated by 'HTTP/1.1 200 OK](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image12.png)Fig 10: Pod labels output from kubectl command

Now let’s create a rule to restrict this traffic. We use the address groups as source and destinations for this flow:

![Screenshot of a 'Create New Firewall Policy' form, showing source/destination address groups and 'Deny' action](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image5-3.png)Fig 11: FortiManager Firewall Policy configuration

If we follow the logs in the Tigera firewall controller pod, four policies are being created:

![Tigera firewall controller pod logs showing four policies being created: ingress, ingress-deny, egress, and egress-deny](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image14-1.png)Fig 12: Tigera Firewall Controller pod logs

Two policies are being implemented for ingress and two for egress. For each direction, one policy will represent the traffic we configure in FortiManager, and the second policy will deny all other traffic (so this second policy will cover any case where an allow rule is created):

![FortiManager policies board showing ingress/egress policies. Each direction has an allow rule and a deny-all rule](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image11-2.png)Fig 13: Calico Enterprise Policies Board

If we attempt to connect again, the CentOS pod will be unable to reach the app-1 service. By checking Calico Service Graph, we can see that the request went through two policies. The first policy  “allow-dns-and-pass” allows the CenTOS pod to reach coredns server, but the second policy highlighted in the output below (“centos-to-app1-egress”) which belongs to the “fortimanager” Tier, denies the connectivity, as expected:

![Calico Service Graph showing CentOS pod unable to reach app-1 service due to highlighted "deny" policy](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2023/05/image13.png)Fig 14: Calico Enterprise Service Graph

For a detailed step-by-step configuration for this integration, head to our documentation page [here](https://docs.tigera.io/calico-enterprise/latest/network-policy/policy-firewalls/fortinet-integration/fortimgr-integration).

## Conclusion

This blog describes Calico’s integration with Fortinet’s FortiGate and FortiManager solutions to extend the firewall capability to Kubernetes. This integration will benefit teams that are migrating their legacy applications to cloud-native in a secure manner and protect non-Kubernetes workloads outside the cluster with familiar workflows and less firewall rules.

Ready to get started? [Try Calico Cloud for free](https://link.tigera.io/ueOp4).

[Best Practices](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/best-practices/)[How-To](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/how-to/)[Products](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/products/)

Add Tigera as a preferred source on Google to see more of our content in your search results.

[![Add as a preferred source on Google](https://wordpress-1075849-4005834.cloudwaysapps.com/app/themes/tigera2021/dist/img/google-preferred-source-light.png)](https://www.google.com/preferences/source?q=tigera.io)

## Related posts

[![Calico Load Balancer: Simplifying Network Traffic Management with eBPF](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/Calico-Load-Balancer-Simplifying-Network-Traffic-Management-with-eBPF.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/calico-load-balancer-simplifying-network-traffic-management-with-ebpf/)

#### [Calico Load Balancer: Simplifying Network Traffic Management with eBPF](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/calico-load-balancer-simplifying-network-traffic-management-with-ebpf/)

By [Aadhil Abdul Majeed](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/aadhil-abdul-majeed/)
on Mar 21, 2026

Authors: Alex O’Regan, Aadhil Abdul Majeed Ever had a load balancer become the bottleneck in an on-prem Kubernetes cluster? You are not alone. Traditional hardware load balancers add cost, create coordination overhead, and can make...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/calico-load-balancer-simplifying-network-traffic-management-with-ebpf/)

[![Lift-and-Shift VMs to Kubernetes with Calico L2 Bridge Networks](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/Mar-20-Lift-and-Shift-VMs-to-Kubernetes-with-Calico-L2-Bridge-Networks.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/lift-and-shift-vms-to-kubernetes-with-calico-l2-bridge-networks/)

#### [Lift-and-Shift VMs to Kubernetes with Calico L2 Bridge Networks](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/lift-and-shift-vms-to-kubernetes-with-calico-l2-bridge-networks/)

By [Aadhil Abdul Majeed](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/aadhil-abdul-majeed/)
on Mar 20, 2026

On paper, lift-and-shift VM migration to Kubernetes sounds simple. Compute can be moved. Storage can be remapped. But many migration projects stall at the network boundary. VM workloads are often tied to IP addresses, network...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/lift-and-shift-vms-to-kubernetes-with-calico-l2-bridge-networks/)

[![AI Assistant for Calico: Troubleshooting at the Speed of Thought](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/Blog-Mar-20-AI-Assistant-for-Calico.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

#### [AI Assistant for Calico: Troubleshooting at the Speed of Thought](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

By [Veronika Smolik](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/veronika-smolik/)
on Mar 19, 2026

Despite the wealth of data available, distilling a coherent narrative from a Kubernetes cluster remains a challenge for modern infrastructure teams. Even with powerful visualization tools like the Policy Board, Service Graph, and specialized dashboards,...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

<!-- plugin=object-cache-pro client=phpredis metric#hits=6228 metric#misses=17 metric#hit-ratio=99.7 metric#bytes=2242790 metric#prefetches=0 metric#store-reads=420 metric#store-writes=15 metric#store-hits=460 metric#store-misses=6 metric#sql-queries=32 metric#ms-total=1003.32 metric#ms-cache=55.05 metric#ms-cache-avg=0.1268 metric#ms-cache-ratio=5.5 sample#redis-hits=74194870 sample#redis-misses=9035512 sample#redis-hit-ratio=89.1 sample#redis-ops-per-sec=319 sample#redis-evicted-keys=0 sample#redis-used-memory=110420208 sample#redis-used-memory-rss=107954176 sample#redis-memory-fragmentation-ratio=1.0 sample#redis-connected-clients=2 sample#redis-tracking-clients=0 sample#redis-rejected-connections=0 sample#redis-keys=23580 -->
