Platforms
Platforms represent the top-level component of the Konfigurate hierarchy within a Control Plane. A Platform is a logical collection of Domains that are grouped by business need or structure. In practice, Platforms typically align to coarse-grained organizational units such as a product line, value stream, or business unit.
Along with Domains, Platforms play a critical role in Konfigurate's security and governance story. They allow us to assign permissions in a way that cascades down to Domains. For example, if we have an Ecommerce Platform, we may have an Ecommerce group we grant basic permissions to at the Platform level, then specific Ecommerce teams may have ownership or elevated access within their respective Domains. We can also specify which cloud services and APIs are available at the Platform level and further restrict them at the Domain level where necessary.
This hierarchy facilitates a powerful way to enforce enterprise standards for a large organization while allowing for a high degree of flexibility and autonomy for a small organization. Basically, it allows for governance when you need it (and autonomy when you don't). This is particularly valuable for organizations with regulatory or compliance requirements, but it's equally valuable for companies wanting to enforce a "golden path"—that is, an opinionated and supported way of building something within your organization. It supports a DevOps model with significantly more standardization, structure, and efficiency.
A small organization or startup may only require a single Platform to begin with. Don't worry, you can always add more later!
While Platforms are a singular concept in Konfigurate, in practice they comprise several different resources which are created and managed by the Control Plane:
- A Platform GCP folder which houses the folders for the Platform's Domains
- A Platform GitLab group which houses the subgroups for the Platform's Domains
- A GCP Workload Identity provider and GitLab CI/CD variables which allow GitLab CI/CD pipelines within the Platform group to securely authenticate with the Platform and its Domains without credentials using OpenID Connect
- GitLab CI/CD variables set on the Platform group to support Workload Identity Federation
- GitLab SAML group links which map identity provider groups specified on the Platform to GitLab roles
The state of these items, along with the overall status of the Platform, can be viewed in the Konfigurate UI, as shown below.
Aside from the Platform folder, Platforms do not result in any resources being created in your GCP organization. The Workload Identity provider is created in the Control Plane which is provided as a managed service. Instead, a Platform is more of a virtual and organizational construct allowing you to apply common governance and access management settings which cascade to Domains contained within the Platform. There is no cost associated with them, so how coarse- or fine-grained your Platforms are is entirely up to you and your organization's needs.
Platforms are managed declaratively using YAML definitions. These definitions live in the Control Plane repository and specify metadata and configuration for the Platform. This configuration includes a number of things:
- Display name of the Platform
- GitLab parent group in which the Platform's subgroup should be created
- GCP billing account to associate with the Platform's Resources
- GCP parent folder in which the Platform's folder should be created
- Default environments
- Cloud services to allow/disallow within Domains
- Cloud services to enable by default if Domains do not specify services
- Group access management
Create a Platform
Platforms are created via GitOps. When a Platform YAML definition is committed to the Control Plane's main branch, Konfigurate creates the Platform and all of its associated resources. This YAML can be created directly or using either the Konfigurate UI or Konfigurate CLI.
Below is an example demonstrating how to create a Platform which has default dev, stage, and prod environments, allows several GCP services with default services set, and sets group permissions.
Refer to the Platform spec for the complete set of Platform configurations.
- YAML
- Konfigurate UI
- Konfigurate CLI
You can create a Platform by applying the YAML definition to the Control Plane repository.
apiVersion: konfig.realkinetic.com/v1alpha8
kind: Platform
metadata:
name: [PLATFORM ID]
namespace: konfig-control-plane
labels:
konfig.realkinetic.com/control-plane: konfig-control-plane
spec:
platformName: [PLATFORM DISPLAY NAME]
gitlab:
parentGroupId: [PARENT GROUP ID]
gcp:
billingAccountId: [BILLING ACCOUNT ID]
parentFolderId: [PARENT FOLDER ID]
defaultEnvs:
- label: dev
- label: stage
- label: prod
services:
allowed:
- cloud-run
- cloud-sql
- pubsub
- redis
- firestore
defaults:
- cloud-run
- cloud-sql
- pubsub
- redis
groups:
dev:
- dev@example.com
maintainer:
- maintainer@example.com
owner:
- owner@example.com
- Navigate to the homepage of the Konfigurate UI.
- Click the + PLATFORM button.
- In the Create Platform dialog, enter your Platform information.
- Click SUBMIT.
- This will create a merge request in the Control Plane repository. Once merged, the Platform will be created.
- Ensure the Konfigurate CLI is installed and initialized.
- Run the
konfig platforms create
command:
konfig platforms create \
--billing-account-id=[BILLING ACCOUNT ID] \
--parent-folder-id=[PARENT FOLDER ID] \
--parent-group-id=[PARENT GROUP ID] \
--default-envs=dev,stage,prod \
--allowed-services=cloud-run,cloud-sql,pubsub,redis,firestore \
--default-services=cloud-run,cloud-sql,pubsub,redis \
--dev=dev@example.com \
--maintainer=maintainer@example.com \
--owner=owner@example.com [PLATFORM DISPLAY NAME]
- This will create a merge request in the Control Plane repository. Once merged, the Platform will be created.
List Platforms
The available Platforms within a Control Plane can be viewed either with the Konfigurate UI or Konfigurate CLI.
- Konfigurate UI
- Konfigurate CLI
- Navigate to the homepage of the Konfigurate UI.
- Platforms will be displayed in both the side navigation and in the main viewport.
- Ensure the Konfigurate CLI is installed and initialized.
- Run the
konfig platforms list
command:
konfig platforms list
The response looks like the following example:
ID NAME CREATED READY
ai-tooling AI Tooling 2024-07-16 20:58:40 +0000 UTC TRUE
auth-services Auth Services 2024-06-25 01:46:47 +0000 UTC TRUE
back-of-house Back of House 2024-06-24 23:35:20 +0000 UTC TRUE
ecommerce Ecommerce 2024-06-07 15:48:14 +0000 UTC TRUE
geo-services Geo Services 2024-06-25 01:46:47 +0000 UTC TRUE
internal-services Internal Services 2024-06-13 16:41:24 +0000 UTC TRUE
locations Locations 2024-06-24 23:35:21 +0000 UTC TRUE
supply-chain Supply Chain 2024-06-11 22:48:34 +0000 UTC TRUE
testing-creation Promotion Pilot 2024-06-25 16:38:46 +0000 UTC TRUE
Get Platform Details
Metadata for a Platform can be retrieved either with the Konfigurate UI or Konfigurate CLI.
- Konfigurate UI
- Konfigurate CLI
- Navigate to the homepage of the Konfigurate UI.
- Locate the desired Platform in the main viewport and click the status icon.
- This will expand a sidebar containing information about the Platform such as links to the Platform in GitLab and GCP as well as its source definition, the Platform status, and the Platform's YAML applied to the Control Plane.
- Ensure the Konfigurate CLI is installed and initialized.
- Run the
konfig platforms describe
command:
konfig platforms describe [PLATFORM ID]
The response looks like the following example:
apiVersion: konfig.realkinetic.com/v1alpha8
kind: Platform
metadata:
name: ecommerce
creationTimestamp: 2024-06-07T15:48:14Z
labels:
konfig.realkinetic.com/control-plane: konfig-control-plane
spec:
platformName: Ecommerce
gitlab:
parentGroupId: 88474985
gcp:
billingAccountId: "123456-123456-123456"
parentFolderId: "38822600023"
defaultEnvs:
- label: dev
services:
defaults:
- cloud-run
- cloud-sql
- pubsub
- firestore
- redis
groups:
dev:
- ecomm-devs@realkinetic.com
maintainer:
- ecomm-maintainers@realkinetic.com
owner:
- gitlab-owners@realkinetic.com
status:
conditions:
- lastTransitionTime: 2024-06-11T22:33:35.428599Z
lastUpdateTime: 2024-08-07T21:05:06.074928Z
message: Platform GCP Folder ready
reason: Ready
status: "True"
type: PlatformFolder
- lastTransitionTime: 2024-06-11T22:33:35.428649Z
lastUpdateTime: 2024-08-07T21:05:06.074995Z
message: Control Plane Workload Identity Pool ready
reason: Ready
status: "True"
type: WorkloadIdentityPool
- lastTransitionTime: 2024-06-11T22:33:35.428695Z
lastUpdateTime: 2024-08-07T21:05:06.075054Z
message: Platform Gitlab Group ready
reason: Ready
status: "True"
type: GitlabGroup
- lastTransitionTime: 2024-06-11T22:33:35.42876Z
lastUpdateTime: 2024-08-07T21:05:06.075114Z
message: Gitlab Group SAML Links ready
reason: Ready
status: "True"
type: GitlabGroupSAML
- lastTransitionTime: 2024-06-11T22:33:35.428824Z
lastUpdateTime: 2024-08-07T21:05:06.075171Z
message: Workload Identity Provider ready
reason: Ready
status: "True"
type: WorkloadIdentityProvider
- lastTransitionTime: 2024-06-11T22:33:35.428891Z
lastUpdateTime: 2024-08-07T21:05:06.075228Z
message: Workload Identity Provider CI Vars ready
reason: Ready
status: "True"
type: GitlabCIVariables
- lastTransitionTime: 2024-06-11T22:33:35.429168Z
lastUpdateTime: 2024-08-07T21:05:06.075329Z
message: Platform ready
reason: Ready
status: "True"
type: Ready
state:
gcp:
platformFolderId: "265862629320"
workloadIdentity:
pool: projects/293544790089/locations/global/workloadIdentityPools/konfig-control-plane
provider: projects/293544790089/locations/global/workloadIdentityPools/konfig-control-plane/providers/ecommerce
gitlab:
group:
id: "88518449"
path: realkinetic/konfig-demo/ecommerce
poolVarSet: true
saml_links:
dev:
- ecomm-devs
maintainer:
- ecomm-maintainers
owner:
- gitlab-owners
workloadIdentityProviderVar: GCP_IDENTITY_PROVIDER
lastReconciled:
generation: 24796
timestamp: 2024-08-07T21:05:06.074829
ready: true
Platform Custom Resource Definition
- v1alpha8
Name | Type | Description | Required |
---|---|---|---|
apiVersion | string | konfig.realkinetic.com/v1alpha8 | true |
kind | string | Platform | true |
metadata | object | Refer to the Kubernetes API documentation for the fields of the metadata field. | true |
spec | object | false | |
status | object | false |
Platform.spec
Name | Type | Description | Required |
---|---|---|---|
gcp | object | true | |
gitlab | object | true | |
platformName | string | Human readable name for the Platform. This must be unique because the GCP Folder and Gitlab Group will have this name. Default's to metadata.name. | true |
groups | object | false |
Platform.spec.gcp
Name | Type | Description | Required |
---|---|---|---|
billingAccountId | string | GCP Billing Account to associate with this Platform's resources. | false |
defaultEnvs | []object | The set of enviornments to create for Domains that do not specify enviornments. Default: [map[label:dev] map[label:stage] map[label:prod]] | false |
parentFolderId | string | GCP Folder where this Platform's Folder will be created. | false |
services | object | false | |
workloadIdentity | object | Default: map[] | false |
Platform.spec.gcp.defaultEnvs[index]
Name | Type | Description | Required |
---|---|---|---|
label | enum | Enum: dev, stage, prod | true |
name | string | false | |
namespace | string | false | |
subnetName | string | The name of the subnet to associate with this environment by default. | false |
Platform.spec.gcp.services
Name | Type | Description | Required |
---|---|---|---|
allowed | []enum | The services Domains may enable. This is an upper-bound restrictive set. If it is an empty list (or unset) then any supported service may be enabled at the domain level. Use this only when the Platform needs to restrict services. | false |
defaults | []enum | The services that will be enabled for Domains that do not specify a set of services to enable. Domains may disable specific services when needed. Default: [cloud-run cloud-sql pubsub redis firestore bigquery] | false |
Platform.spec.gcp.workloadIdentity
Name | Type | Description | Required |
---|---|---|---|
enabled | boolean | Enable Workload Identity Federation for this Platform. Default: true | false |
Platform.spec.gitlab
Name | Type | Description | Required |
---|---|---|---|
parentGroupId | integer | The Gitlab Group that the Platform's Gitlab Group will be created in. | true |
workloadIdentityProviderVar | string | Gitlab CI Variable where the Workload Identity Federation Provider will be set. Default: GCP_IDENTITY_PROVIDER | false |
Platform.spec.groups
Name | Type | Description | Required |
---|---|---|---|
dev | []string | If set, this group will be added to all Domain dev GCP Projects as 'Editor', and 'Viewer' to non-dev Projects. It will be added to the Platform Gitlab Group as developer. | false |
maintainer | []string | If set, this group will be added to all Domain dev GCP Projects as 'Editor', and 'Viewer' to non-dev Projects. It will be added to the Platform Gitlab Group as maintainer. | false |
owner | []string | If set, this group will be added to the Platform Folder and all Domain GCP Projects as 'Editor'. It will be added to the Platform Gitlab Group as maintainer. | false |
Platform.status
Name | Type | Description | Required |
---|---|---|---|
gcp | object | false | |
gitlab | object | false | |
lastReconciled | object | false | |
ready | boolean | false |
Platform.status.gcp
Name | Type | Description | Required |
---|---|---|---|
platformFolderId | string | false | |
workloadIdentity | object | false |
Platform.status.gcp.workloadIdentity
Name | Type | Description | Required |
---|---|---|---|
pool | string | false | |
provider | string | false |
Platform.status.gitlab
Name | Type | Description | Required |
---|---|---|---|
group | object | false |
Platform.status.gitlab.group
Name | Type | Description | Required |
---|---|---|---|
groupId | string | false | |
poolVarSet | boolean | false | |
workloadIdentityProviderVar | string | false |
Platform.status.lastReconciled
Name | Type | Description | Required |
---|---|---|---|
generation | integer | false | |
timestamp | string | false |