Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
133 lines (128 sloc) 3.33 KB
---
# tasks file for helloworld
- name: create deployment config
k8s:
definition:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: '{{ meta.name }}'
labels:
app: '{{ meta.name }}'
namespace: '{{ meta.namespace }}'
spec:
replicas: "{{size}}"
selector:
app: '{{ meta.name }}'
deploymentconfig: '{{ meta.name }}'
strategy: ~
template:
metadata:
labels:
app: '{{ meta.name }}'
deploymentconfig: '{{ meta.name }}'
spec:
containers:
- image: " "
name: '{{ meta.name }}'
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8888
protocol: TCP
livenessProbe:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 8080
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8080
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- '{{ meta.name }}'
from:
kind: ImageStreamTag
name: "hello-openshift:latest"
namespace: '{{ meta.namespace }}'
type: ImageChange
- name: create image stream
k8s:
definition:
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
generation: 2
labels:
app: '{{ meta.name }}'
name: '{{ meta.name }}'
namespace: '{{ meta.namespace }}'
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: openshift/hello-openshift:latest
generation: 2
importPolicy: {}
name: latest
referencePolicy:
type: Source
status:
dockerImageRepository: ""
- name: create service
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
labels:
app: '{{ meta.name }}'
name: '{{ meta.name }}'
namespace: '{{ meta.namespace }}'
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: 8888-tcp
port: 8888
protocol: TCP
targetPort: 8888
selector:
deploymentconfig: '{{ meta.name }}'
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- name: create route
k8s:
definition:
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: '{{ meta.name }}'
name: '{{ meta.name }}'
namespace: '{{ meta.namespace }}'
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: '{{ meta.name }}'
weight: 100
You can’t perform that action at this time.