Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: "template.openshift.io/v1"
- kind: Template
- metadata:
- name: guestbook-template
- annotations:
- description: "Guestbook application"
- tags: "guestbook,php,redis"
- objects:
- - apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
- kind: Deployment
- metadata:
- name: redis-master
- labels:
- app: redis
- spec:
- selector:
- matchLabels:
- app: redis
- role: master
- tier: backend
- replicas: 1
- template:
- metadata:
- labels:
- app: redis
- role: master
- tier: backend
- spec:
- containers:
- - name: master
- image: ${REDIS_MASTER_IMAGE}
- resources:
- requests:
- cpu: 10m
- memory: 50Mi
- limits:
- cpu: 50m
- memory: 50Mi
- ports:
- - containerPort: 6379
- - apiVersion: v1
- kind: Service
- metadata:
- name: redis-master
- labels:
- app: redis
- role: master
- tier: backend
- spec:
- ports:
- - port: 6379
- targetPort: 6379
- selector:
- app: redis
- role: master
- tier: backend
- - apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
- kind: Deployment
- metadata:
- name: redis-slave
- labels:
- app: redis
- spec:
- selector:
- matchLabels:
- app: redis
- role: slave
- tier: backend
- replicas: 1
- template:
- metadata:
- labels:
- app: redis
- role: slave
- tier: backend
- spec:
- containers:
- - name: slave
- image: ${REDIS_SLAVE_IMAGE}
- resources:
- requests:
- cpu: 150m
- memory: 50Mi
- limits:
- cpu: 150m
- memory: 50Mi
- env:
- - name: GET_HOSTS_FROM
- value: dns
- ports:
- - containerPort: 6379
- - apiVersion: v1
- kind: Service
- metadata:
- name: redis-slave
- labels:
- app: redis
- role: slave
- tier: backend
- spec:
- ports:
- - port: 6379
- selector:
- app: redis
- role: slave
- tier: backend
- - apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
- kind: Deployment
- metadata:
- name: frontend
- labels:
- app: guestbook
- spec:
- selector:
- matchLabels:
- app: guestbook
- tier: frontend
- replicas: 3
- template:
- metadata:
- labels:
- app: guestbook
- tier: frontend
- spec:
- containers:
- - name: php-redis
- image: ${GUESTBOOK_IMAGE}
- resources:
- requests:
- cpu: 100m
- memory: 100Mi
- limits:
- cpu: 300m
- memory: 500Mi
- env:
- - name: GET_HOSTS_FROM
- value: dns
- ports:
- - containerPort: 8080
- - apiVersion: v1
- kind: Service
- metadata:
- name: frontend
- labels:
- app: guestbook
- tier: frontend
- spec:
- ports:
- - port: 8080
- selector:
- app: guestbook
- tier: frontend
- parameters:
- - description: Docker image for redis master
- name: REDIS_MASTER_IMAGE
- - description: Docker image for redis slave
- name: REDIS_SLAVE_IMAGE
- - description: Docker image for guestbook
- name: GUESTBOOK_IMAGE
- labels:
- app: guestbook
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement