Exposing URLs

Publicly exposing endpoints

📘

Note

Public URLs can only have the pattern {custom_part}-{env.unique}.bunnyenv.com, meaning you must include the Environment's unique identifier and use the bunnyenv.com domain.

Exposing URLs for Helm and Kubernetes Manifest

When you control the manifests which are being deployed, all you need to do is add the the ingressClassName with nginx value on the Ingress resources for which you want Bunnyshell to automatically create the DNS records. The rest of Ingresses will be ignored by Bunnyshell when creating DNS records.

Exposing URLs for Docker-compose

Having exposed URLs for Applications and Services boils down to declaring a hosts property at Component level.

Bunnyshell will create Ingresses in Kubernetes, as well as the DNS records for all exposed hosts.

📘

Hostnames with self-managed DNS records

If you want to use an external to Bunnyshell domain (ie. stage.my-company.tld), you need to set the attribute selfManagedDns: true on the Host entry.

components:
    - kind: Application
      name: demo_app
      ...
      hosts:
          -
            hostname: backend-{{env.base_domain}}
            path: /
            servicePort: 8080
            public: null

Exposing non-Kubernetes components

In order to expose under Bunnyshell URls (.bunnyenv.com ) components that are not deployed in a Kubernetes cluster (ie. applications deployed externally with GenericComponents), one could use the externalAddress Host attribute.

kind: GenericComponent
name: api-gateway
dockerCompose:
  image: alpine
deploy:
  - export MY_HOST="example.com"
exportVariables:
  - MY_HOST
hosts:
  - hostname: 'gateway-{{env.base_domain}}'
    externalAddress: '{{components.gen.exported.MY_HOST}}'
    path: /api