From 5ed75258b0a16f60404e38eb2b4bd0baef28d30c Mon Sep 17 00:00:00 2001 From: Felix Ammann Date: Tue, 15 Nov 2016 15:39:29 +0100 Subject: [PATCH] add ose template json --- cv2-postgres-persistent-ose3-template.json | 479 +++++++++++++++++++++ 1 file changed, 479 insertions(+) create mode 100644 cv2-postgres-persistent-ose3-template.json diff --git a/cv2-postgres-persistent-ose3-template.json b/cv2-postgres-persistent-ose3-template.json new file mode 100644 index 000000000..906872f33 --- /dev/null +++ b/cv2-postgres-persistent-ose3-template.json @@ -0,0 +1,479 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "cv2-postgres-persistent-ose3-template", + "creationTimestamp": null + }, + "objects": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ose3-rails", + "generation": 2, + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftNewApp", + "openshift.io/image.dockerRepositoryCheck": "2016-11-15T08:13:54Z" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/imported-from": "puzzle/ose3-rails" + }, + "from": { + "kind": "DockerImage", + "name": "172.30.1.1:5000/pitc-cv2-int/ose3-rails:latest" + }, + "generation": 2, + "importPolicy": {} + } + ] + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "puzzlecv2", + "generation": 1, + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftNewApp" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": null, + "from": { + "kind": "DockerImage", + "name": "172.30.1.1:5000/pitc-cv2-int/puzzlecv2:latest" + }, + "generation": null, + "importPolicy": {} + } + ] + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "glusterfs-cluster", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "protocol": "TCP", + "port": 1, + "targetPort": 1 + } + ], + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "postgresql", + "creationTimestamp": null, + "labels": { + "template": "postgresql-persistent-template" + } + }, + "spec": { + "ports": [ + { + "name": "postgresql", + "protocol": "TCP", + "port": 5432, + "targetPort": 5432 + } + ], + "selector": { + "name": "postgresql" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "puzzlecv2", + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftNewApp" + } + }, + "spec": { + "ports": [ + { + "name": "8080-tcp", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080 + } + ], + "selector": { + "app": "puzzlecv2", + "deploymentconfig": "puzzlecv2" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "puzzlecv2", + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftNewApp" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "mp1OxMBqdecycOAj8-SP" + } + }, + { + "type": "Generic", + "generic": { + "secret": "0Jzo020dgea76z0IPf83" + } + }, + { + "type": "ConfigChange" + } + ], + "source": { + "type": "Git", + "git": { + "uri": "ssh://git@ssh.gitlab.puzzle.ch/pitc_puzzlecv/puzzlecv_2.git" + }, + "sourceSecret": { + "name": "gitsecret" + }, + "secrets": [] + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "172.30.1.1:5000/pitc-rails-bi-prod/ose3-rails:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "puzzlecv2:latest" + } + }, + "resources": {}, + "postCommit": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "postgresql", + "creationTimestamp": null, + "labels": { + "template": "postgresql-persistent-template" + }, + "annotations": { + "openshift.io/deployment.cancelled": "1" + } + }, + "spec": { + "strategy": { + "type": "Recreate", + "recreateParams": { + "timeoutSeconds": 600 + }, + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "postgresql" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "postgresql:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "test": false, + "selector": { + "name": "postgresql" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "postgresql" + } + }, + "spec": { + "volumes": [ + { + "name": "postgresql-data", + "persistentVolumeClaim": { + "claimName": "postgresql" + } + } + ], + "containers": [ + { + "name": "postgresql", + "image": "registry.access.redhat.com/rhscl/postgresql-95-rhel7:latest", + "ports": [ + { + "containerPort": 5432, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "POSTGRESQL_USER", + "value": "EDITME" + }, + { + "name": "POSTGRESQL_PASSWORD", + "value": "EDITME" + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "EDITMEt" + } + ], + "resources": { + "limits": { + "memory": "512Mi" + } + }, + "volumeMounts": [ + { + "name": "postgresql-data", + "mountPath": "/var/lib/pgsql/data" + } + ], + "livenessProbe": { + "tcpSocket": { + "port": 5432 + }, + "initialDelaySeconds": 30, + "timeoutSeconds": 1, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 3 + }, + "readinessProbe": { + "exec": { + "command": [ + "/bin/sh", + "-i", + "-c", + "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'" + ] + }, + "initialDelaySeconds": 5, + "timeoutSeconds": 1, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 3 + }, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "securityContext": {} + } + } + }, + "status": {} + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "puzzlecv2", + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2" + }, + "annotations": { + "openshift.io/deployment.cancelled": "1", + "openshift.io/generated-by": "OpenShiftNewApp" + } + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 600, + "maxUnavailable": "25%", + "maxSurge": "25%" + }, + "resources": {} + }, + "triggers": [ + { + "type": "ConfigChange" + }, + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "puzzlecv2" + ], + "from": { + "kind": "ImageStreamTag", + "name": "puzzlecv2:latest" + } + } + } + ], + "replicas": 1, + "test": false, + "selector": { + "app": "puzzlecv2", + "deploymentconfig": "puzzlecv2" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "app": "puzzlecv2", + "deploymentconfig": "puzzlecv2" + }, + "annotations": { + "openshift.io/container.puzzlecv2.image.entrypoint": "[\"container-entrypoint\",\"/bin/sh\",\"-c\",\"$STI_SCRIPTS_PATH/run-httpd.sh\"]", + "openshift.io/generated-by": "OpenShiftNewApp" + } + }, + "spec": { + "containers": [ + { + "name": "puzzlecv2", + "image": "172.30.1.1:5000/pitc-cv2-int/puzzlecv2@sha256:e1ff6c7361bf87c64eac59b9ffa3de3253b749aac92cd51892ba462169681f55", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "RAILS_ENV", + "value": "production" + }, + { + "name": "SECRET_KEY_BASE", + "value": "EDITME" + }, + { + "name": "RAILS_DB_HOST", + "value": "EDITME" + }, + { + "name": "RAILS_DB_USERNAME", + "value": "EDITME" + }, + { + "name": "RAILS_DB_PASSWORD", + "value": "EDITME" + }, + { + "name": "RAILS_DB_ADAPTER", + "value": "postgresql" + }, + { + "name": "RAILS_DB_NAME", + "value": "EDITME" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "Always" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "securityContext": {} + } + } + }, + "status": {} + } + ] +}