Getting started
As always, if you encounter any problems or if you are stuck at any point, please check out the how to get help section.
The aim of this tutorial is to take you through the bare minium of what your app needs in order for Iterapp to build, deploy and manage it.
Minimum setup to deploy app
We will be working on our cats example app, but feel free to adopt the concepts to your own app.
Remember to change cats
to the name of your app.
-
Add your apps repository to the Iterate organisation
Go ahead and create your repo by:
https://github.com/organizations/iterate/repositories/new
-
Register your app
V2 ✨ V3 ✨ The primary means of interacting with Iterapp is through the slack-bot. To register your application from step 1, open slack-channel
#iterapp-logs
, changecats
to whatever name your app is and write the command:/iterapp register cats
The primary means of interacting with HOPS is through the CLI. To register your application from step 1:
-
Install the CLI: (see CLI documentation for more)
curl -SsLf https://cli.headless-operations.no/install.sh | sh
-
Log in:
hops v3 login
-
change
cats
to whatever name your app is and write the command:hops v3 register --cluster iterapp iterate/cats
-
-
Add a Dockerfile
Your repo must have a
Dockerfile
which Iterapp will use to create a container to run your application. This file must be in the root folder of your app. The content of theDockerfile
depends on the language your app is created in. See examples of apps using Dockerfile..Our example app has this content:
FROM nginx:1.15.12-alpine # Copy landingpage-file to /usr/share/nginx/html. COPY index.html /usr/share/nginx/html
-
Add iterapp.toml
Your repo must have an iterapp.toml-file which instructs Iterapp on how to deploy the app in kubernetes. This file must be in the root folder of your app. Use it to only override settings that differentiate from the default settings. See iterapp.toml for a full overview.
Example:
port = 80 readiness_path = "/health"
Read more about readiness_path.
Commit and push
iterapp.toml
andDockerfile
to master-branch and your build will automatically start. You can see more details about your build by visiting your repo and click on the yellow-build button at your commit. -
The build
V2 ✨ V3 ✨ When your build has finished, a slack-message will appear at
#iterapp-logs
. Iterapp will automatically start a deploy of your app to the test-environment.When this has finished, a slack-message will appear with a URL for your app to the test-environment. It will look similar to this: Cats example app.. The SSL-certificate will be ready after a minute or two.
When your build starts, it will appear on the web site.
When the build finishes, a deployment wil be created for the test environment, and it will also appear on the web site.
Your app will be public on a URL similar to
https://cats.test.terate.no
. The SSL-certificate will be ready after a minute or two. -
Deploy your app to prod
V2 ✨ V3 ✨ You must use
#iterapp-logs
whenever you want to deploy your app. If you are ready to deploy your app to production, you can write this command directly in the#iterapp-logs
-channel./iterapp deploy cats prod master
/iterapp deploy appname env branch
-> instructs iterapp to deploy appname to a given env ('prod', 'test', 'snap0' to 'snap-9'), and with branch-name specifying what code is going to be pushed.You must use the CLI whenever you want to deploy your app. If you are ready to deploy your app to production, you can write this command:
hops v3 deploy -a cats -e prod -r master
hops v3 deploy -a appname -e env -r branch
instructs HOPS to deploy appname to a given env (prod
,test
,snap0
tosnap9
), and with branch-name specifying what code is going to be pushed.
Congratulations!
Hopefully you will now have an app deployed to production using Iterapp.
But Iterapp offers more! Go ahead and pick your next read from the Get started section.