feat(piedmont): route /api/contact to piedmont-contact
Add the contact Deployment and Service, and match PathPrefix /api/contact before the site catch-all so the quote form does not hit nginx.
This commit is contained in:
parent
d8f46972fb
commit
1242f3041e
4 changed files with 73 additions and 0 deletions
52
apps/base/piedmont/deployment-api.yaml
Normal file
52
apps/base/piedmont/deployment-api.yaml
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: piedmont-contact
|
||||||
|
namespace: piedmont
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: piedmont-contact
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: piedmont-contact
|
||||||
|
spec:
|
||||||
|
tolerations:
|
||||||
|
- key: dedicated
|
||||||
|
operator: Exists
|
||||||
|
effect: PreferNoSchedule
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: linode
|
||||||
|
containers:
|
||||||
|
- name: contact-api
|
||||||
|
image: forgejo.siriusdevops.com/sirius/phs-contact:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command: ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8090"]
|
||||||
|
ports:
|
||||||
|
- containerPort: 8090
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: TG_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: piedmont-contact
|
||||||
|
key: TG_TOKEN
|
||||||
|
- name: TG_CHAT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: piedmont-contact
|
||||||
|
key: TG_CHAT
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8090
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
memory: 256Mi
|
||||||
|
|
@ -11,6 +11,13 @@ spec:
|
||||||
- piedmonthomesvc.com
|
- piedmonthomesvc.com
|
||||||
- www.piedmonthomesvc.com
|
- www.piedmonthomesvc.com
|
||||||
rules:
|
rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /api/contact
|
||||||
|
backendRefs:
|
||||||
|
- name: piedmont-contact
|
||||||
|
port: 8090
|
||||||
- matches:
|
- matches:
|
||||||
- path:
|
- path:
|
||||||
type: PathPrefix
|
type: PathPrefix
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,7 @@ kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
|
- deployment-api.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
- service-api.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
|
|
|
||||||
12
apps/base/piedmont/service-api.yaml
Normal file
12
apps/base/piedmont/service-api.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: piedmont-contact
|
||||||
|
namespace: piedmont
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: piedmont-contact
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8090
|
||||||
|
targetPort: 8090
|
||||||
Loading…
Reference in a new issue