[download-web] Add initial OSCP template



commit c9319278daa622e9add447b6a332472c3ca5754d
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Sun Oct 13 11:07:41 2019 +0200

    Add initial OSCP template

 templates/oscp.yaml | 243 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 243 insertions(+)
---
diff --git a/templates/oscp.yaml b/templates/oscp.yaml
new file mode 100644
index 0000000..4e074ac
--- /dev/null
+++ b/templates/oscp.yaml
@@ -0,0 +1,243 @@
+---
+kind: Template
+apiVersion: v1
+metadata:
+  name: download-web
+  annotations:
+    openshift.io/display-name: "download.gnome.org"
+    description:  >-
+      Openshift template for download.gnome.org
+
+parameters:
+- name: IS_NAME
+  displayName: Image Stream
+  description: The OpenShift ImageStream name.
+  value: download-web
+
+- name: IS_VERSION
+  displayName: Image version
+  description: Version of image to use
+  value: latest
+
+- name: DB_NAME
+  displayName: Database name
+  description: Name of PostgreSQL database
+  value: mirrorbrain
+
+- name: DB_USER
+  displayName: Database user
+  description: Database username
+  value: mirrorbrain
+
+- name: DB_HOST
+  displayName: Database host
+  description: Database hostname or IP
+  required: true
+
+- name: DB_PASSWORD
+  displayName: Database password
+  description: Password for database user
+  required: true
+
+objects:
+- kind: BuildConfig
+  apiVersion: build.openshift.io/v1
+  metadata:
+    name: download-web
+  spec:
+    runPolicy: "Serial"
+    source:
+      git:
+        uri: https://gitlab.gnome.org/Infrastructure/download-web.git
+        ref: master
+    strategy:
+      dockerStrategy:
+        dockerfilePath: Dockerfile
+    output:
+      to:
+        kind: "ImageStreamTag"
+        name: ${IS_NAME}:${IS_VERSION}
+
+- kind: ImageStream
+  apiVersion: image.openshift.io/v1
+  metadata:
+    generation: 2
+    labels:
+      build: "${IS_NAME}"
+    name: "${IS_NAME}"
+  spec:
+    lookupPolicy:
+      local: false
+    tags:
+    - annotations: null
+      from:
+        kind: DockerImage
+        name: "${IS_NAME}/${IS_NAME}"
+      generation: 2
+      importPolicy: {}
+      name: ${IS_VERSION}
+      referencePolicy:
+        type: Source
+
+- kind: Secret
+  apiVersion: v1
+  metadata:
+    name: download-web
+    labels:
+      app: download-web
+    annotations:
+      description: download-web secrets
+      template.openshift.io/expose-database-name: "{.data['database-name']}"
+      template.openshift.io/expose-database-password: "{.data['database-password']}"
+      template.openshift.io/expose-database-user: "{.data['database-user']}"
+      template.openshift.io/expose-database-host: "{.data['database-host']}"
+  stringData:
+    database-name: "${DB_NAME}"
+    database-user: "${DB_USER}"
+    database-host: "${DB_HOST}"
+    database-password: "${DB_PASSWORD}"
+
+- kind: DeploymentConfig
+  apiVersion: v1
+  metadata:
+    name: download-web
+    generation: 1
+    labels:
+      app: download-web
+    annotations: {}
+  spec:
+    strategy:
+      type: Rolling
+      rollingParams:
+        updatePeriodSeconds: 1
+        intervalSeconds: 1
+        timeoutSeconds: 180
+        maxUnavailable: 25%
+        maxSurge: 25%
+      resources: {}
+      activeDeadlineSeconds: 21600
+    triggers:
+    - type: ConfigChange
+    - type: ImageChange
+      imageChangeParams:
+        automatic: true
+        containerNames:
+          - download-web
+        from:
+          kind: ImageStreamTag
+          namespace: "${IS_NAME}"
+          name: "${IS_NAME}:${IS_VERSION}"
+    replicas: 1
+    revisionHistoryLimit: 10
+    test: false
+    selector:
+      app: download-web
+      deploymentconfig: download-web
+    template:
+      metadata:
+        labels:
+          app: download-web
+          deploymentconfig: download-web
+        annotations: {}
+      spec:
+        containers:
+        - name: download-web
+          ports:
+          - containerPort: 8080
+            protocol: TCP
+          env:
+          - name: DB_NAME
+            valueFrom:
+              secretKeyRef:
+                name: download-web
+                key: database-name
+          - name: DB_USER
+            valueFrom:
+              secretKeyRef:
+                name: download-web
+                key: database-user
+          - name: DB_HOST
+            valueFrom:
+              secretKeyRef:
+                name: download-web
+                key: database-host
+          - name: DB_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: download-web
+                key: database-password
+          resources: {}
+          livenessProbe:
+            httpGet:
+              path: "/"
+              port: 8080
+              scheme: HTTP
+            initialDelaySeconds: 60
+            timeoutSeconds: 5
+            periodSeconds: 10
+            successThreshold: 1
+            failureThreshold: 6
+          readinessProbe:
+            httpGet:
+              path: "/"
+              port: 8080
+              scheme: HTTP
+            initialDelaySeconds: 10
+            timeoutSeconds: 2
+            periodSeconds: 10
+            successThreshold: 1
+            failureThreshold: 10
+          terminationMessagePath: "/dev/termination-log"
+          terminationMessagePolicy: File
+          imagePullPolicy: Always
+          #volumeMounts:
+          #- mountPath: /download/data
+          #  name: download-data
+        restartPolicy: Always
+        terminationGracePeriodSeconds: 30
+        dnsPolicy: ClusterFirst
+        securityContext: {}
+        schedulerName: default-scheduler
+        #volumes:
+        #- name: dowload-data
+        #  persistentVolumeClaim:
+        #    claimName: download-data-claim
+
+- kind: Service
+  apiVersion: v1
+  metadata:
+    name: download-web
+    labels:
+      app: download-web
+  spec:
+    ports:
+    - name: web
+      protocol: TCP
+      port: 8080
+      targetPort: 8080
+    selector:
+      app: download-web
+      deploymentconfig: download-web
+    type: ClusterIP
+    sessionAffinity: None
+  status:
+    loadBalancer: {}
+
+# - kind: Route
+#   apiVersion: v1
+#   metadata:
+#     name: download-web
+#     creationTimestamp:
+#     labels:
+#       app: download-web
+#   spec:
+#     host: download.gnome.org
+#     to:
+#       kind: Service
+#       name: download-web
+#       weight: 100
+#     port:
+#       targetPort: web
+#     tls:
+#       termination: edge
+#       insecureEdgeTerminationPolicy: "Redirect"


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