Exposing URLs
Publicly exposing endpoints
NotePublic 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 bns-nginx value and component specific labels 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 recordsIf you want to use an external to Bunnyshell domain (ie.
stage.my-company.tld), you need to set the attributeselfManagedDns: trueon the Host entry. See more about Custom domains.
components:
- kind: Application
name: demo_app
...
hosts:
-
hostname: backend-{{env.base_domain}}
path: /
servicePort: 8080
public: nullExposing 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: /apiUpdated 3 months ago
