web: create openshift project, but all of this will change
Signed-off-by: Rick Elrod <relrod@redhat.com>
This commit is contained in:
parent
fe5534b36a
commit
37aad7a9f0
5 changed files with 160 additions and 0 deletions
62
playbooks/openshift-apps/websites.yml
Normal file
62
playbooks/openshift-apps/websites.yml
Normal file
|
@ -0,0 +1,62 @@
|
|||
- name: make the app be real
|
||||
hosts: os-masters-stg[0]:os-masters[0]
|
||||
user: root
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "/srv/private/ansible/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
roles:
|
||||
- role: openshift/project
|
||||
app: websites
|
||||
description: Fedora websites
|
||||
appowners:
|
||||
- codeblock
|
||||
- ryanlerch
|
||||
|
||||
- role: openshift/object
|
||||
app: websites
|
||||
template: imagestream.yml
|
||||
objectname: imagestream.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: websites
|
||||
template: buildconfig.yml
|
||||
objectname: buildconfig.yml
|
||||
|
||||
- role: openshift/start-build
|
||||
app: websites
|
||||
buildname: websites-build
|
||||
objectname: websites-build
|
||||
|
||||
- role: openshift/object
|
||||
app: websites
|
||||
file: service.yml
|
||||
objectname: service.yml
|
||||
|
||||
- role: openshift/route
|
||||
app: websites
|
||||
routename: websites
|
||||
host: "stg.getfedora.org"
|
||||
serviceport: 8080-tcp
|
||||
servicename: websites
|
||||
when: env == "staging"
|
||||
|
||||
- role: openshift/route
|
||||
app: websites
|
||||
routename: websites
|
||||
host: "getfedora.org"
|
||||
serviceport: 8080-tcp
|
||||
servicename: websites
|
||||
when: env == "production"
|
||||
|
||||
- role: openshift/object
|
||||
app: websites
|
||||
file: deploymentconfig.yml
|
||||
objectname: deploymentconfig.yml
|
||||
|
||||
- role: openshift/rollout
|
||||
app: websites
|
||||
dcname: websites
|
54
roles/openshift-apps/websites/files/deploymentconfig.yml
Normal file
54
roles/openshift-apps/websites/files/deploymentconfig.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
name: websites
|
||||
labels:
|
||||
app: websites
|
||||
service: websites
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
app: websites
|
||||
service: websites
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: websites
|
||||
service: websites
|
||||
spec:
|
||||
containers:
|
||||
- name: websites
|
||||
image: registry/websites:latest
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
readinessProbe:
|
||||
timeoutSeconds: 5
|
||||
initialDelaySeconds: 60
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
httpHeaders:
|
||||
- name: Host
|
||||
value: getfedora.org
|
||||
livenessProbe:
|
||||
timeoutSeconds: 5
|
||||
initialDelaySeconds: 60
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
httpHeaders:
|
||||
- name: Host
|
||||
value: getfedora.org
|
||||
resources:
|
||||
volumes:
|
||||
triggers:
|
||||
- type: ImageChange
|
||||
imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- "websites"
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: websites:latest
|
16
roles/openshift-apps/websites/files/service.yml
Normal file
16
roles/openshift-apps/websites/files/service.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: websites
|
||||
name: websites
|
||||
spec:
|
||||
ports:
|
||||
- name: 8080-tcp
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: websites
|
||||
deploymentconfig: websites
|
||||
|
24
roles/openshift-apps/websites/templates/buildconfig.yml
Normal file
24
roles/openshift-apps/websites/templates/buildconfig.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
metadata:
|
||||
name: websites-build
|
||||
labels:
|
||||
environment: "websites"
|
||||
spec:
|
||||
source:
|
||||
git:
|
||||
uri: https://pagure.io/fedora-web/websites.git
|
||||
{% if env == 'staging' %}
|
||||
ref: "staging"
|
||||
{% else %}
|
||||
ref: "production"
|
||||
{% endif %}
|
||||
strategy:
|
||||
type: Docker
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
output:
|
||||
to:
|
||||
kind: ImageStreamTag
|
||||
name: websites:latest
|
4
roles/openshift-apps/websites/templates/imagestream.yml
Normal file
4
roles/openshift-apps/websites/templates/imagestream.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
name: "websites"
|
Loading…
Add table
Add a link
Reference in a new issue