Add initial transtats playbook et al
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
55bb54f122
commit
fb1b32c6ed
7 changed files with 181 additions and 0 deletions
24
playbooks/openshift-apps/transtats.yml
Normal file
24
playbooks/openshift-apps/transtats.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
- name: make the app be real
|
||||
hosts: os-masters-stg
|
||||
user: root
|
||||
gather_facts: True
|
||||
|
||||
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: transtats
|
||||
description: transtats
|
||||
appowners:
|
||||
- suanand
|
||||
- { role: openshift/object, app: transtats, template: secret.yml }
|
||||
- { role: openshift/object, app: transtats, file: imagestream.yml }
|
||||
- { role: openshift/object, app: transtats, file: buildconfig.yml }
|
||||
- { role: openshift/start-build, app: transtats, name: transtats-docker-build }
|
||||
- { role: openshift/object, app: transtats, file: service.yml }
|
||||
- { role: openshift/object, app: transtats, file: route.yml }
|
||||
- { role: openshift/object, app: transtats, file: deploymentconfig.yml }
|
||||
- { role: openshift/rollout, app: transtats, name: transtats-web }
|
30
roles/openshift-apps/transtats/files/buildconfig.yml
Normal file
30
roles/openshift-apps/transtats/files/buildconfig.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
metadata:
|
||||
name: "transtats-build"
|
||||
labels:
|
||||
environment: "transtats"
|
||||
spec:
|
||||
runPolicy: Serial
|
||||
source:
|
||||
git:
|
||||
ref: master
|
||||
uri: https://github.com/transtats/transtats.git
|
||||
secrets: null
|
||||
type: Git
|
||||
strategy:
|
||||
sourceStrategy:
|
||||
env:
|
||||
- name: PIP_INDEX_URL
|
||||
- name: TS_AUTH_SYSTEM
|
||||
value: fedora
|
||||
- name: OIDC_RP_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transtats-secret
|
||||
key: oidc-client-secret
|
||||
type: Source
|
||||
output:
|
||||
to:
|
||||
kind: ImageStreamTag
|
||||
name: transtats:latest
|
74
roles/openshift-apps/transtats/files/deploymentconfig.yml
Normal file
74
roles/openshift-apps/transtats/files/deploymentconfig.yml
Normal file
|
@ -0,0 +1,74 @@
|
|||
|
||||
apiVersion: v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
name: transtats-web
|
||||
labels:
|
||||
app: transtats
|
||||
service: web
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
app: transtats
|
||||
service: web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: transtats
|
||||
service: web
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: transtats
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: DATABASE_SERVICE_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transtats-secret
|
||||
key: database-host
|
||||
- name: DATABASE_ENGINE
|
||||
value: postgresql
|
||||
- name: DATABASE_NAME
|
||||
value: transtats
|
||||
- name: DATABASE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transtats-secret
|
||||
key: database-user
|
||||
- name: DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transtats-secret
|
||||
key: database-password
|
||||
- name: DJANGO_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transtats-secret
|
||||
key: django-secret-key
|
||||
readinessProbe:
|
||||
timeoutSeconds: 1
|
||||
initialDelaySeconds: 5
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8080
|
||||
livenessProbe:
|
||||
timeoutSeconds: 1
|
||||
initialDelaySeconds: 30
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8080
|
||||
resources:
|
||||
limits:
|
||||
memory: 384Mi
|
||||
triggers:
|
||||
- type: ImageChange
|
||||
imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- web
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: transtats:latest
|
||||
- type: ConfigChange
|
12
roles/openshift-apps/transtats/files/imagestream.yml
Normal file
12
roles/openshift-apps/transtats/files/imagestream.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
name: transtats
|
||||
spec:
|
||||
tags:
|
||||
- name: latest
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
name: transtats
|
16
roles/openshift-apps/transtats/files/route.yml
Normal file
16
roles/openshift-apps/transtats/files/route.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Route
|
||||
metadata:
|
||||
name: transtats-web
|
||||
labels:
|
||||
app: transtats
|
||||
spec:
|
||||
#host: transtats.stg.fedoraproject.org
|
||||
port:
|
||||
targetPort: web
|
||||
to:
|
||||
kind: Service
|
||||
name: transtats-web
|
||||
tls:
|
||||
termination: edge
|
||||
insecureEdgeTerminationPolicy: Redirect
|
14
roles/openshift-apps/transtats/files/service.yml
Normal file
14
roles/openshift-apps/transtats/files/service.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: transtats-web
|
||||
labels:
|
||||
app: transtats
|
||||
spec:
|
||||
selector:
|
||||
app: transtats
|
||||
service: web
|
||||
ports:
|
||||
- name: web
|
||||
port: 8080
|
||||
targetPort: 8080
|
11
roles/openshift-apps/transtats/templates/secret.yml
Normal file
11
roles/openshift-apps/transtats/templates/secret.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: "transtats-secret"
|
||||
labels:
|
||||
app: "transtats"
|
||||
stringData:
|
||||
{% if env == 'staging' %}
|
||||
djang-secret-key: "{{transtats_stg_django_secret_key}}"
|
||||
database-password: "{{transtats_stg_database_password}}"
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue