This operator helps enabling the Launcher on an Openshift cluster.
The user needs cluster-admin permissions to install the Launcher operator
$ oc adm policy --as system:admin add-cluster-role-to-user cluster-admin <user>
Login with the OpenShift client using a user with cluster-admin permissions.
$ oc login
Clone this repository:
$ git clone https://github.com/fabric8-launcher/launcher-operator
$ cd launcher-operator
Choose the project that will run the operator and then install all the operator resources:
$ oc create -R -f ./deploy
-
Log into GitHub and generate a personal access token for the Launcher: -- https://github.com/settings/tokens
- Set scopes
repo
admin:repo_hook
delete_repo
- Set scopes
-
Create a secret for your personal Github token
$ oc create secret generic launcher-secrets --from-literal=github-token=<YOUR_GITHUB_TOKEN>
- Add your CR to OpenShift
$ oc create -f example/launcher_cr.yaml
- Get the Launcher URL:
$ oc get route launcher --template={{.spec.host}}
Find an example of the Launcher CR in example/launcher_cr.yaml
Install the operator-sdk
using the instructions.
Register the crd:
$ oc create -f deploy/crds/launcher_v1alpha1_launcher_crd.yaml
Install dependencies:
$ dep ensure -v
Start the operator (just restart this command to apply your changes):
operator-sdk up local --namespace myproject
Run this command when changing the API types (pkg/apis/launcher/v1alpha1/launcher_types.go)
operator-sdk generate k8s
Then create your launcher CR and watch the logs in the console ouput.
$ ./update-template.sh
$ operator-sdk build fabric8/launcher-operator:vX.Y.Z
$ docker push fabric8/launcher-operator:vX.Y.Z
Update the version in the operator yaml file and push it.