Skip to content

Commit

Permalink
remove tunnel limitation for IPSec
Browse files Browse the repository at this point in the history
this PR is based on antrea-io#2486 and I verified all tunnel modes with
IPSec in K8s Cluster, it all works fine now, so I remove the limitation
on our docs and the check in the code.

Signed-off-by: Lan Luo <[email protected]>
  • Loading branch information
luolanzone committed Jul 29, 2021
1 parent 15bca3a commit d145bfd
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 41 deletions.
11 changes: 5 additions & 6 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,7 @@ data:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0
# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
#enableIPSecTunnel: false
# ClusterIP CIDR range for IPv6 Services. It's required when using kube-proxy to provide IPv6 Service in a Dual-Stack
Expand Down Expand Up @@ -3887,7 +3886,7 @@ metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -3958,7 +3957,7 @@ spec:
fieldRef:
fieldPath: spec.serviceAccountName
- name: ANTREA_CONFIG_MAP_NAME
value: antrea-config-tgm22b6g5t
value: antrea-config-496b28dcf5
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4009,7 +4008,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -4305,7 +4304,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
11 changes: 5 additions & 6 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,7 @@ data:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0
# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
#enableIPSecTunnel: false
# ClusterIP CIDR range for IPv6 Services. It's required when using kube-proxy to provide IPv6 Service in a Dual-Stack
Expand Down Expand Up @@ -3887,7 +3886,7 @@ metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -3958,7 +3957,7 @@ spec:
fieldRef:
fieldPath: spec.serviceAccountName
- name: ANTREA_CONFIG_MAP_NAME
value: antrea-config-tgm22b6g5t
value: antrea-config-496b28dcf5
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4009,7 +4008,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -4307,7 +4306,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-tgm22b6g5t
name: antrea-config-496b28dcf5
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
11 changes: 5 additions & 6 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,7 @@ data:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0
# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
#enableIPSecTunnel: false
# ClusterIP CIDR range for IPv6 Services. It's required when using kube-proxy to provide IPv6 Service in a Dual-Stack
Expand Down Expand Up @@ -3887,7 +3886,7 @@ metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-246k7dkb5c
name: antrea-config-bbb8g6mm68
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -3958,7 +3957,7 @@ spec:
fieldRef:
fieldPath: spec.serviceAccountName
- name: ANTREA_CONFIG_MAP_NAME
value: antrea-config-246k7dkb5c
value: antrea-config-bbb8g6mm68
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4009,7 +4008,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-246k7dkb5c
name: antrea-config-bbb8g6mm68
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -4308,7 +4307,7 @@ spec:
path: /home/kubernetes/bin
name: host-cni-bin
- configMap:
name: antrea-config-246k7dkb5c
name: antrea-config-bbb8g6mm68
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
11 changes: 5 additions & 6 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,7 @@ data:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0
# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
enableIPSecTunnel: true
# ClusterIP CIDR range for Services. It's required when AntreaProxy is not enabled, and should be
Expand Down Expand Up @@ -3892,7 +3891,7 @@ metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-5mt4h4g8tk
name: antrea-config-h4mmb8t9fg
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -3972,7 +3971,7 @@ spec:
fieldRef:
fieldPath: spec.serviceAccountName
- name: ANTREA_CONFIG_MAP_NAME
value: antrea-config-5mt4h4g8tk
value: antrea-config-h4mmb8t9fg
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4023,7 +4022,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-5mt4h4g8tk
name: antrea-config-h4mmb8t9fg
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -4354,7 +4353,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-5mt4h4g8tk
name: antrea-config-h4mmb8t9fg
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
11 changes: 5 additions & 6 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,7 @@ data:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0
# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
#enableIPSecTunnel: false
# ClusterIP CIDR range for Services. It's required when AntreaProxy is not enabled, and should be
Expand Down Expand Up @@ -3892,7 +3891,7 @@ metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-2567tcm8ck
name: antrea-config-t4522b684c
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -3963,7 +3962,7 @@ spec:
fieldRef:
fieldPath: spec.serviceAccountName
- name: ANTREA_CONFIG_MAP_NAME
value: antrea-config-2567tcm8ck
value: antrea-config-t4522b684c
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4014,7 +4013,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-2567tcm8ck
name: antrea-config-t4522b684c
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -4310,7 +4309,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-2567tcm8ck
name: antrea-config-t4522b684c
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
3 changes: 1 addition & 2 deletions build/yamls/base/conf/antrea-agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ featureGates:
# also adjust MTU to accommodate for tunnel encapsulation overhead (if applicable).
#defaultMTU: 0

