conjurdemos / conjur-openshift

Demonstration of Conjur 4.9.x running inside OpenShift [DEPRECATED]
1 stars 0 forks source link
deprecated

Deploying Conjur Cluster on OpenShift 3.3 (Origin 1.3)

This document is part of a repository that provides example code and instructions for deploying and configuring a Conjur cluster in OpenShift. There are additional instructions for running a webapp for demonstation purposes. The proposed architecture contains a master and two standbys.

0. Set up OpenShift Origin 1.3

We use a vagrant box since minishift does not support Origin 1.3. Run the follow to set up the environment.

vagrant up --provision
vagrant ssh # then change directory to ./scripts

If not using Vagrant please modify utils with relevant credentials for login into OpenShift

1. Deployment

If using scripts please ensure conjur-appliance:4.9-stable is available in your Docker engine

Deploy a Conjur cluster in OpenShift can be broken down into the following steps:

1.1 Setup OpenShift environment

Please consult 0_init.sh.

1.1.1 Context creation

Isolate the Conjur cluster by creating a dedicated OpenShift project for it.

1.1.2 Openshift Permissions

Appropriate privileges should be granted to ensure relevant operations can be carried out e.g. Conjur seed files can be unpacked.

Below are some privilege considerations:

In order to unpack Conjur seed files processes in the Conjur container need to run as root. Addition of the anyuid privilege grant is one way in which this could be achieved.

oc adm policy add-scc-to-user anyuid -z default

HAproxy needs to be able to list master/standby pods to update its config.

oc adm policy add-cluster-role-to-user cluster-reader system:serviceaccount:$CONJUR_CONTEXT:default

User "developer" needs the edit role on a project.

oc policy add-role-to-user edit developer

Visit your Appliance URL

1.2 Build container images

Please consult 1_build_all.sh.

This section assumes you have the appliance image conjur-appliance:4.9-stable in your OpenShift Docker Engine.

1.3 Deploy the Conjur cluster

Please consult 2_start_cluster.sh. The following steps should be carried out within the Conjur project

1.3.1 Create Conjur Cluster

Please consult ./conjur-service/conjur-cluster.yaml.

1.3.2 Configure Conjur Cluster

1.3.3 Create and start HAProxy

2. Example webapp to verify it all works!

This section demonstrates an example app consuming the the Conjur cluster running on OpenShift for the purposes of machine identity and secrets retrieval.

2.1 Configure and login the local command-line interface.

Please consult ./0_webapp_init.sh

2.2 Load policies and set secret values

Please consult ./1_load_policies.sh and webapp_demo/policy

2.3 Deploy webapp

Please consult ./2_deploy.sh