MyGit

caddyserver/ingress

Fork: 70 Star: 658 (更新于 2024-10-26 00:01:43)

license: Apache-2.0

Language: Go .

WIP Caddy 2 ingress controller for Kubernetes

最后发布版本: caddy-ingress-controller-1.1.0 ( 2023-11-21 03:41:58)

GitHub网址

Caddy Ingress Controller

This is the Kubernetes Ingress Controller for Caddy. It includes functionality for monitoring Ingress resources on a Kubernetes cluster and includes support for providing automatic HTTPS certificates for all hostnames defined in the ingress resources that it is managing.

Prerequisites

  • Helm 3+
  • Kubernetes 1.19+

Setup

In the charts folder, a Helm Chart is provided to make installing the Caddy Ingress Controller on a Kubernetes cluster straightforward. To install the Caddy Ingress Controller adhere to the following steps:

  1. Create a new namespace in your cluster to isolate all Caddy resources.
kubectl create namespace caddy-system
  1. Install the Helm Chart.
helm install \
  --namespace=caddy-system \
  --repo https://caddyserver.github.io/ingress/ \
  --atomic \
  mycaddy \
  caddy-ingress-controller

Or

  1. Generate kubernetes yaml file.
git clone https://github.com/caddyserver/ingress.git
cd ingress

# generate the yaml file
helm template mycaddy ./charts/caddy-ingress-controller \
  --namespace=caddy-system \
  > mycaddy.yaml

# apply the file
kubectl apply -f mycaddy.yaml

This will create a service of type LoadBalancer in the caddy-system namespace on your cluster. You'll want to set any DNS records for accessing this 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

  1. Alternate installation method: Glasskube

To install the Caddy ingress controller using Glasskube, you can select "caddy-ingress-controller" from the "ClusterPackages" tab in the Glasskube GUI then click "install" or you can run the following command:

glasskube install caddy-ingress-controller

Add an email address in the package configuration section in the UI to enable automatic HTTPS, or run:

glasskube install caddy-ingress-controller --value "automaticHTTPS=your@email.com"

Debugging

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:

kubectl get pods -n caddy-system

View the pod logs:

kubectl logs <pod-name> -n caddy-system

Automatic HTTPS

To have automatic HTTPS (not to be confused with On-demand TLS), you simply have to specify your email in the config map. When using Helm chart, you can add --set ingressController.config.email=your@email.com when installing.

On-Demand TLS

On-demand TLS can generate SSL certs on the fly and can be enabled in this controller by setting the onDemandTLS config to true:

helm install ...\
  --set ingressController.config.onDemandTLS=true

You can also specify options for the on-demand config: onDemandRateLimitInterval, onDemandRateLimitBurst and onDemandAsk

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 what certificates to use when serving your application on the ingress resource.

Example:

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
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example
  annotations:
    kubernetes.io/ingress.class: caddy
spec:
  rules:
  - host: test.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 8080
  tls:
    - secretName: mycerts # use mycerts for host test.com
      hosts:
        - test.com

Contribution

Learn how to start contributing on the Contributing Guidline.

License

Apache License 2.0

最近版本更新:(数据更新于 2024-09-21 22:29:12)

2023-11-21 03:41:58 caddy-ingress-controller-1.1.0

2023-11-21 03:33:22 v0.2.1

2023-11-21 03:05:15 v0.2.0

2023-06-03 01:14:00 caddy-ingress-controller-1.0.5

2023-06-03 01:08:17 v0.1.5

2023-02-16 05:08:40 caddy-ingress-controller-1.0.4

2022-12-09 14:37:46 v0.1.4

2022-08-23 04:09:22 caddy-ingress-controller-1.0.3

2022-08-23 04:01:12 v0.1.3

2022-08-23 03:36:23 caddy-ingress-controller-1.0.2

主题(topics):

docker, hacktoberfest, hacktoberfest2023, helm, ingress, kubernetes, kubernetes-ingress, kubernetes-ingress-controller

caddyserver/ingress同语言 Go最近更新仓库

2024-11-06 03:37:39 containerd/containerd

2024-11-05 20:42:00 aurora-develop/aurora

2024-11-05 08:55:31 XTLS/Xray-core

2024-11-05 00:03:47 SagerNet/sing-box

2024-11-04 20:34:19 Permify/permify

2024-11-03 20:10:56 flipped-aurora/gin-vue-admin