FBR add containers.fpo on Openshift (#7120)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

So as discussed on https://pagure.io/fedora-infrastructure/issue/7120 , here
is the 2nd part for the website. That's cut/paste/sed of the 2 others (silverblue, 
and coreos). It shouldn't impact negatively anything on openshift, but
the master in prod are frozen, hence the FBR.

Proxies, etc, are already done.
-- 
Michael Scherer
>From 6e7ab14f194981c86ea295debf8270554a14f00b Mon Sep 17 00:00:00 2001
From: Michael Scherer <misc@xxxxxxxx>
Date: Wed, 29 Aug 2018 23:37:40 +0200
Subject: [PATCH] Add containers.fpo static website

---
 playbooks/openshift-apps/containers.yml            | 59 ++++++++++++++++++++++
 .../containers/files/deploymentconfig.yml          | 50 ++++++++++++++++++
 roles/openshift-apps/containers/files/service.yml  | 16 ++++++
 .../containers/templates/buildconfig.yml           | 29 +++++++++++
 .../containers/templates/imagestream.yml           | 28 ++++++++++
 5 files changed, 182 insertions(+)
 create mode 100644 playbooks/openshift-apps/containers.yml
 create mode 100644 roles/openshift-apps/containers/files/deploymentconfig.yml
 create mode 100644 roles/openshift-apps/containers/files/service.yml
 create mode 100644 roles/openshift-apps/containers/templates/buildconfig.yml
 create mode 100644 roles/openshift-apps/containers/templates/imagestream.yml

diff --git a/playbooks/openshift-apps/containers.yml b/playbooks/openshift-apps/containers.yml
new file mode 100644
index 0000000..3a8dac4
--- /dev/null
+++ b/playbooks/openshift-apps/containers.yml
@@ -0,0 +1,59 @@
+- name: make the app be real
+  hosts: os-masters[0]: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: containers
+    description: containers.fedoraproject.org static website
+    appowners:
+    - misc
+    - sanja
+  - role: openshift/object
+    app: containers
+    template: imagestream.yml
+    objectname: imagestream.yml
+  - role: openshift/object
+    app: containers
+    template: buildconfig.yml
+    objectname: buildconfig.yml
+
+  - role: openshift/start-build
+    app: containers
+    buildname: containers-build
+    objectname: containers-build
+
+  - role: openshift/object
+    app: containers
+    file: service.yml
+    objectname: service.yml
+
+  - role: openshift/route
+    app: containers
+    routename: containers
+    host: "containers.fedoraproject.org"
+    serviceport: 8080-tcp
+    servicename: containers
+    when: env == "production"
+
+  - role: openshift/route
+    app: containers
+    routename: containers
+    host: "containers{{ env_suffix }}.fedoraproject.org"
+    serviceport: 8080-tcp
+    servicename: containers
+
+  - role: openshift/object
+    app: containers
+    file: deploymentconfig.yml
+    objectname: deploymentconfig.yml
+
+  - role: openshift/rollout
+    app: containers
+    dcname: containers
diff --git a/roles/openshift-apps/containers/files/deploymentconfig.yml b/roles/openshift-apps/containers/files/deploymentconfig.yml
new file mode 100644
index 0000000..df2ff22
--- /dev/null
+++ b/roles/openshift-apps/containers/files/deploymentconfig.yml
@@ -0,0 +1,50 @@
+---
+apiVersion: v1
+kind: DeploymentConfig
+metadata:
+  labels:
+    app: containers
+    service: containers
+  name: containers
+spec:
+  replicas: 2
+  selector:
+    app: containers
+    deploymentconfig: containers
+  strategy:
+    resources: {}
+  template:
+    metadata:
+      labels:
+        app: containers
+        deploymentconfig: containers
+    spec:
+      containers:
+      - image: containers:latest
+        name: containers
+        ports:
+        - containerPort: 8080
+          protocol: TCP
+        readinessProbe:
+          timeoutSeconds: 1
+          initialDelaySeconds: 5
+          httpGet:
+            path: /
+            port: 8080
+        livenessProbe:
+          timeoutSeconds: 1
+          initialDelaySeconds: 30
+          httpGet:
+            path: /
+            port: 8080
+
+  triggers:
+  - type: ConfigChange
+  - type: ImageChange
+    imageChangeParams:
+      automatic: true
+      containerNames:
+      - containers
+      from:
+        kind: ImageStreamTag
+        name: containers:latest
diff --git a/roles/openshift-apps/containers/files/service.yml b/roles/openshift-apps/containers/files/service.yml
new file mode 100644
index 0000000..900dc61
--- /dev/null
+++ b/roles/openshift-apps/containers/files/service.yml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+  labels:
+    app: containers
+  name: containers
+spec:
+  ports:
+  - name: 8080-tcp
+    port: 8080
+    protocol: TCP
+    targetPort: 8080
+  selector:
+    app: containers
+    deploymentconfig: containers
+
diff --git a/roles/openshift-apps/containers/templates/buildconfig.yml b/roles/openshift-apps/containers/templates/buildconfig.yml
new file mode 100644
index 0000000..7579587
--- /dev/null
+++ b/roles/openshift-apps/containers/templates/buildconfig.yml
@@ -0,0 +1,29 @@
+apiVersion: v1
+kind: BuildConfig
+metadata:
+  name: containers-build
+  labels:
+    environment: "containers"
+spec:
+  output:
+    to:
+      kind: ImageStreamTag
+      name: containers:latest
+  source:
+    type: Git
+    git:
+      uri: https://github.com/containers/containers.fedoraproject.org.git
+  strategy:
+    type: Source
+    sourceStrategy:
+      from:
+        kind: ImageStreamTag
+        name: s2i-golang:latest
+  triggers:
+{% if containers_github_secret is defined %}
+  - type: GitHub
+    github:
+      secret: "{{ containers_github_secret }}"
+{% endif %}
+  - type: ConfigChange
+  - type: ImageChange
diff --git a/roles/openshift-apps/containers/templates/imagestream.yml b/roles/openshift-apps/containers/templates/imagestream.yml
new file mode 100644
index 0000000..aa40ec4
--- /dev/null
+++ b/roles/openshift-apps/containers/templates/imagestream.yml
@@ -0,0 +1,28 @@
+---
+apiVersion: v1
+kind: ImageStream
+metadata:
+  name: containers
+spec:
+  lookupPolicy:
+    local: false
+status:
+  dockerImageRepository: ""
+---
+apiVersion: v1
+kind: ImageStream
+metadata:
+  name: s2i-golang
+spec:
+  lookupPolicy:
+    local: false
+  tags:
+  - from:
+      kind: DockerImage
+      name: quay.io/osas/s2i-golang
+    importPolicy: {}
+    name: latest
+    referencePolicy:
+      type: Source
+status:
+  dockerImageRepository: ""
-- 
1.8.3.1

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux