The purpose of the workshop is to give a general and hands-on introduction to Radix.
- Have access to the Radix Playground
- Apply for access to the Radix Playground in AccessIT (search for
Radix Playground Users
) - Find Radix at https://console.playground.radix.equinor.com
- Apply for access to the Radix Playground in AccessIT (search for
- Account on github.com
- Git installed and working locally against github.com
- Docker running locally
- Node js eco system installed and running (Download Nodejs)
- Local dev. environment (IDE++)
- Laptop that "works" on “Statoil Approved” WiFi. If not - know how to handle proxy fun for both Docker and local development environment
Scenario
Your team has just started developing an application that generates secure passwords and displayes it in a web client. To get feedback from end users as fast as possible, your team have chosen to do UI first development. To facilitate a short feedback loop, automated CI/CD (automate build/deploy) of the application needs to be setup, ending with a public url that users can test.
An OpenAPI specification has been agreed on with the API team, so we'll begin with mocking data for the UI. Radix has been choosen as platform, seemingly perfect for the scenario.
- Fork repository to your home on github. Consider choosing an alternative name for the repository
- Clone your newly forked repository down to your developer laptop
- Move into the www folder and explore how to develop the WWW app using
ReactJs
andNode.js
as well as Dockerizing the application.
- The Radix cluster we use for the workshop is available at https://console.playground.radix.equinor.com/
- Radix documentation is available at https://www.radix.equinor.com/
Important to know:
- The difference between
platform user
andapplication user
- Important terminology:
application
,environments
,components
, andreplicas
Important Radix Concepts radixconfig.yaml
- lives on the master branch and is your infrastrucure as code - drive your app in Radix.
- Reading about radixconfig.yaml in docs
- Exploring the config file for the example app ./radixconfig.yaml
- Update the
your app name
of the application in radixconfig.yaml - it needs to be unique in cluster - Follow the getting started guide or "just do it!"
- Do a change in app, commit and push to master to trigger the initial build and deploy to Radix. Examine web-hooks and reponse in Radix
- Verify that the app work on the public end-point it has been given.
Scenario
The UI is comming along nicely, and your team has started on the API. Next step is to integrate the API with the UI, so users can also start testing the logic behind password generation.
- Move into the echo folder and explore how to develop the Echo app using
Node.js
as well as Dockerizing the application.
- Move into UI and disable the use of Mock data.
- Run Echo API locally
- Run www locally
- Verify in log that requests are being handled by API
- Add Echo app to radixconfig.yaml
- Update nginx.conf to forward request to echo api
- Commit code to Master branch.
- Verify the changes in Radix. Look at the Radix Host name, which should jump between the two replicas we've setup for the API.
- Do a change on master branch either in the api or ui
- commit and push to master branch
- Verify that there is no downtime during the release of a new version
Radix run on top of Kubernetes, which support rolling updates. This means that traffic will not be routed to the newly deploy api before it is up and running.
Scenario
The MVP of the application is done, and next step is to setup a production environment. There is sadly too few automated tests to support a clean Trunk base development, but we will do something similar.
We'll setup 2 new environments, QA and prod. A build/deploy to QA will be triggered by push to "release" branches. When the QA version has been verified its manually promoted to prod environment.
Radix support connecting a branch to a specific environment. Let's explore this.
- Add two new environments in radixconfig.yaml file - QA and prod. QA should be built from release/* branch (whenever someone publish to a release/* branch).
- Commit and push changes to master branch, explore what's happening in Radix.
- Check out a new branch "release/0.1.0" from master branch
- Commit and push the new branch, explore what's happening in Radix.
- Verified that the application is running as expected in QA environment.
- Do a promotion of the deployment running in QA to prod environment.
- Verified that the application is running as expected in prod environment.
Radix support refering to prebuild docker images. This can be used to introduce common services as proxies, caching, authentication etc. In this part we will explore how to reference an existing image to add OpenId Connect authentication to the application.
If there is time we will go through an example together during workshop.
If you have access to create an app in Azure AD, you can perform this part. You can follow the instruction from example.
- Use OAuth proxy developed by pusher to add Authentication
- Update radixconfig file. See example on how it can be done
- Remember to disable the public endpoint for
www
component in radixconfig file (publicPort should not be set) - Optional: get the authentication to work locally using docker-compose - the format is similar to radixconfig
- Commit & push to master branch to verify setup
The Echo component is exposing metrics on the /metrics endpoint. These metrics are scraped by Prometheus and made available in Grafana. Consult the docs for Prometheus and Grafana for how to work with metrics and monitoring.
(Status as of September 2019)
- Storage - databases
- Authentication
- Logging
- Metrics - Monitoring
- Radix CLI (Api)
- Backup & Disaster recovery
- Own domain names / urls for apps
- Radix on #Slack (#omnia_radix, #omnia_radix_support)
- Radix site
- Radix on github.com
- Radix Getting Started - https://www.radix.equinor.com/
It makes sense to examing existing issues and perhaps discuss on Slack prior to logging a new one
- The application is currently hosted under a *.radix.equinor.com domain. This is OK for now, but it has been identified that for the future we'll want our own *.equinor.com domain as is possible in Radix.
- Move your own apps into Radix