Skip to content

Latest commit

 

History

History
79 lines (65 loc) · 2.54 KB

Development.adoc

File metadata and controls

79 lines (65 loc) · 2.54 KB

Development

Development on this operator can be performed in the odo OpenShift developer CLI or building with OpenShift build configs. An OpenShift cluster with cluster-admin is required for odo development. CodeReady Containers is recommended for local development. An Ansible test suite is available for functional testing.

Development with odo

Use of odo is recommended for fast iterative development. odo simplifies the build/deploy process and avoids creating unnecessary build artifacts during the development process.

  1. Install the odo developer CLI as described in the OpenShift documentation

  2. Create a project namespace or change namespace if already exists:

    oc new-project replik8s
    oc project replik8s
  3. Create resources required for development from helm chart:

    helm template helm/replik8s \
    --include-crds \
    --set deploy=false \
    --set namespace.name=replik8s \
    | oc apply -f -
  4. Grant privileges for role replik8s to default service account:

    oc policy add-role-to-user --role-namespace=replik8s replik8s -z default
  5. Start development deployment:

    odo dev
  6. To watch logs

    odo logs --follow

Building

The helm tomplate provided includes build configuration for OpenShift:

  1. Create OpenShift BuildConfig and ImageStream

    helm template helm/replik8s-openshift-build | oc apply -f -
  2. Build replik8s image:

    oc start-build replik8s --from-dir=. --follow
  3. Deploy replik8s from build image:

    helm template helm/replik8s --include-crds \
    --set=image.override=$(oc get imagestream replik8s -o jsonpath='{.status.tags[?(@.tag=="latest")].items[0].dockerImageReference}') \
    | oc apply -f -