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

envoy: Add host identity (nphds) gRPC client #3407

Merged
merged 4 commits into from
Mar 30, 2018
Merged

Conversation

jrajahalme
Copy link
Member

Adding the gRPC client for NPHDS makes the destination identity available for
L3-dependent egress policy enforcement.

Refactor gRPC subscription code to share it for host IP - security ID mapping.

We never supported using more than one "xdsCluster", hard code it so
that we don't need to keep configuring it from all filter instances.

Change "bpf_root" default to an empty string, and do not use bfp if
"bpf_root" is not configured.

Do not try to remove proxymap entries if we don't know the proxy_port
(zero proxy_port implies no bpf).

NOTE: Ian's xds cache fix (#3403) is cherry-picked here to be able to test this in CI.

@jrajahalme jrajahalme added pending-review kind/feature This introduces new functionality. area/proxy Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers. labels Mar 30, 2018
@jrajahalme jrajahalme requested review from ianvernon and a team as code owners March 30, 2018 01:17
@@ -38,21 +41,33 @@ func (m *BpfMetadata) GetIsIngress() bool {
return false
}

func (m *BpfMetadata) GetApiConfigSource() *envoy_api_v2_core2.ApiConfigSource {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method BpfMetadata.GetApiConfigSource should have comment or be unexported
func GetApiConfigSource should be GetAPIConfigSource

@@ -17,6 +18,8 @@ type BpfMetadata struct {
BpfRoot string `protobuf:"bytes,1,opt,name=bpf_root,json=bpfRoot" json:"bpf_root,omitempty"`
// 'true' if the filter is on ingress listener, 'false' for egress listener.
IsIngress bool `protobuf:"varint,2,opt,name=is_ingress,json=isIngress" json:"is_ingress,omitempty"`
// gRPC API config source for policy host mapping
ApiConfigSource *envoy_api_v2_core2.ApiConfigSource `protobuf:"bytes,3,opt,name=api_config_source,json=apiConfigSource" json:"api_config_source,omitempty"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct field ApiConfigSource should be APIConfigSource

@jrajahalme
Copy link
Member Author

test-me-please

@jrajahalme jrajahalme force-pushed the envoy-host-identity-client branch from 90339e9 to f5ef252 Compare March 30, 2018 02:24
@@ -107,11 +107,11 @@ func (m *PortNetworkPolicy) GetPort() uint32 {
return 0
}

func (m *PortNetworkPolicy) GetProtocol() envoy_api_v2_core3.SocketAddress_Protocol {
func (m *PortNetworkPolicy) GetProtocol() envoy_api_v2_core.SocketAddress_Protocol {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method PortNetworkPolicy.GetProtocol should have comment or be unexported

jrajahalme and others added 4 commits March 29, 2018 19:25
Refactor gRPC subscription code to share it for host IP - security ID mapping.

We never supported using more than one "xdsCluster", hard code it so
that we don't need to keep configuring it from all filter instances.

Change "bpf_root" default to an empty string, and do not use bfp if
"bpf_root" is not configured.

Do not try to remove proxymap entries if we don't know the proxy_port
(zero proxy_port implies no bpf).

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
No resources means we should delete all cached policies, rather than
return without doing anything.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Running Envoy tests under gdb requires the sources to be available via
'external'. It should be created as a symlink to
'bazel-envoy/external' once bazel has fetched the dependencies.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
…dentity update for IP

If the identity is updated for an endpoint, the XDS cache not only needs to have the new
identity to list of IPs mapping updated, it needs to have the old identity to IP mapping
updated as well to account that the IP for which a key-value store Create or Modify event
no longer maps to its old identity. Delete the identity from the XDS cache if it no longer
maps to any IPs in the IPIdentityCache, or update it with the list of IPs that it still
maps to.

Signed-off by: Ian Vernon <ian@cilium.io>
@jrajahalme jrajahalme force-pushed the envoy-host-identity-client branch from f5ef252 to 7226738 Compare March 30, 2018 02:25
@jrajahalme
Copy link
Member Author

test-me-please

@tgraf tgraf merged commit f8c58b0 into master Mar 30, 2018
@tgraf tgraf deleted the envoy-host-identity-client branch March 30, 2018 14:07
@rlenglet rlenglet mentioned this pull request Mar 30, 2018
30 tasks
@tgraf tgraf added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/proxy Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers. kind/feature This introduces new functionality. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants