Skip to main content

Quick Start

On this page a simple deployment of Rocket Pad Platform is being described.

Prerequisites

Infrastructure

  • Kubernetes cluster and API access to it
  • Remote Git repository (e. g. on GitHub.com or Gitlab.com)

Tools

Preparation

Create and initialize Git Repository

The created Git remote repository must be accessible from within the cluster.

mkdir my-cluster
cd my-cluster
git init
git remote add https://git.example.com/my-repo.git

Add Platform Dependencies

Execute the following commands to add the Rocket Pad Platform Jsonnet dependency to the repository.

mkdir deps
cd deps
jb init
yq -i -oj ".legacyImports = false" jsonnetfile.json # Disable legacy imports
# Currently the `wip` branch is the default branch
jb install https://gitlab.com/rocketpadplatforms/platform/base.git@wip
cd ..
git add ./deps

Configure Platform

Basic configuration of Rocket Pad Platform.

mkdir bootstrap

Create the following files.

The bootstrap/config.libsonnet file contains the configuration for Rocket Pad Platform.

bootstrap/config.libsonnet
{
local this = self,
baseDomains: [
# This is the base domain for the platform.
'my-cluster.example.com',
],
}

The bootstrap/dynamic-config.libsonnet file contains the configuration like the bootstrap/config.libsonnet file for Rocket Pad Platform, but is intended for sensitive information, which should not be committed to a Git repository.

In case the remote Git repository is private, the credentials to read the repository should be passed using the dynamic config, to enable Argo CD pulling the configuration.

Never push sensitive data to Git!

To prevent sensitive data from accidental leaking, never push sensitive data like the bootstrap/dynamic-config.libsonnet file to Git!

bootstrap/dynamic-config.libsonnet
{
argocd+: {
platformRepoCreds+: {
enabled: true,
username: 'my-username',
password: 'my-password',
},
},
}

Create a bootstrap/.gitignore file to avoid pushing the dynamic config to git.

bootstrap/.gitignore
/dynamic-config.*sonnet

The bootstrap/main.jsonnet file contains glue code for the platform. It can be extended to deploy additional resources.

bootstrap/main.jsonnet
local platformApps = import '../deps/vendor/gitlab.com/rocketpadplatforms/platform/base/apps.libsonnet';
local rootApp = import '../deps/vendor/gitlab.com/rocketpadplatforms/platform/base/root.libsonnet';
local config = import './config.libsonnet';

local path = import '../deps/vendor/gitlab.com/rocketpadplatforms/platform/base/deps/vendor/gitlab.com/rocketpadplatforms/platform/util-libsonnet/util-libsonnet/path.libsonnet';
local util = import '../deps/vendor/gitlab.com/rocketpadplatforms/platform/base/deps/vendor/gitlab.com/rocketpadplatforms/platform/util-libsonnet/util-libsonnet/util.libsonnet';

function(root=false, repoURL='https://git.example.com/my-repo.git', revision='HEAD', pathPrefix='./bootstrap', dynamicConfig={})

local apps = {
platform: platformApps(repoURL, revision, (path.new(pathPrefix) + path.join('../deps/vendor/gitlab.com/rocketpadplatforms/platform/base/')).path, dynamicConfig=dynamicConfig) {
config+: config + dynamicConfig,
},
};

if !root then
apps.platform.flattened
else
apps.platform.bootstrap
+ [rootApp(repoURL=repoURL, revision=revision, path=pathPrefix, dynamicConfig=dynamicConfig)]

Run the following command to add the bootstrap directory to Git.

git add bootstrap/

Commit and push Files

To bootstrap the cluster, add the files created files to Git, commit them and push them to the Git remote repository.

git commit
git push

Bootstrap Platform

Use the following command to evaluate the platform configuration.

# Argo CD deployment including the root application
jsonnet -y --tla-code root=true --tla-code "dynamicConfig=(import 'bootstrap/dynamic-config.libsonnet')" bootstrap/main.jsonnet

# Argo CD platform applications
jsonnet -y --tla-code "dynamicConfig=(import 'bootstrap/dynamic-config.libsonnet')" bootstrap/main.jsonnet

To deploy the platform to your Kubernetes cluster, execute the following command.

jsonnet -y --tla-code root=true --tla-code "dynamicConfig=(import 'bootstrap/dynamic-config.libsonnet')" bootstrap/main.jsonnet | kubectl apply -f -

Checking the status of Argo CD and the root application can be done via the following commands.

# Get status of Argo CD pods
kubectl get pods -n argocd

# Get status of root application
kubectl describe apps/bootstrap-n argocd