Skip to content

Commit b6efec3

Browse files
authoredNov 19, 2024··
Update k8s to enable HTTP ingress to the service (#86)
This lets us run a regular-ol website, for instance, and use Discord interaction webhooks. Interaction webhooks will unblock #59 and resolve #84
1 parent d0d93f6 commit b6efec3

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed
 

‎.github/workflows/node.js.yml

-11
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ jobs:
7474
- name: Set up Docker Buildx
7575
uses: docker/setup-buildx-action@v3
7676

77-
# Setup cache
78-
- name: Cache Docker layers
79-
uses: actions/cache@v2
80-
with:
81-
path: /tmp/.buildx-cache
82-
key: ${{ runner.os }}-buildx-${{ github.sha }}
83-
restore-keys: |
84-
${{ runner.os }}-buildx-
85-
8677
- name: Login to GitHub Container Registry
8778
uses: docker/login-action@v3
8879
with:
@@ -108,8 +99,6 @@ jobs:
10899
push: ${{github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/actions'}}
109100
tags: ${{ steps.meta.outputs.tags }}
110101
labels: ${{ steps.meta.outputs.labels }}
111-
cache-from: type=gha
112-
cache-to: type=gha,mode=max
113102

114103
deployment:
115104
needs: build

‎cluster/cluster-issuer.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# I believe this only needed to be run once on the cluster as a whole, to make
2+
# a LetsEncrypt service available. That was done with:
3+
# kubectl apply -f cluster/cluster-issuer.yaml
4+
apiVersion: cert-manager.io/v1
5+
kind: ClusterIssuer
6+
metadata:
7+
name: letsencrypt-prod
8+
spec:
9+
acme:
10+
server: https://acme-v02.api.letsencrypt.org/directory
11+
email: vcarl@reactiflux.com
12+
privateKeySecretRef:
13+
name: letsencrypt-prod-key
14+
solvers:
15+
- http01:
16+
ingress:
17+
class: nginx

‎cluster/ingress.yaml

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ kind: Ingress
33
metadata:
44
name: mod-bot-ingress
55
annotations:
6-
nginx.ingress.kubernetes.io/rewrite-target: /
7-
cert-manager.io/cluster-issuer: letsencrypt-prod # Optional, for TLS
6+
nginx.ingress.kubernetes.io/ssl-redirect: "true"
7+
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
8+
nginx.ingress.kubernetes.io/hsts: "true"
9+
nginx.ingress.kubernetes.io/hsts-max-age: "31536000"
10+
nginx.ingress.kubernetes.io/hsts-include-subdomains: "true"
11+
cert-manager.io/cluster-issuer: letsencrypt-prod
812
spec:
13+
ingressClassName: nginx
914
rules:
1015
- host: euno.reactiflux.com
1116
http:
@@ -14,10 +19,10 @@ spec:
1419
pathType: Prefix
1520
backend:
1621
service:
17-
name: mod-bot
22+
name: mod-bot-service
1823
port:
1924
number: 80
2025
tls:
2126
- hosts:
2227
- euno.reactiflux.com
23-
secretName: my-tls-secret # Used for HTTPS
28+
secretName: letsencrypt-prod-key

0 commit comments

Comments
 (0)
Please sign in to comment.