From 26578f658d5c60f69266d31302dce3bfef7976c2 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 9 Sep 2022 19:18:07 +0100 Subject: [PATCH] #6 wip adding openshift deployment --- .gitignore | 1 + README.md | 6 +++ openshift/README.md | 91 ++++++++++----------------------------------- 3 files changed, 26 insertions(+), 72 deletions(-) diff --git a/.gitignore b/.gitignore index 68d2a46..5058e91 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ docs/venv +OBP-API diff --git a/README.md b/README.md index 723912e..9b78090 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Kubernetes Build (local development) + +## Target environments + +- [Openshift](openshift) +- Kubernetes (see below) + For running locally, install https://microk8s.io/docs/. Otherwise, use a kubernetes provider (Google Cloud, OpenShift etc) diff --git a/openshift/README.md b/openshift/README.md index f8bfae3..d06aa64 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -1,94 +1,41 @@ -# Minishift set-up (rebranded minikube) +# Deploy OpenBankProject on Openshift -- Install minishift (https://docs.okd.io/latest/minishift/getting-started/index.html) +## Local development environment -``` -minishift start -``` +Tools required: +- `crc` ([Download & install crc](https://github.com/code-ready/crc/releases)) -### View console -``` -minishift console -``` - -### oc Env (rebranded kubectl) -``` -eval $(minishift oc-env) -``` +Start `crc` -### Import the template - -Openshift `oc apply` command does **not** appear to automatically run your -manifest because `obpapi_openshift.yaml` is a template object. -After running this command you must use `oc new-app` to actually run the -template. This is confusing because with vanilla kubernetes kubectl would run -the manifest. An openshift template is similar (but not the same) as a Helm -cart if you're familiar with helm. -``` -oc apply -f obpapi_openshift.yaml -``` -Now run the template as a new app: ``` -oc new-app obp-api-example # App name comes from the template name in yaml file. -``` - -Add a route for the service: -``` - -oc expose svc/obpapi-service +crc setup +crc start ``` -See if it works: +Enable podman: - -### Seed the sandbox: Deploy a bootstrap pod - -We have a bootstrap node which creates an initial user for you automatically. -This user can then be promoted to a super admin, and used to import demo data. - -``` -oc apply -f ../../obp-boostrap-user/bootstrap.yaml # Deploy bootstrap node -``` - -Get boostrap.yaml, and edit the `env` file: - -- username -- password - -The password policy is very strict. Install will fail if too weak. +> This sets-up podman to 'speak' to your local openshift cluster *rather* than your host machine. ``` -wget https://raw.githubusercontent.com/chrisjsimpson/obp-kubernetes/master/bootstrap.yaml +eval $(crc podman-env) ``` +> **Warning** +> If you see "error did not resolve to an alias and no unqualified-search registries are defined" +> Then edit `/etc/containers/registries.conf` and add/uncomment to your prefered registry e.g. `'unqualified-search-registries = ["docker.io"]` [ref: podman no longer searched dockerhub error](https://unix.stackexchange.com/questions/701784/podman-no-longer-searches-dockerhub-error-short-name-did-not-resolve-to-an)) +### Clone OBP-API & build `obp-api` image +> **Warning** +> Work in progress. This clone url is subject to change to the [official repo](https://github.com/OpenBankProject/OBP-API.git) ------------------Old------------------ -### Docker env -``` -eval $(minishift docker-env) -oc login # username developer, password password -docker login -u developer -p $(oc whoami -t) $(minishift openshift registry) -``` - -### Local Docker registry build and push -``` -eval $(minishift oc-env) -eval $(minishift docker-env) -oc login -docker login -u developer -p $(oc whoami -t) $(minishift openshift registry) -docker built -t test . -docker tag test $(minishift openshift registry)/myproject/test -docker push $(minishift openshift registry)/myproject/test - -# 'Deploy' as new app -oc new-app myproject/test ``` -**Note** The 'myproject' tag is needed for minishift docker push to work, otherwise you wil see `unauthorized: authentication required`. +git clone https://github.com/KarmaComputing/OBP-API.git +cd OBP-API +``` \ No newline at end of file