Blog Image

Open Grieves

Assimilate quickly!

You must comply!

Troubleshooting Azure deployment template for OpenShift

Out of trouble Posted on 2017-02-07 13:14:13

Hi all,

If you are trying out to deploy OpenShift on Azure using instructions here:

..And you got errors doing that. Here’s how to debug the deployment process. It’s easy to type the wrong this. Try to keep to just copy-and-pasting if you are using the template in the Azure Portal. Trust me 🙂

1. Click on the resource group you’ve created.

2. Click on your deployment. It should say “1 Deploying” (or 2)

3. Click on “Microsoft Template”

4. Scroll down to “Operations details”

5. Find the resource which does not state “OK” or “Created”. Should be marked in red and state something like “Conflict” or “Error”.

6. Find out what went wrong. In this example, it’s a custom script which failed to run.

7. Logon to the server affected and follow the below debug flow:

[root@ocpmaster ~]# cd /var/lib/waagent/custom-script/download/
[root@ocpmaster download]# ls
0 1
[root@ocpmaster download]# ls */
0/: stderr stdout

1/: stderr stdout
[root@ocpmaster download]# cd 1
[root@ocpmaster 1]# tail stderr
Adding password for user mglantz
error: A server URL must be specified
[root@ocpmaster 1]#

8. Issue found.

Running a Git server (GOGS) on OpenShift

You must read Posted on 2017-02-07 11:11:21

Hi all,

Sometimes your OpenShift cluster may not have a connection to a git repository, such as GitHub or etc. Then it may be a good idea to run a Git service on the OpenShift cluster itself. This may also be a good idea in general, if each development team want their own clean environment, shared with no-one.

Here’s an example on how you can do that. In my example, I’m using the GOGS (GO Git Service), as it’s tiny, and there are existing OpenShift templates for deploying it.

Here we go, step-by-step:

1. Clone Alessandro Arrichiello’s GitHub repo, which containers templates and more for us to use
$ git clone

2. Create a project to deploy your GOGS server in. In my example, I’ll use the name: my-gogs-project
$ oc new-project my-gogs-project
$ oc project my-gogs-project

3. Go into the cloned ‘openshift-gogs-template’ project.
$ cd openshift-gogs-template

4. Create the gogs service account
$ oc create -f gogs-sa.yml

5. Add permissions for the gogs service account:
$ oadm policy add-scc-to-user privileged system:serviceaccount:my-gogs-project:gogs
$ oc edit scc anyuid

allowPrivilegedContainer: false
# TO
allowPrivilegedContainer: true

# ADD:
– system:serviceaccount:my-gogs-project:gogs
# SAVE (do not add this line..)

6. Create the template. If the template is not created in the openshift project, it will not be available to all projects.
$ oc create -f gogs-standalone-template.yml -n openshift

7. Deploy GOGS from template (Add to project in the GUI).
8. Goto the gogs URL (route) to do the final setup (don’t forget to create a user).
8. Done.