From 3abd46b5c1934846e293d7547fc21206be6eb891 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Mon, 17 Dec 2018 21:59:19 +0100 Subject: [PATCH] Asknot: Base configuration to run asknot on the stg openshift Signed-off-by: Clement Verna --- playbooks/openshift-apps/asknot.yml | 42 ++++++++++++++++ .../asknot/files/deploymentconfig.yml | 48 +++++++++++++++++++ roles/openshift-apps/asknot/files/service.yml | 16 +++++++ .../asknot/templates/imagestream.yml | 17 +++++++ 4 files changed, 123 insertions(+) create mode 100644 playbooks/openshift-apps/asknot.yml create mode 100644 roles/openshift-apps/asknot/files/deploymentconfig.yml create mode 100644 roles/openshift-apps/asknot/files/service.yml create mode 100644 roles/openshift-apps/asknot/templates/imagestream.yml diff --git a/playbooks/openshift-apps/asknot.yml b/playbooks/openshift-apps/asknot.yml new file mode 100644 index 0000000000..b7a4940ae7 --- /dev/null +++ b/playbooks/openshift-apps/asknot.yml @@ -0,0 +1,42 @@ +- name: make the app be real + hosts: os-masters-stg[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: asknot + description: What can I do for Fedora + appowners: + - cverna + + - role: openshift/object + app: asknot + template: imagestream.yml + objectname: imagestream.yml + + - role: openshift/object + app: asknot + file: service.yml + objectname: service.yml + + - role: openshift/route + app: asknot + routename: asknot + host: "asknot{{ env_suffix }}.fedoraproject.org" + serviceport: 8080-tcp + servicename: asknot + + - role: openshift/object + app: asknot + file: deploymentconfig.yml + objectname: deploymentconfig.yml + + - role: openshift/rollout + app: asknot + dcname: asknot diff --git a/roles/openshift-apps/asknot/files/deploymentconfig.yml b/roles/openshift-apps/asknot/files/deploymentconfig.yml new file mode 100644 index 0000000000..7c677f244b --- /dev/null +++ b/roles/openshift-apps/asknot/files/deploymentconfig.yml @@ -0,0 +1,48 @@ +--- +apiVersion: v1 +kind: DeploymentConfig +metadata: + name: asknot + labels: + app: asknot + service: asknot +spec: + replicas: 1 + selector: + app: asknot + service: asknot + template: + metadata: + labels: + app: asknot + service: asknot + spec: + containers: + - name: asknot + image: registry/asknot:latest + ports: + - containerPort: 8080 + volumeMounts: + readinessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 30 + httpGet: + path: / + port: 8080 + livenessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 30 + httpGet: + path: / + port: 8080 + resources: + volumes: + triggers: + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - "asknot" + from: + kind: ImageStreamTag + name: asknot:latest diff --git a/roles/openshift-apps/asknot/files/service.yml b/roles/openshift-apps/asknot/files/service.yml new file mode 100644 index 0000000000..baadaf0ab5 --- /dev/null +++ b/roles/openshift-apps/asknot/files/service.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: asknot + name: asknot +spec: + ports: + - name: 8080-tcp + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: asknot + deploymentconfig: asknot + diff --git a/roles/openshift-apps/asknot/templates/imagestream.yml b/roles/openshift-apps/asknot/templates/imagestream.yml new file mode 100644 index 0000000000..4a87090ceb --- /dev/null +++ b/roles/openshift-apps/asknot/templates/imagestream.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: ImageStream +metadata: + name: "asknot" +spec: + tags: + - name: latest + importPolicy: + scheduled: true + from: + kind: DockerImage +{% if env == 'staging' %} + name: quay.io/fedora-infra/asknot:os-staging +{% else %} + # This is 'prod' tag is maintained by hand. + name: quay.io/fedora-infra/asknot:os-prod +{% endif %}