Skip to content

Commit

Permalink
update documents re: in k8s DB pod-forward instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
t83714 committed Aug 26, 2021
1 parent 6c4bb2c commit 48835d8
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 28 deletions.
22 changes: 12 additions & 10 deletions docs/docs/building-and-running.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ These instructions assume you are using a Bash shell. You can easily get a Bash

You need to install following in order to build MAGDA:

- [Node.js](https://nodejs.org/en/) - To build and run the TypeScript / JavaScript components, as well as many of the build scripts. Version 9+ works fine as of March 2018.
- [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) - To run the JVM components, and to build the small amount of Java code.
- [sbt](http://www.scala-sbt.org/) - To build the Scala components.
- [yarn](https://yarnpkg.com/) - Npm replacement that makes node deps in a monorepo much easier.
- [Node.js](https://nodejs.org/en/) - To build and run the TypeScript / JavaScript components, as well as many of the build scripts. Version 9+ works fine as of March 2018.
- [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) - To run the JVM components, and to build the small amount of Java code.
- [sbt](http://www.scala-sbt.org/) - To build the Scala components.
- [yarn](https://yarnpkg.com/) - Npm replacement that makes node deps in a monorepo much easier.

To push the images and run them on kubernetes, you'll need to install:

- [GNU tar](https://www.gnu.org/software/tar/) - (Mac only) MacOS ships with `BSD tar`. However, you will need `GNU tar` for docker images operations. On MacOS, you can install `GNU Tar` via [Homebrew](https://brew.sh/): `brew install gnu-tar`
- [gcloud](https://cloud.google.com/sdk/gcloud/) - For the `kubectl` tool used to control your Kubernetes cluster. You will also need to this to deploy to our test and production environment on Google Cloud.
- [Helm 3](https://helm.sh/docs/intro/install/) to manage kubernetes deployments and config. Magda `0.0.57` and higher requires helm 3 to deploy.
- [Docker](https://docs.docker.com/install/) - Magda uses `docker` command line tool to build docker images.
- [GNU tar](https://www.gnu.org/software/tar/) - (Mac only) MacOS ships with `BSD tar`. However, you will need `GNU tar` for docker images operations. On MacOS, you can install `GNU Tar` via [Homebrew](https://brew.sh/): `brew install gnu-tar`
- [gcloud](https://cloud.google.com/sdk/gcloud/) - For the `kubectl` tool used to control your Kubernetes cluster. You will also need to this to deploy to our test and production environment on Google Cloud.
- [Helm 3](https://helm.sh/docs/intro/install/) to manage kubernetes deployments and config. Magda `0.0.57` and higher requires helm 3 to deploy.
- [Docker](https://docs.docker.com/install/) - Magda uses `docker` command line tool to build docker images.

You'll also need a Kubernetes cluster - to develop locally this means installing either [minikube](./installing-minikube.md) or [docker](./installing-docker-k8s.md) (MacOS only at this stage). We've also started trialing [microk8s](./building-and-running-on-microk8s) on Linux, but we're not sure how well it's going to work long-term. Potentially you could also do this with native Kubernetes, or with a cloud cluster, but we haven't tried it.

Expand Down Expand Up @@ -224,7 +224,8 @@ It's also possible to run what you're working on your host, and the services you
This is super-easy, just run

```bash
kubectl port-forward combined-db-0 5432:5432
kubectl port-forward combined-db-postgresql-0 5432:5432
# or kubectl port-forward combined-db-0 5432:5432 prior to Magda v1.0.0
```

Now you can connect to the database in minikube as if it were running locally, while still taking advantage of all the automatic schema setup that the docker image does.
Expand Down Expand Up @@ -338,7 +339,8 @@ helm install --name magda deploy/helm/magda -f deploy/helm/minikube-dev.yml --se
```bash
# Port forward database
# this command doesn't terminate, so run it in a separate terminal
kubectl port-forward combined-db-0 5432:5432
kubectl port-forward combined-db-postgresql-0 5432:5432
# or kubectl port-forward combined-db-0 5432:5432 prior to Magda v1.0.0
```

3. Start the registry API by executing the following command
Expand Down
12 changes: 7 additions & 5 deletions docs/docs/how-to-create-api-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Magda API keys provide users an alternative option to authenticate their request

Before start to use the `create-api-key` script, you need to:

- Clone Magda repo
- Run `yarn install` to install all dependencies
- Port forward the Magda database to local:
- `kubectl port-forward combined-db-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-0 5432:5432`
- Clone Magda repo
- Run `yarn install` to install all dependencies
- Port forward the Magda database to local:
- `kubectl port-forward combined-db-postgresql-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-postgresql-0 5432:5432`

> Prior to Magda v1.0.0, you should port-forward pod combined-db-0
After the installation is done, run `yarn create-api-key` will list help information as below:

Expand Down
12 changes: 7 additions & 5 deletions docs/docs/how-to-create-local-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ Magda now support creating local authenticated users (instead of SSO). You can u

Before start to use the `set-user-password script, you need to:

- Clone [magda-auth-internal repo](https://github.com/magda-io/magda-auth-internal)
- Run `yarn install` to install all dependencies
- Port forward the Magda database to local:
- `kubectl port-forward combined-db-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-0 5432:5432`
- Clone [magda-auth-internal repo](https://github.com/magda-io/magda-auth-internal)
- Run `yarn install` to install all dependencies
- Port forward the Magda database to local:
- `kubectl port-forward combined-db-postgresql-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-postgresql-0 5432:5432`

> Prior to Magda v1.0.0, you should port-forward pod combined-db-0
After the installation is done, run `yarn set-user-password` will list help information as below:

Expand Down
8 changes: 5 additions & 3 deletions docs/docs/how-to-set-user-as-admin-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Please refer to [acs-cmd utility NPM page](https://www.npmjs.com/package/@magda/

Before start to use the [acs-cmd](https://www.npmjs.com/package/@magda/acs-cmd) utility, you need to:

- Port forward the Magda database to local:
- `kubectl port-forward combined-db-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-0 5432:5432`
- Port forward the Magda database to local:
- `kubectl port-forward combined-db-postgresql-0 5432:5432`
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-postgresql-0 5432:5432`

> Prior to Magda v1.0.0, you should port-forward pod combined-db-0
To set a user as admin users:

Expand Down
2 changes: 2 additions & 0 deletions docs/docs/windows-instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> This document might require some updates since we upgarded to postgreSQL 13 in Magda v1.0.0
This is how @mwu2018 set up his Windows machine (Precision 7730) to develop Magda - it's here as a reference in case you get stuck on something when development Magda under Windows.

1. Enable hyper-v
Expand Down
2 changes: 1 addition & 1 deletion magda-registry-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd <magda project directory>
helm upgrade test2 deploy/helm/magda --namespace test2 --install --recreate-pods -f deploy/helm/local-auth-test.yml --set tags.all=false --set tags.combined-db=true --set tags.authorization-db=true --set tags.registry-db=true
kubectl.exe -n test2 port-forward combined-db-0 5432:5432
kubectl.exe -n test2 port-forward combined-db-postgresql-0 5432:5432
```

If on Windows 10, run
Expand Down
6 changes: 4 additions & 2 deletions packages/acs-cmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ Commands:

> You will need to port forward the Magda database to localhost to make sure the utility can connect to your Magda database.
- To do so, You can run `kubectl port-forward combined-db-0 5432`.
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-0 5432`
- To do so, You can run `kubectl port-forward combined-db-postgresql-0 5432`.
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-postgresql-0 5432`

> Prior to Magda v1.0.0, you should port-forward pod combined-db-0
#### Example

Expand Down
6 changes: 4 additions & 2 deletions packages/org-tree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ Commands:

> You will need to port forward the Magda database to localhost to make sure the utility can connect to your Magda database.
- To do so, You can run `kubectl port-forward combined-db-0 5432`.
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-0 5432`
- To do so, You can run `kubectl port-forward combined-db-postgresql-0 5432`.
- If you didn't install magda to the default namespace, you can use: `kubectl port-forward -n [namespace] combined-db-postgresql-0 5432`

> Prior to Magda v1.0.0, you should port-forward pod combined-db-0
#### Example

Expand Down

0 comments on commit 48835d8

Please sign in to comment.