This repository has been archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b1527e
commit 3505aff
Showing
4 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# kube-lego example | ||
|
||
This document demonstrates how to deploy kube-lego to the | ||
[HAProxy Ingress](https://github.com/jcmoraisjr/haproxy-ingress) controller. | ||
|
||
## Deploy the Ingress controller | ||
|
||
Follow the [deployment instructions](https://github.com/kubernetes/ingress/tree/master/examples/deployment/haproxy) | ||
including the deployment of the optional web app for testing. | ||
|
||
## Deploy kube-lego | ||
|
||
The following instruction will create the kube-lego deployment on it's own namespace. | ||
Be aware that kube-lego creates it's related service on its own. | ||
|
||
* Change `LEGO_EMAIL` to your email address | ||
* Uncomment `LEGO_URL` to use the production API | ||
|
||
```console | ||
kubectl create ns kube-lego | ||
kubectl create -f deployment.yaml | ||
``` | ||
|
||
## Enable kube-lego in the testing application | ||
|
||
This will add a TLS secret name and tls-acme annotation to the ingress resource created | ||
in the deployment instruction. | ||
|
||
* Change both `echo.example.com` to the public domain of your Ingress controller | ||
|
||
```console | ||
kubectl replace -f app-ingress.yaml | ||
``` | ||
|
||
The `app-tls` secret and the https url should be updated. Check the log output of | ||
HAProxy Ingress and kube-lego pods if this doesn't happen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: app | ||
annotations: | ||
kubernetes.io/tls-acme: "true" | ||
kubernetes.io/ingress.class: "haproxy" | ||
spec: | ||
tls: | ||
- hosts: | ||
- echo.example.com | ||
secretName: app-tls | ||
rules: | ||
- host: echo.example.com | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: http-svc | ||
servicePort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: kube-lego | ||
namespace: kube-lego | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: kube-lego | ||
template: | ||
metadata: | ||
labels: | ||
app: kube-lego | ||
spec: | ||
containers: | ||
- name: kube-lego | ||
## HAProxy support isn't on the stable release yet! | ||
image: jetstack/kube-lego:canary | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
## Use HAProxy Ingress | ||
- name: LEGO_DEFAULT_INGRESS_CLASS | ||
value: haproxy | ||
## Specify your email address | ||
- name: LEGO_EMAIL | ||
value: [email protected] | ||
## Uncomment LEGO_URL to use the production API - default is to use staging | ||
# - name: LEGO_URL | ||
# value: https://acme-v01.api.letsencrypt.org/directory | ||
- name: LEGO_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: LEGO_POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8080 | ||
initialDelaySeconds: 5 | ||
timeoutSeconds: 1 |