donal
2018-04-19 cb933d400035237a65f811748109746a3289504f
commit | author | age
2c08e4 1 ---
D 2 kind: Template
3 apiVersion: v1
4 metadata:
5   name: todolist-fe-deploy
6   annotations:
7     openshift.io/display-name: Static react js App Deploy Template
8     description: A template to deploy your an App with a HTTP endpoint
9     iconClass: icon-cube
10     tags: http
11 objects:
12 - apiVersion: v1
13   kind: ImageStream
14   metadata:
15     labels:
16       build: "${NAME}"
17     name: "${NAME}"
18   spec: {}
19 - apiVersion: v1
20   kind: DeploymentConfig
21   metadata:
22     name: "${NAME}"
23     labels:
24       app: "${NAME}"
25   spec:
26     replicas: 1
27     selector:
28       name: "${NAME}"
29     strategy:
30       activeDeadlineSeconds: 21600
31       resources: {}
32       rollingParams:
33         intervalSeconds: 1
34         maxSurge: 25%
35         maxUnavailable: 25%
36         timeoutSeconds: 600
37         updatePeriodSeconds: 1
38       type: Rolling
39     template:
40       metadata:
41         creationTimestamp:
42         labels:
43           name: "${NAME}"
44       spec:
45         containers:
46         - image: "docker-registry.default.svc:5000/${NAMESPACE}/${NAME}:${APP_TAG}"
47           imagePullPolicy: Always
48           name: "${NAME}"
49           ports:
50           - containerPort: 8080
51             protocol: TCP
52           resources: {}
53           terminationMessagePath: "/dev/termination-log"
54           readinessProbe:
55             httpGet:
56               path: /
57               port: 8080
58             initialDelaySeconds: 10
59             timeoutSeconds: 1
60         dnsPolicy: ClusterFirst
61         restartPolicy: Always
62         securityContext: {}
63         terminationGracePeriodSeconds: 30
64     test: false
65     triggers: []
66 - apiVersion: v1
67   kind: Service
68   metadata:
69     labels:
70       name: "${NAME}"
71     name: "${NAME}"
72   spec:
73     ports:
74     - name: 8080-tcp
75       port: 8080
76       protocol: TCP
77       targetPort: 8080
78     selector:
79       name: "${NAME}"
80     sessionAffinity: None
81     type: ClusterIP
82 - apiVersion: v1
83   kind: Route
84   metadata:
85     labels:
86       name: "${NAME}"
87     name: "${NAME}"
88   spec:
89     port:
90       targetPort: 8080-tcp
91     to:
92       kind: Service
93       name: "${NAME}"
94       weight: 100
95     wildcardPolicy: None
96 - apiVersion: v1
97   kind: RoleBinding
98   metadata:
99     name: edit
100   roleRef:
101     name: edit
102   subjects:
103   - kind: ServiceAccount
104     name: jenkins
105     namespace: "${PIPELINES_NAMESPACE}"
106   userNames:
107   - system:serviceaccount:${PIPELINES_NAMESPACE}:${DEPLOYER_USER}
108 parameters:
109 - name: NAME
110   displayName: Name
111   description: The name assigned to all objects and the related imagestream.
112   required: true
113 - name: APP_TAG
114   displayName: App Tag
115   description: The tag of the image to use eg latest.
116   required: true
117 - name: NAMESPACE
118   displayName: Docker image namespace
119   description: The namespace of the image to use eg js-apps.
120   required: true
121 - name: DEPLOYER_USER
122   displayName: Deployer User
123   description: The name to the serviceaccount user for deploying apps eg jenkins
124   required: true
125 - name: PIPELINES_NAMESPACE
126   displayName: Project/Namespace for Jenkins Pipelines
127   description: The project/namespace where the Jenkins executing pipelines is deployed.
128   required: true
129 labels:
130   template: todolist-fe-deploy-template