blob: c34b78824890402443672b53228c741391b1f550 [file] [log] [blame] [view]
giolekvaa71e6182020-12-09 14:26:42 +04001# Development Environment
2
3## Prerequisites
4PCloud uses following tools to build and deploy it's packages:
giolekva1d806492020-12-16 14:13:38 +04005* Docker - To build container images: https://docs.docker.com/get-docker/
giolekvaa71e6182020-12-09 14:26:42 +04006* k3d - To create local Kubernetes cluster for development environment: https://k3d.io/#installation
7* kubectl - To interacto with the cluster: https://kubectl.docs.kubernetes.io/installation/kubectl/
8* Helm - To package and distributes both PCloud core services and applications running on it: https://helm.sh/docs/intro/install/
9
10Each of these tools provide multiple ways of installing them, choose the one which best suits you and your Host OS.
11
giolekva1d806492020-12-16 14:13:38 +040012# Development Instructions
13
giolekvaa71e6182020-12-09 14:26:42 +040014## Installing PCloud
15PCloud installation is two step process:
giolekva1d806492020-12-16 14:13:38 +040016> ./dev/create_dev_cluster.sh # creates local Kubernetes cluster
17> ./dev/install_core_services.sh # installs PCloud core services
18
19## Installing applications
20Under apps/ directory one can find number of sample application for PCloud. Installing any of those requires building container image, creating Helm Chart tarball and uploading it to Application Manager.
21Let's see what that looks like for rpuppy application:
22> bazel run //apps/rpuppy:push_to_dev # builds and pushes container image to localhost:30500 container registry, which is running inside PCloud cluster
23> bazel build //apps/rpuppy:chart # creates Helm Chart tartball which can be found at bazel-bin/apps/rpuppy/chart.tar.gz
24
25## Redeploying core services
26To redeploy one of the core services after making changes in it you have to rebuild container images and restart the running service. Let's see what that looks like for API Service:
27> bazel run //core/api:push_to_dev # builds and pushes container image to localhost:30500 container registry, which is running inside PCloud cluster
28> kubectl -n pcloud rollout restart deployment/api
29
30Reflecting changes in the chart configuration requires reinstallation of the chart itself:
31> bazel build //core/api:chart # creates chart tarball
32> bazel run //core/api:uninstall # uninstalls old Helm Chart from the cluster
33> bazel run //core/api:install # installs new Helm Chart to the cluster