# Whether or not to enable IPsec encryption of tunnel traffic. IPsec encryption is only supported
# for the GRE tunnel type.
# Whether or not to enable IPsec encryption of tunnel traffic.
#enableIPSecTunnel: false

# ClusterIP CIDR range for Services. It's required when AntreaProxy is not enabled, and should be
Expand Down
3 changes: 1 addition & 2 deletions cmd/antrea-agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ type AgentConfig struct {
// --service-cluster-ip-range. When AntreaProxy is enabled, this parameter is not needed.
// No default value for this field.
ServiceCIDRv6 string `yaml:"serviceCIDRv6,omitempty"`
// Whether or not to enable IPSec (ESP) encryption for Pod traffic across Nodes. IPSec encryption
// is supported only for the GRE tunnel type. Antrea uses Preshared Key (PSK) for IKE
// Whether or not to enable IPSec (ESP) encryption for Pod traffic across Nodes. Antrea uses Preshared Key (PSK) for IKE
// authentication. When IPSec tunnel is enabled, the PSK value must be passed to Antrea Agent
// through an environment variable: ANTREA_IPSEC_PSK.
// Defaults to false.
Expand Down
3 changes: 0 additions & 3 deletions cmd/antrea-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ func (o *Options) validate(args []string) error {
o.config.TunnelType != ovsconfig.GRETunnel && o.config.TunnelType != ovsconfig.STTTunnel {
return fmt.Errorf("tunnel type %s is invalid", o.config.TunnelType)
}
if o.config.EnableIPSecTunnel && o.config.TunnelType != ovsconfig.GRETunnel {
return fmt.Errorf("IPSec encyption is supported only for GRE tunnel")
}
if o.config.OVSDatapathType != string(ovsconfig.OVSDatapathSystem) && o.config.OVSDatapathType != string(ovsconfig.OVSDatapathNetdev) {
return fmt.Errorf("OVS datapath type %s is not supported", o.config.OVSDatapathType)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/design/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ the [Antrea IPsec deployment yaml](/build/yamls/antrea-ipsec.yml), which creates
a Kubernetes Secret to save the PSK value and populates it to the
`ANTREA_IPSEC_PSK` environment variable of the Antrea Agent container.

When IPsec is enabled, Antrea Agent will create a separate GRE tunnel port on
When IPsec is enabled, Antrea Agent will create a separate tunnel port on
the OVS bridge for each remote Node, and write the PSK string and the remote
Node IP address to two OVS interface options of the tunnel interface. Then
`ovs-monitor-ipsec` can detect the tunnel and create IPsec Security Policies
Expand Down
6 changes: 3 additions & 3 deletions docs/ipsec-tunnel.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# IPsec Encryption of Tunnel Traffic with Antrea

Antrea supports encrypting tunnel traffic across Nodes with IPsec ESP. At this
moment, IPsec encyption works only for GRE tunnel (but not Geneve, VXLAN, and
STT tunnel types).
Antrea supports encrypting tunnel traffic across Nodes with IPsec ESP.
IPsec encyption works for all OVS supported tunnel including GRE, Geneve,
VXLAN, and STT tunnel.

## Prerequisites

Expand Down

0 comments on commit d145bfd

Please sign in to comment.