79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: goredirect
|
|
namespace: hackerspace
|
|
spec:
|
|
replicas: 2
|
|
revisionHistoryLimit: 0
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: goredirect
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: goredirect
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- podAffinityTerm:
|
|
labelSelector:
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/name
|
|
operator: In
|
|
values:
|
|
- goredirect
|
|
topologyKey: topology.kubernetes.io/zone
|
|
weight: 100
|
|
containers:
|
|
- image: harbor.k-space.ee/k-space/goredirect:latest
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: GOREDIRECT_NOT_FOUND
|
|
value: https://inventory.k-space.ee/m/inventory/add-slug/%s
|
|
- name: GOREDIRECT_FOUND
|
|
value: https://inventory.k-space.ee/m/inventory/%s/view
|
|
- name: GOREDIRECT_NOPATH
|
|
value: https://inventory.k-space.ee/m/inventory
|
|
- name: MONGO_URI
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MONGO_URI
|
|
name: inventory-mongodb
|
|
name: goredirect
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
protocol: TCP
|
|
resources:
|
|
limits:
|
|
cpu: "1"
|
|
memory: 500Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 200Mi
|
|
securityContext:
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: goredirect
|
|
annotations:
|
|
external-dns.alpha.kubernetes.io/hostname: k6.ee
|
|
metallb.universe.tf/address-pool: elisa
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: 8080
|
|
nodePort: 32120
|
|
selector:
|
|
app.kubernetes.io/name: goredirect
|
|
type: LoadBalancer
|
|
externalTrafficPolicy: Local
|