Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6 wip adding openshift deployment #13

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docs/venv
OBP-API
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
91 changes: 19 additions & 72 deletions openshift/README.md
Original file line number Diff line number Diff line change
@@ -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
```