Skip to main content

Creating a Cloud Platform environment

Overview

This is a guide to creating an environment (i.e. a namespace) for your service in the Cloud Platform’s Kubernetes cluster.

In Kubernetes, namespaces provide a way to logically isolate your service and application from any others that reside on the Kubernetes cluster.

Creating a Cloud Platform environment is usually one of the first steps to complete when hosting your service on the Cloud Platform.

Once you have completed this guide, you will be able to add AWS resources to your service, such as databases and ECR repositories, and perform kubectl commands against your namespace.

Prerequisites

You will need to:

  • be part of the ministryofjustice GitHub organisation
  • be part of at least one GitHub team for your service
  • have the Cloud Platform CLI installed

Creating a Cloud Platform environment

Once you have met the prerequisites, you can create an environment in the Cloud Platform by following this process:

  1. Clone the cloud-platform-environments repository and change directory into it

    $ git clone https://github.com/ministryofjustice/cloud-platform-environments.git
    $ cd cloud-platform-environments
    
  2. Use the Cloud Platform CLI to create your namespace

    $ cloud-platform environment create
    

    The CLI will prompt you for details about your namespace, and automatically create the appropriate Kubernetes and Terraform files in the correct location. Your namespace must meet the Ministry of Justice’s guidance on naming things.

  3. Create a new branch, add your new files, and create a pull request in the cloud-platform-environments repository

    $ git checkout -b my-new-environment
    $ git add .
    $ git commit -m "Create namespace for my-new-environment"
    $ git push -u origin my-new-environment
    
  4. Post your pull request in #ask-cloud-platform

  5. Once approved by the Cloud Platform team, you can merge it

  6. After your pull request is merged, the Apply pipeline will create your namespace in the cluster

Note: Please create one pull request per environment. This makes it easier for the Cloud Platform team to approve pull requests. If your pull request contains multiple environments, it will be automatically rejected.

Next steps

Once you’ve created your environment and your pull request has been merged, you can:

This page was last reviewed on 2 September 2024. It needs to be reviewed again on 2 March 2025 by the page owner #cloud-platform .
This page was set to be reviewed before 2 March 2025 by the page owner #cloud-platform. This might mean the content is out of date.