S3 access using Kong Ingress

We are trying to access docs stored in S3 bucket located outside the Kubernetes Cluster using an Ingress. Here are the k8s service and ingress, getting 404 error response with message “The specified bucket does not exist” with bucket name being k8s cluster DNS name.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    konghq.com/strip-path: "true"
    kubernetes.io/ingress.class: kong
  name: s3access
  namespace: tst
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: s3access
          servicePort: 80
        path: /foo/*
apiVersion: v1
kind: Service
metadata:
  name: s3access
  namespace: tst
spec:
  externalName: online-docs01.s3-website-us-west-2.amazonaws.com
  ports:
  - protocol: TCP
    targetPort: 80
  type: ExternalName

Our default behavior is to preserve the Host header sent by the client. You’ll need to add https://docs.konghq.com/kubernetes-ingress-controller/1.0.x/references/annotations/#konghqcompreserve-host to your Ingress and set it to false to send the hostname in your Service.

@traines thanks for the quick response, we were able to resolve the issue by setting the annotation to false.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