Infrastructure Layer
Install Gremlin on OpenShift 3
Pre-requisites
Download Authentication Keys
Gremlin requires authentication during installation. You will need to download your Gremlin certificate key-pair in order to connect to your Gremlin team. With the key pair extracted to your local system, export the following variables into a local shell, supplying the appropriate values.
shell
1export GREMLIN_TEAM_ID=11111111-1111-1111-1111111111112export GREMLIN_CLUSTER_ID=my-cluster3export PATH_TO_CERTIFICATE=/path/to/unzipped/cert.pem4export PATH_TO_PRIVATE_KEY=/path/to/unzipped/key.pem
Install Gremlin SELinux Policy
As Openshift uses SELinux, Gremlin requires a custom SELinux policy to grant the minimal permissions needed. Find out more about Gremlin's integration with SELinux on the policy's Github page
On every OpenShift node, run the following command to install the SELinux module
shell
1curl -fsSL https://github.com/gremlin/selinux-policies/releases/download/v0.0.2/selinux-policies-v0.0.2.tar.gz -o selinux-policies-v0.0.2.tar.gz2tar xzf selinux-policies-v0.0.2.tar.gz3sudo semodule -i selinux-policies-v0.0.2/gremlin-openshift3.cil
Helm Installation
If you do not wish to install with Helm, skip this section and use Manual Installation instead.
shell
1oc new-project gremlin2helm repo add gremlin https://helm.gremlin.com/3helm install gremlin gremlin/gremlin \4 --namespace gremlin \5 --set gremlin.podSecurity.securityContextConstraints.create=true \6 --set gremlin.secret.managed=true \7 --set gremlin.secret.teamID=$GREMLIN_TEAM_ID \8 --set gremlin.secret.clusterID=$GREMLIN_CLUSTER_ID \9 --set-file gremlin.secret.certificate=$PATH_TO_CERTIFICATE \10 --set-file gremlin.secret.key=$PATH_TO_PRIVATE_KEY
Manual Installation
shell
1oc new-project gremlin2mkdir gremlin-openshift33wget -P gremlin-openshift3/ https://k8s.gremlin.com/resources/gremlin-openshift3/v1/chao-deployment.yaml4wget -P gremlin-openshift3/ https://k8s.gremlin.com/resources/gremlin-openshift3/v1/chao-service-account.yaml5wget -P gremlin-openshift3/ https://k8s.gremlin.com/resources/gremlin-openshift3/v1/daemonset.yaml6wget -P gremlin-openshift3/ https://k8s.gremlin.com/resources/gremlin-openshift3/v1/gremlin-scc.yaml7wget -P gremlin-openshift3/ https://k8s.gremlin.com/resources/gremlin-openshift3/v1/gremlin-service-account.yaml8oc create secret generic gremlin-team-cert \9 --from-literal=GREMLIN_TEAM_ID=$GREMLIN_TEAM_ID \10 --from-literal=GREMLIN_CLUSTER_ID=$GREMLIN_CLUSTER_ID \11 --from-file=gremlin.cert=$PATH_TO_CERTIFICATE \12 --from-file=gremlin.key=$PATH_TO_PRIVATE_KEY13oc create -f gremlin-openshift3/
Run Attacks
You can now run attacks on your cluster, including Kubernetes attacks.
Troubleshooting
Please check our OpenShift troubleshooting section for common issues and solutions.