This repository was archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
This repository was archived by the owner on Mar 19, 2024. It is now read-only.
HTTPRoute automatic service intention config entry #532
Copy link
Copy link
Open
Labels
runtime/kubernetesDeployed on self-managed KubernetesDeployed on self-managed Kubernetestype/bugSomething isn't workingSomething isn't working
Description
Overview of the Issue
Applying an HTTPRoute
automatically creates an accompanying service intention config entry for the destination service directly through the Consul API.
Attempting to manage the service intentions for the same destination service afterwards, using a ServiceIntentions
custom resource, will silently fail as the Consul K8s controller responsible for reconciliation of ServiceIntentions
does not merge an existing config entry.
Reproduction Steps
- Create API-Gateway CRDs
helm install consul ...
- Deploy API Gateway resource
agw
- Deploy
public-api
service - Create
HTTPRoute
forpublic-api
- Deploy
frontend
service - Attempt to create
ServiceIntentions
forpublic-api
to addfrontend
to sources array
Logs
Logs
config entry output after HTTPRoute creation:
#consul config read -kind=service-intentions -namespace=hashicups -name=public-api
{
"Kind": "service-intentions",
"Name": "public-api",
"Partition": "default",
"Namespace": "hashicups",
"Sources": [
{
"Name": "agw",
"Partition": "default",
"Namespace": "api-gateway",
"Action": "allow",
"Precedence": 9,
"Type": "consul",
"Description": "Allow traffic from Consul API Gateway. Reconciled by controller at 2023-03-10T23:29:36Z."
}
],
"CreateIndex": 7252,
"ModifyIndex": 7252
}
output from 'kubectl logs':
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector 2023-03-10T23:38:34.028Z ERROR controller.serviceintentions Reconciler error {"reconciler group": "consul.hashicorp.com", "reconciler kind": "ServiceIntentions", "name": "public-api", "namespace": "hashicups", "error": "config entry already exists in Consul"}
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector /home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.2/pkg/internal/controller/controller.go:266
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector /home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.2/pkg/internal/controller/controller.go:227
consul-connect-injector-7c8985d9fb-cpq6s sidecar-injector 2023-03-10T23:38:34.055Z ERROR controller.serviceintentions sync failed {"request": "hashicups/public-api", "error": "config entry already exists in Consul"}
Expected behavior
Capability to create an HTTPRoute
while maintaining the ability to define [additional] service intentions for the same destination service through the ServiceIntentions
CRD.
Environment details
consul-api-gateway
version: 0.5.1- configuration used to deploy the gateway controller:
# consul 1.0.4 helm chart apiGateway: enabled: true image: hashicorp/consul-api-gateway:0.5.1 imageEnvoy: envoyproxy/envoy:v1.24.2
- Kubernetes version: v1.23.12
- Consul Server version: hashicorp/consul-enterprise:1.14.4-ent-ubi
- Consul-K8s version: hashicorp/consul-k8s-control-plane:1.0.4-ubi
- Cloud Provider: OpenShift 4.10.40
- Networking CNI plugin in use: OpenShift SDN with Multus + Consul CNI
elliottnichols and codex70
Metadata
Metadata
Assignees
Labels
runtime/kubernetesDeployed on self-managed KubernetesDeployed on self-managed Kubernetestype/bugSomething isn't workingSomething isn't working