Skip to content

Commit

Permalink
Add an API for active job posts (#427)
Browse files Browse the repository at this point in the history
* Expose http ingress in k8s

* Update tsconfig target & module

* Webserver deps

* Use node 22

* Modernized or whatever

* Dummy server

* Serve stored messages from API
  • Loading branch information
vcarl authored Jan 9, 2025
1 parent 6a6fb79 commit f055545
Show file tree
Hide file tree
Showing 11 changed files with 1,389 additions and 36 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: { sourceType: "module" },
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# TODO: see if we need to do anything special to cache docker images
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22
cache: npm

- name: Login to GitHub Container Registry
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: reactibot-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: letsencrypt-prod # Optional, for TLS
spec:
rules:
- host: api.reactiflux.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: reactibot
port:
number: 80
tls:
- hosts:
- api.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: reactibot-service
labels:
app: reactibot
spec:
type: ClusterIP
ports:
- port: 80 # External port
targetPort: 3000 # Port the pod exposes
selector:
app: reactibot
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: reactibot
resources:
- cluster/service.yaml
- cluster/deployment.yaml
- cluster/ingress.yaml

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

0 comments on commit f055545

Please sign in to comment.