A Singapore Government Agency Website

Let’s begin…

The CStack application dev clusters for internet and GEN-routable have been decommissioned. The information on this page may be outdated, but we’re updating it soon. Thanks for your patience!

Making the implicit explicit…

The following documentation aims to provide quick tips and points to enhance understanding. We understand that these concepts may not be immediately intuitive to our new users.

Want to jump right in? Check out the Quick Start Guide to deploy your first application on CStack with step-by-step instructions.

GitLab for CStack

Home is where the code is.

Think of GitLab as your home base for Runtime. This is where you will find your application code and configuration code (a.k.a. cstack-manifests).

These are the things you need to know about Gitlab for CStack:

  • Each application repository builds a single container image.
  • You will only have a single cstack-manifests repository per GitLab group.
  • A single cstack-manifests repository can support deployment for multiple apps.

The application repository

The application repositories are for application code.

Before you create project folders for each container image that you want to build, you must create a subgroup within your GitLab group for an application.

Each project folder should contain:

  • .gitlab-ci.yml
  • Dockerfile
  • application code

The application code in the project folder will be available in the Dockerfile as:

./<application code path>

The cstack-manifests repository

These are the things you need to know about your cstack-manifests repository in GitLab:

  • The repository contains 4 folders: base, dev, stg, prd.

  • The repository has 4 branches: main, release/dev, release/stg, release/prd.

  • The repository defaults to Kustomize for templating Kubernetes manifests.

  • The /dev, /stg and /prd folders should not be renamed or moved (stuff would break).

  • The /base folder can be renamed/reorganized, but take note of the filepath(s) when referencing these folders.

    The manifests repository will contain the YAML files that describe your Kubernetes resources to be deployed to our clusters. You will only have 1 manifest repository for all your application code. It is possible to manage deployment of multiple applications within your tenant group with the single manifest repository.

The manifest repository has the following folder structure:

- base
    |-
    |-kustomization.yml    
- dev
    |-patches
        |- ...
    |-kustomization.yml    
- stg
    |-patches
        |- ...
    |-kustomization.yml    
- prd
    |-patches
        |- ...
    |-kustomization.yml    

Important considerations

The base folder will contain YAMLs that are common to all environments. You are encouraged to have your deployment and service YAML specifications in base folder while using the dev/stg/prd folders for managing environment specific YAMLs. (E.g. ingress, sealed-secrets, configmaps). This folder structure leverages Kustomize, which is the de-facto Kubernetes YAML templating engine.

The manifest repository has the following branches:

  • main
  • release/dev
  • release/stg
  • release/prd

To define what gets deployed into the respective environments, you must combine the folder structure and the release branches. For example, /base, /dev, merge to release/dev will result in deployment on development environment.

GitLab subgroups

When you are onboarded to Runtime, you will receive access to a GitLab subgroup under:

  • /wog/gvt/cstack/groups/tenants/internet or
  • /wog/gvt/cstack/groups/tenants/gen

GitLab group name

The group name will look like this /gvt-cstack-demo, using the convention: agency-project-name.

Sometimes you may also notice an addition i or g in your group name. The i represents internet and the g represents gen-routable. (e.g. /gvt-cstack-demo-i and /gvt-cstack-demo-g)

If your project or team name has whitespace in it, we use hyphens to delimit.
Note: Please pardon us if we’ve made any inconsistencies in the names.

Argo CD

These are the things you need to know about Argo CD for CStack:

  • There are 3 Argo CD environments (one per environment)
  • You may sometimes delete Argo CD applications by accident. Please try to avoid this by not completing the deletion prompt.
  • You need to click the pods to view container logs.
  • Argo CD polls cstack-manifests every 90 seconds. If you want to deploy immediately, click refresh.

Ku…ku…Kubernetes!

Say Kubernetes again and we’ll give you peer bonus.

You’ll be assigned namespaces on Kubernetes and you’ll need these for creating secrets and managed databases. Please take note of the prefix and suffix.

  • t-gvt-cstack-demo-dev
  • t-gvt-cstack-demo-stg
  • t-gvt-cstack-demo-prd

For gen-routable environments, the suffix is different.

  • t-gvt-cstack-demo-gen-dev
  • t-gvt-cstack-demo-gen-stg
  • t-gvt-cstack-demo-gen-prd

Taking an app from code to web?

To take your code and deploy it to the web on CStack, the general workflow will be:

  1. Build the code into the container image (the base pipeline handles this).
  2. Update the configuration code in cstack-manifests repository.
  3. Commit the changes and merge to main (it is optional to branch).
  4. Merge from main to release branch (e.g. release/prd).

Proceed to Create an app and Deploy an app.

Chat with me!
Bot Launcher