kubernetes apigatewayv 2-控制器和HTTP头管理

xe55xuns  于 2023-05-22  发布在  Kubernetes
关注(0)|答案(1)|浏览(168)

我尝试通过控制器管理我的AWS HTTP API网关及其资源。我得到了一个混乱,由于操纵的HTTP头。
我需要覆盖标题Host: my.local.host
我使用Integration清单来管理它:

apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
  name: integration-my
  namespace: rental-connect
spec:
  apiRef:
    from:
      name: adopt-api-gateway-my
  connectionID: id
  integrationType: HTTP_PROXY
  connectionType: VPC_LINK
  integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
  integrationMethod: ANY
  payloadFormatVersion: "1.0"
  requestParameters: <here I need help>

我想requestParameters可以帮助我。但我完全不知道我可以用什么格式来使用它。
有什么想法吗

ruoxqz4g

ruoxqz4g1#

我自己找到了一个解决办法:

apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
  name: integration-my
  namespace: rental-connect
spec:
  apiRef:
    from:
      name: adopt-api-gateway-my
  connectionID: id
  integrationType: HTTP_PROXY
  connectionType: VPC_LINK
  integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
  integrationMethod: ANY
  payloadFormatVersion: "1.0"
  requestParameters: {"overwrite:header.Host": "my.hostname.com"}

相关问题