Custom Domains

Dan Pastusek
Apr 26, 2019

We're excited to announce support for custom domains on KubeSail! What this means is you can now expose your running containers under your own hostname, such as example.com rather than under the generated kubesail.io hostname. You can add as many domains as you'd like, even on the free tier!

To do this, you'll first need to verify your domain in the dashboard.

Exposing via the UI

Once verified, you'll find the domain you just added as an option when you click the Expose to Internet (HTTPS) button within the Ports tab of your DeploymentIn Kubernetes, a Deployment is an object which describes how an application is deployed. A Deployment defines the images to launch, how to configure them, and how they should be deployedRead More.... You may expose any subdomain of the domain you verified, so in the example below, we will expose api.stuffbydan.com even though we've only needed to verify the root domain, stuffbydan.com.

Exposing via kubectl

KubeSail currently uses Ambassador which allows you to create standard Kubernetes ServicesA Service describes how to access your applications over the network - either within your namespace or from the Internet. Services point DNS addresses at Pods, and are usually pointed to in turn by an Ingress.Read More... to route traffic based on hostname. To do this, you'll need to add an ambassador annotation to the ServiceA Service describes how to access your applications over the network - either within your namespace or from the Internet. Services point DNS addresses at Pods, and are usually pointed to in turn by an Ingress.Read More...'s metadata, as seen in the below example. Simply modify the yaml to suit your deployment and hostname, and apply!

Apply
apiVersion: v1
kind: Service
metadata:
# Name must be the same as in
# the Ambassador mapping below
name: nginx-http
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: nginx-http.namespace
prefix: "/"
service: http://nginx-http.namespace:8080
host: api.stuffbydan.com
timeout_ms: 30000
use_websocket: true
spec:
ports:
- name: tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: nginx
type: ClusterIP
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Stay in the loop!

Give us a shout on twitter or gitter, checkout some of our GitHub repos and be sure to join our mailing list!