Frequently Asked Questions
Note
If you have a question that is not answered here, please open an issue. I will do my best to answer it and add it to this list if it occurs frequently
How do I configure local DNS?
Note
KSail
will add support for managing local certificates in the future, but for now this is not supported. You can still solve this yourself via for example mkcert to generate and install local certificates for your domain, and then add the CA
certificate to the Ingress or Gateway resources.
Are you struggling to access your local services hosted in Kubernetes? Do you want to access services via Ingress routes or Gateways, instead of port-forwarding? This is a common issue when using Kubernetes on a local machine, as the services are not accessible without an open host port, and a correctly configured /etc/hosts
file.
There are a few options to resolve this issue, depending on your setup and preferences. Below are some options to configure local DNS for your Kubernetes Ingress routes and Gateway services.
Option 1: Use traefik.me
to resolve *.traefik.me
to 127.0.0.1
Important
This options is only applicable if you have a public internet connection and are using traefik.me
as your top-level domain (TLD).
The easiest option is to use a public DNS service like traefik.me, which allows you to resolve wildcard domains to localhost. To do so all you need to do is to:
- Ensure your chosen distribution has an open host port to the
LoadBalancer
orHostPort Service
used by your chosen Ingress controller, or Gateway Controller (e.g. Traefik, Cilium, etc). - Configure your Ingress routes or Gateway services to use the
*.traefik.me
domain.
That’s it! You can now access your services via https://<your-service-name>.traefik.me
without needing to configure your /etc/hosts
file.
Options 2: Configure your /etc/hosts
file
If you don’t want to use a public DNS service, or you are using a different TLD, you can configure your /etc/hosts
file to resolve your Ingress routes and Gateway services to localhost. To do so, follow these steps:
- Ensure your chosen distribution has an open host port to the
LoadBalancer
orHostPort Service
used by your chosen Ingress controller, or Gateway Controller (e.g. Traefik, Cilium, etc). - Open your
/etc/hosts
file in a text editor. You may need to usesudo
to edit the file. -
Add the following lines to the file, replacing
<your-service-name>
with the name of your service, and<your-domain>
with your chosen TLD:127.0.0.1 <your-service-name>.<your-domain>
- Save the file and exit the text editor.
That’s it! You can now access your services via http://<your-service-name>.<your-domain>
.
Can I use KSail to manage my existing Kubernetes cluster?
Yes, KSail can be used to interact with an existing Kubernetes cluster, provided it aligns with KSail’s supported configurations. KSail is designed to integrate seamlessly with Kubernetes by leveraging standard kubeconfig files and contexts. This means you can use KSail to manage workloads and resources on an existing cluster without requiring a fresh setup. However, commands related to cluster provisioning and lifecycle management—such as ksail init
, ksail up
, ksail down
, ksail stop
, and ksail start
—are intended for clusters created through supported providers and may not apply to pre-existing clusters.
To use KSail with an existing cluster, ensure the correct kubeconfig and context are set. You can specify these via the CLI options --kubeconfig
and --context
, or by generating a ksail.yaml
configuration file for your cluster using the ksail gen config
command.
KSail supports various operations on existing clusters, such as:
ksail status
- Check cluster status.ksail update
- Update manifest files.ksail validate
- Validate configurations.ksail debug
- Connect to a cluster to debug issues.ksail gen
- Generate manifests.ksail secrets
- Manage SOPS-encrypted secrets.