So I've created a GCS bucket, with a simple index.html
file inside;
$ gsutil mb gs://my.bucket.com
$ gsutil cp index.html gs://my.bucket.com
$ gsutil web set -m index.html gs://my.bucket.com
$ gsutil iam ch allUsers:objectViewer gs://my.bucket.com
and I can access the index.html
under: https://storage.googleapis.com/my.bucket.com/index.html
Now I would like to create a Traefik router in k8s cluster and us it with ingress object, like:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: my.bucket.com-redirect
spec:
redirectRegex:
regex: ^https://my.bucket.com/(.*)
replacement: https://storage.googleapis.com/my.bucket.com/${1}
permanent: true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my.bucket.com-ingress
annotations:
traefik.ingress.kubernetes.io/router.middlewares: "mynamespace-my.bucket.com-redirect@kubernetescrd"
spec:
ingressClassName: traefik
tls:
- hosts:
- my.bucket.com
secretName: sedcret-name
rules:
- host: my.bucket.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
# This is not actually used by needed to validate manifest
name: placeholder
port:
number: 80
The DNS is set in place, and requests to my.bucket.com
are visible in traefik logs, but it is always 404
(when I specify /
or index.html
)
(The SSL certificate is added correctly also, not sure if that is relevant)
What am I missing? What might be blocking this or causing 404
error?