【发布时间】:2019-09-25 21:34:05
【问题描述】:
我在 GKE 上的 Kubernetes 上公开公开了一个简单的 Web 服务器,并注册了一个域。我希望为此添加 TLS,以便可以通过 HTTPS 访问它。我听说过很多关于使用 Let's Encrypt 并最终尝试这样做:https://github.com/jetstack/cert-manager/blob/master/docs/tutorials/acme/quick-start/index.rst,但发现它完全压倒性的。鉴于我的部署只是一个服务和 pod,是否有更简单的方法来使用 Let's Encrypt?
我使用的配置是:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
labels:
app: web
spec:
replicas: 1
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: gcr.io/my-repo
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /healthz
port: 8080
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /healthz
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: web-balancer-service
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
run: web
type: NodePort
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress-app
spec:
rules:
- host: my.domain.com
http:
paths:
- path: /*
backend:
serviceName: web-balancer-service
servicePort: 8080
=========================================
编辑:按照@Utku Özdemir 的建议,我尝试将这些更改编入 YAML。我用
创建了 IP 地址gcloud compute addresses create example-ip-address --global
证书和配置:https://gist.github.com/nickponline/ab74d3d179e21474551b7596c6478eea
一切都正确设置,但是当我用kubectl describe ManagedCertificates example-certificate 检查 ManagedCertificates 时说
Spec:
Domains:
app.domain.xyz
Status:
Certificate Name: xxxxxxxxxxxxxxxxxx
Certificate Status: Provisioning
Domain Status:
Domain: app.domain
Status: FailedNotVisible
Events: <none>
我已经等了 24 小时,所以假设这不会改变。
【问题讨论】:
标签: kubernetes lets-encrypt kubernetes-ingress