Step by Step Guide#
In this guide we will deploy an application with tilt and namespace in remote OpenShift cluster
-
Clone this sample repo Nordmart-review
-
Install following tools:
Required for local development:
Tilt
v0.22.11 or aboveDocker
20.10.8 or aboveHelm
3 or aboveoc
binaries
Required by this application:
Java
11Maven
3
-
You should have a namespace in remote/local cluster; If you are in SAAP then enable sandbox namespace/project/environment for your tenant; you can read more here
-
Login to cluster
Login into OpenShift and then copy login command
Then click
Display Token
Then copy the login token
And then run this command in the terminal
-
Switch project to sandbox namespace/project/environment
-
Login to OpenShift internal docker registry
First get the OpenShift internal docker registry URL and set in HOST variable name
NOTE: Ask Customer Admin or Cluster Admin to provide you the OpenShift internal registry route
Then login into docker registry with following command:
If you get this error
x509: certificate signed by unknown authority
then you need to update your/etc/docker/daemon.json
file and add the insecure registry -
(Optional) Add Helm chart repos
If you reference Helm charts from private registry then you first need to add it
-
Update Helm dependencies
-
Go through the Tiltfile of the application
-
Check the
local_resource
section in the Tiltfile -
Create
tilt_options.json
fileRemove
.template
from the file namedtilt_options.json.template
And then fill up all three things
namespace
: your sandbox environment namedefault_registry
: the OpenShift internal registry route (you have set in step # 6 in HOST above) and then add your namespace name after/
-
allow_k8s_contexts
: given you are logged in the cluster; then runoc config current-context
to get the value forallow_k8s_contexts
e.g.
-
Go through the
.gitigore
and check tilt and Helm specific ignores -
Go through
.tiltignore
-
Go through
values-local.yaml
in atilt
folder in base application directory.values-local.yaml
should contain the following content. Make sure that replica count should always be 1. -
Validate this application is not running already
-
Run
tilt up
at base directoryOpen the tilt browser; just hit the space
If everything is green then the application will be deployed in the cluster
Press space key to view the progress in Tilt web UI. The application should be running in the namespace used in
tilt_options.json
file. -
Lets browse through some reviews. Go to routes:
Click on the review route:
In the end of the route add
/api/review/329199
Review the JSON output:
-
Lets make one change; we will update the first review text to "Tilt Demo"
Switch back to tilt browser and you will see it has started picking up changes
Within few seconds the change will be deployed; and you can refresh the route to see the change
Awesome! you made it
-
Run
tilt down
to delete the application and related configuration from the namespace