Closed Khuman2 closed 1 year ago
@Khuman2 It looks like you pre-created the API using the AWS Console for API Gateway v2, yes? If that is the case, and you want to have ACK take over the management of that API, you need to use the AdoptedResource
functionality. You can read about that here: https://aws-controllers-k8s.github.io/community/docs/user-docs/adopted-resource/
Alternately, you can use the ACK apigatewayv2-controller to create API Gateways (and Routes, Integrations, etc) entirely from scratch using YAML manifests for all of those subobjects. You can read about how to do that in this tutorial: https://aws-controllers-k8s.github.io/community/docs/tutorials/apigatewayv2-reference-example/
I think the bug shown in this particular issue is due to the API already existing in the AWS APIGatewayV2 service and the controller not properly handling the Duplicate key error.
@jaypipes the serialization error is a little bit weird, normally we should throw a NotManagedError
(resource already exist but is not managed by ACK...)
@jaypipes, I would like to know the best practice on how to use the apigateway controller. Let me share my use case. Actually, I need to realize approach that described in the article I manage my infrastructure by terraform. In a private subnet, behind internal ALB my services are located. My idea was to create API gateway, and attach certificates from ACM and private VPC link by terraform. In the service's git I want to store manifest files per service for handling service APIGateway integrations, k8s services, ingresses for ALB etc. I've tried to use Integration and Route from the operator, but it doesn't find API.
---
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
name: "awesome-service-integration"
namespace: "service-namespace"
spec:
apiRef:
from:
name: "test-api-gateway-http-vpc-links"
integrationType: HTTP_PROXY
integrationURI: "arn:aws:elasticloadbalancing:region:profile_id:listener/my_ALB_internal_listener_path"
integrationMethod: ANY
payloadFormatVersion: "1.0"
---
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Route
metadata:
name: "awesome-service-route"
namespace: "service-namespace"
spec:
apiRef:
from:
name: "test-api-gateway-http-vpc-links"
routeKey: "ANY /ack-route-key"
targetRef:
from:
name: "awesome-service-integration"
But I got an error: "can't find API" So, my question is my use case have chance for been alive, or have I got something wrong? Thanks for the advice!
I've reused AdoptedResource
for my API Gateway. It works fine.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale
Resolving this -- please reopen if there are any further concerns.
Describe the bug We tried to use the AWS API gateway with a Private link and private ALB inside our private subnet. Our goal is to manage by API Gateway's route and integrations by apigatewayv2-controller During implementation, we got an error from apigatewayv2-controller:
Steps to reproduce Create HTTP API Gateway in AWS like in the picture: Integrations look like this:
Deploy apigatewayv2-controller v1.0.0 by the helm with values:
Apply manifests:
Expected outcome I can't imagine the outcome, to be honest. But error, I guess isn't the positive result ;)
Environment