2020-10-06 18:56:20 +11:00

91 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: videos-api
labels:
app: videos-api
spec:
selector:
matchLabels:
app: videos-api
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: videos-api
spec:
containers:
- name: videos-api
image: aimvector/service-mesh:videos-api-1.0.0
imagePullPolicy : Always
ports:
- containerPort: 10010
env:
- name: "ENVIRONMENT"
value: "DEBUG"
- name: "REDIS_HOST"
value: "videos-db"
- name: "REDIS_PORT"
value: "6379"
---
apiVersion: v1
kind: Service
metadata:
name: videos-api
labels:
app: videos-api
spec:
type: ClusterIP
selector:
app: videos-api
ports:
- protocol: TCP
name: http
port: 10010
targetPort: 10010
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: videos-db
labels:
app: videos-db
spec:
selector:
matchLabels:
app: videos-db
replicas: 1
template:
metadata:
labels:
app: videos-db
spec:
containers:
- name: videos-db
image: redis:6.0-alpine
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: videos-db
labels:
app: videos-db
spec:
type: ClusterIP
selector:
app: videos-db
ports:
- protocol: TCP
name: http
port: 6379
targetPort: 6379