You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weather/deployment.yml

126 lines
2.7 KiB

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: weather
namespace: weather
labels:
app: weather
spec:
replicas: 1
selector:
matchLabels:
app: weather
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
minReadySeconds: 120
template:
metadata:
labels:
app: weather
spec:
containers:
- name: pgbouncer
image: timoha/pgbouncer:1.15.0
resources:
requests:
memory: "256Mi"
cpu: "0.5"
limits:
memory: "512Mi"
cpu: "1"
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: weather
key: pgbouncer_url
- name: SERVER_TLS_SSLMODE
valueFrom:
secretKeyRef:
name: weather
key: pgbouncer_ssl
- name: AUTH_TYPE
valueFrom:
secretKeyRef:
name: weather
key: pgbouncer_auth
ports:
- containerPort: 5432
- name: weather
image: <IMAGE>
resources:
requests:
memory: "256Mi"
cpu: "0.5"
limits:
memory: "512Mi"
cpu: "1"
ports:
- containerPort: 8080
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: weather
key: database_url
- name: MQTT_HOST
valueFrom:
secretKeyRef:
name: weather
key: mqtt_host
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
name: weather
key: mqtt_password
- name: MQTT_USER
valueFrom:
secretKeyRef:
name: weather
key: mqtt_user
- name: MQTT_PORT
valueFrom:
secretKeyRef:
name: weather
key: mqtt_port
imagePullSecrets:
- name: registry-1
---
apiVersion: v1
kind: Service
metadata:
name: weather-service
namespace: weather
labels:
app: weather
spec:
selector:
app: weather
ports:
- protocol: TCP
name: http
port: 8080
targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: weather
namespace: weather
spec:
rules:
- host: weather.djpianalto.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: weather-service
port:
number: 8080