Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example template to create Openshift image from private git repo
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {"name": "my-template"},
"objects": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "my-app",
"creationTimestamp": null,
"labels": {
"app": "my-app"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "my-app",
"creationTimestamp": null,
"labels": {
"app": "my-app"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"triggers": [
{
"type": "GitHub",
"github": {
"secret": "SECRET"
}
},
{
"type": "Generic",
"generic": {
"secret": "SECRET"
}
},
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChange": {}
}
],
"source": {
"type": "Git",
"git": {
"uri": "git@github.com:pmy-user/my-repo.git"
},
"sourceSecret": {
"name": "my-secret-name"
}
},
"strategy": {
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"namespace": "openshift",
"name": "ruby:2.3"
}
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "my-app:latest"
}
},
"resources": {},
"postCommit": {},
"nodeSelector": null
},
"status": {
"lastVersion": 0
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "my-app",
"creationTimestamp": null,
"labels": {
"app": "my-app"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"my-app"
],
"from": {
"kind": "ImageStreamTag",
"name": "my-app:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"app": "my-app",
"deploymentconfig": "my-app"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "my-app",
"deploymentconfig": "my-app"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"containers": [
{
"name": "my-app",
"image": "my-app:latest",
"ports": [
{
"containerPort": 8080,
"protocol": "TCP"
}
],
"resources": {}
}
]
}
}
},
"status": {
"latestVersion": 0,
"observedGeneration": 0,
"replicas": 0,
"updatedReplicas": 0,
"availableReplicas": 0,
"unavailableReplicas": 0
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "my-app",
"creationTimestamp": null,
"labels": {
"app": "my-app"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"ports": [
{
"name": "8080-tcp",
"protocol": "TCP",
"port": 8080,
"targetPort": 8080
}
],
"selector": {
"app": "my-app",
"deploymentconfig": "my-app"
}
},
"status": {
"loadBalancer": {}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment