Skip to content

Commit

Permalink
Expose service to the web (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcarl authored Nov 19, 2024
1 parent cec2be9 commit d0d93f6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cluster/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ spec:
app: mod-bot
serviceName: "mod-bot"
replicas: 1
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
Expand Down
23 changes: 23 additions & 0 deletions cluster/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mod-bot-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: letsencrypt-prod # Optional, for TLS
spec:
rules:
- host: euno.reactiflux.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mod-bot
port:
number: 80
tls:
- hosts:
- euno.reactiflux.com
secretName: my-tls-secret # Used for HTTPS
13 changes: 13 additions & 0 deletions cluster/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: mod-bot-service
labels:
app: mod-bot
spec:
type: ClusterIP
ports:
- port: 80 # External port
targetPort: 3000 # Port the pod exposes
selector:
app: mod-bot
2 changes: 2 additions & 0 deletions kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace: default
commonLabels:
app: mod-bot
resources:
- cluster/service.yaml
- cluster/deployment.yaml
- cluster/ingress.yaml

configMapGenerator:
- name: k8s-context # this is an internal name
Expand Down

0 comments on commit d0d93f6

Please sign in to comment.