update readme to use the published chart (#38)

This commit is contained in:
Marco Vito Moscaritolo 2020-06-21 18:49:51 +02:00 committed by GitHub
parent 20b498f76c
commit 9e562e9bb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,42 +1,45 @@
# Caddy Ingress Controller # Caddy Ingress Controller
This is the Kubernetes Ingress Controller for Caddy. It includes functionality for monitoring This is the Kubernetes Ingress Controller for Caddy. It includes functionality
Ingress resources on a Kubernetes cluster and includes support for providing automatic HTTPS for monitoring `Ingress` resources on a Kubernetes cluster and includes support
certificates for all hostnames defined in ingress resources that it is managing. for providing automatic HTTPS certificates for all hostnames defined in ingress
resources that it is managing.
**The community is looking for maintainers with Kubernetes experience who can commit to help finish the development of this tool.** Please get involved!
## Cloud Provider Setup (AWS, GCLOUD, ETC...) ## Cloud Provider Setup (AWS, GCLOUD, ETC...)
In the Kubernetes folder a Helm Chart is provided to make installing the Caddy Ingress Controller In the `charts` folder a Helm Chart is provided to make installing the Caddy
on a Kubernetes cluster straight forward. To install the Caddy Ingress Controller adhere to the Ingress Controller on a Kubernetes cluster straight forward. To install the
following steps: Caddy Ingress Controller adhere to the following steps:
1. Create a new namespace in your cluster to isolate all Caddy resources. 1. Create a new namespace in your cluster to isolate all Caddy resources.
```sh ```sh
kubectl apply -f ./kubernetes/deploy/00_namespace.yaml kubectl create namespace caddy-system
``` ```
2. Install the Helm Chart. (If you do not want automatic https set `autotls` to false and do not include 2. Install the Helm Chart.
your email address as a value to the helm chart.)
```sh ```sh
helm template \ helm install \
--namespace=caddy-system ./kubernetes/helm/caddyingresscontroller/ \ --namespace=caddy-system \
--set autotls=true \ --repo https://caddyserver.github.io/ingress/ \
--set email=youremail@test.com | kubectl apply -f - --atomic \
--set image.tag=latest
mycaddy \
caddy-ingress-controller
``` ```
The helm chart will create a service of type `LoadBalancer` in the `caddy-system` namespace on your cluster. You'll want to The helm chart create a service of type `LoadBalancer` in the `caddy-system`
set any DNS records for accessing this cluster to the external IP address of this LoadBalancer when the namespace on your cluster. You'll want to set any DNS records for accessing this
external IP is provisioned by your cloud provider. cluster to the external IP address of this `LoadBalancer` when the external IP
is provisioned by your cloud provider.
You can get the external IP address with `kubectl get svc -n caddy-system` You can get the external IP address with `kubectl get svc -n caddy-system`
## Debugging ## Debugging
To view any logs generated by Caddy or the Ingress Controller you can view the pod logs of the Caddy Ingress Controller. To view any logs generated by Caddy or the Ingress Controller you can view the
pod logs of the Caddy Ingress Controller.
Get the pod name with: Get the pod name with:
@ -52,28 +55,28 @@ kubectl logs <pod-name> -n caddy-system
## Automatic HTTPS ## Automatic HTTPS
By default, any hosts defined in an ingress resource will configure caddy to automatically get certificates from let's encrypt and To enable automatic https via ingress controller using Let's Encrypt you can set
will serve your side over HTTPS. the argument `ingressController.autotls=true` and the email to use
`ingressController.email=your@email.com` on the caddy ingress controller helm
To disable automattic https you can set the argument `tls` on the caddy ingress controller to `false`. chart values.
Example: Example:
Add args `tls=false` to the deployment. - `--set ingressController.autotls=true`
- `--set ingressController.email=your@email.com`
``` when you execute the helm-chart installation.
args:
- -tls=false
```
## Bringing Your Own Certificates ## Bringing Your Own Certificates
If you would like to disable automatic HTTPS for a specific host and use your own certificates you can create a new TLS secret in Kubernetes and define If you would like to disable automatic HTTPS for a specific host and use your
what certificates to use when serving your application on the ingress resource. own certificates you can create a new TLS secret in Kubernetes and define what
certificates to use when serving your application on the ingress resource.
Example: Example:
Create TLS secret `mycerts`, where `./tls.key` and `./tls.crt` are valid certificates for `test.com`. Create TLS secret `mycerts`, where `./tls.key` and `./tls.crt` are valid
certificates for `test.com`.
``` ```
kubectl create secret tls mycerts --key ./tls.key --cert ./tls.crt kubectl create secret tls mycerts --key ./tls.key --cert ./tls.crt
@ -99,4 +102,4 @@ spec:
- hosts: - hosts:
- test.com - test.com
secretName: mycerts # use mycerts for host test.com secretName: mycerts # use mycerts for host test.com
``` ```