I have a Deployment object with Container A and Container B in OpenShift. The requirement here is that whenever container B exits, container A should follow or otherwise the entire pod should be replaced.
Is there any way to achieve this?
This is my YAML.
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-redis-bundle
labels:
app: app-redis-bundle
spec:
replicas: 1
selector:
matchLabels:
app: app-redis-bundle
template:
metadata:
labels:
app: app-redis-bundle
spec:
containers:
- name: cache-store-2
image: redis
resources:
limits:
cpu: 500m
memory: 1500Mi
requests:
cpu: 250m
memory: 1Gi
ports:
- containerPort: 6379
livenessProbe:
tcpSocket:
port: 6379
- name: app-server-2
image: 'app:latest'
resources:
limits:
cpu: '1'
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
ports:
- containerPort: 8443
livenessProbe:
tcpSocket:
port: 8443
imagePullSecrets:
- name: mysecret