Skip to main content
Environments define where your services are deployed. Ryvn provisions and manages infrastructure in target Google Cloud projects, including Kubernetes clusters, networking, load balancers, and DNS. See the full GCP permission reference for the roles and permissions Ryvn needs to provision your environment.

Properties

name

string — required Environment identifier. Must be lowercase, alphanumeric with hyphens only.

labels

object — optional Key-value labels for grouping and filtering environments. Use labels to organize environments by team, region, customer, or any other dimension. Constraints:
  • Maximum 50 labels per environment
  • Keys must start with an alphanumeric character and contain only alphanumerics, dots, hyphens, and underscores
  • Keys and values are each limited to 63 characters

releaseChannel

string — optional Default release channel for installations in this environment. When installations don’t specify a release channel, they use the environment’s channel.

maintenanceWindow

string — optional Maintenance window for this environment. Automated deployments will only occur during specified intervals.

config

object — optional Configuration passed to the Ryvn environment provisioner.

config.region

string — required GCP region where resources will be provisioned.

config.zones

array — optional List of zones for the GKE cluster. If not specified, uses up to three zones in the region.

config.internal_root_domain

string — optional Internal root domain for services using internal networking. If not specified, Ryvn generates an internal domain for the environment, separate from its public domain.

config.public_root_domain

string — optional Public root domain for services using public networking. If not specified, Ryvn generates a default domain in the format {environment}.{org-slug}.ryvn.run.

config.subnet_cidr

string — optional CIDR block for the subnet. Defaults to 10.0.0.0/17.

config.pod_cidr

string — optional CIDR block for pods. Defaults to 192.168.0.0/18.

config.service_cidr

string — optional CIDR block for services. Defaults to 192.168.64.0/18.

config.node_pools

object — optional Map of node pool definitions to create.
location_policy controls which zone the cluster autoscaler scales a regional pool into. BALANCED (the GKE default) spreads nodes evenly across zones; ANY prefers zones with unused reservations and available capacity, which helps pools that scale from zero onto zonal reservations.

config.node_pools_labels

object — optional Map of node pool labels to apply to each node pool.

config.flow_logs

object — optional Configuration for VPC flow logs.

config.external_dns_namespace

string — optional Kubernetes namespace where external-dns is deployed. Defaults to external-dns.

config.skip_dns_provisioning

boolean — optional If true, skips provisioning DNS managed zones. Defaults to false.

config.cluster_bootstrap_perms

boolean — managed by Ryvn Grants the provisioning identity cluster admin permissions so Ryvn can install the agent and its access RBAC after the cluster is created. Ryvn always sets this to true; a value in config is ignored.

config.terraform_executor_policies

object — optional IAM grants for the Ryvn Agent, the in-cluster identity that runs Terraform for your installations. Leave it unset to keep the default custom role, which is shaped as management-without-data-access (see default_permissions in the platform module). Anything you supply replaces the default grants outright, the same way terraform_executor_policies on AWS replaces the default policy. Only the grants you list are bound, so include everything the agent needs for the services you install. roles, permissions, and bindings can be combined.

config.terraform_executor_policies.roles

array — optional Predefined GCP roles to bind to the agent at the project level.

config.terraform_executor_policies.permissions

array — optional Permissions for the agent’s custom role (ryvn_agent_role_ENVIRONMENT), in place of the defaults.

config.terraform_executor_policies.bindings

array — optional Role bindings for the agent, each optionally scoped by an IAM condition. Use this to grant a role only on the resources you intend the agent to manage.
GCP authorizes create permissions on the parent resource (the location for key rings, the project for most resources), so a resource.name condition scopes operations on existing resources but not their creation. Grant the sensitive operations (setIamPolicy, update, destroy) under a condition and leave creation unconditional.
With the default grants, the agent’s destructive Cloud SQL permissions (creating and dropping databases and users, updating or deleting instances, managing backups) are granted through a separate role whose binding is conditioned on a ryvn-managed-ENVIRONMENT tag that the agent attaches to the Cloud SQL instances it provisions — so it cannot touch Cloud SQL instances it did not create. Instances created before this behavior existed carry no tag; re-running the postgres installation attaches it. Supplying any terraform_executor_policies replaces the defaults and drops this scoping. The tag is still attached, so you can restate it with a bindings entry whose condition is resource.matchTag('PROJECT_ID/ryvn-managed-ENVIRONMENT', 'true').

setup

string — optional Environment setup type. Controls who provisions the environment infrastructure. Available values:
  • self - Ryvn Control Plane uses workload identity to provision the infrastructure (default)
  • pre-provisioned - Use existing or externally managed infrastructure

requireApproval

boolean — optional (default: false) When true, deployments require approval before executing. See Deployment Approvals.

provider

object — required GCP provider configuration.

provider.type

string — required Must be gcp.

provider.projectId

string — optional GCP project ID where resources will be provisioned.

provider.credentialConfig

string — optional Credential configuration JSON generated from the workload identity application. This is a JSON string that contains the credential configuration.

namespaces

array — optional Kubernetes namespaces to create in this environment, with optional labels. Ryvn creates each one, adds its own labels, and reapplies yours on every sync. The default namespace (same name as the environment) exists either way; list it only to label it. Removing an entry does not delete the namespace. See Namespaces.
  • name (required): a DNS-1123 label, lowercase alphanumerics and hyphens, up to 63 characters
  • labels (optional): labels to apply to the namespace

platform

object — optional Platform blueprint used to provision the environment and its inputs. Self-provisioned environments default to the Ryvn-managed platform blueprint for the cloud (ryvn.app/gcp-platform); pre-provisioned environments (setup: pre-provisioned) default to ryvn.app/base-platform. See Platform blueprint configuration for the available inputs.

installations

array — read-only Present in the API representation of an environment only. Git export emits each deployed installation as a standalone resource, and git sync does not read this field. To deploy into an environment, declare standalone ServiceInstallation or BlueprintInstallation resources whose spec.environment references the environment:
Installations listed inline under an Environment’s spec.installations are ignored by git sync. Declare them as separate resources.
See Server, Job, Helm Chart, Terraform, and Blueprint installation documentation for details.

Platform blueprint configuration

The GCP platform blueprint (ryvn.app/gcp-platform) accepts the following inputs via the environment’s platform field:

Observability configuration

Apart from workload logs, which the Ryvn collector handles, GKE writes system and control-plane logs to Cloud Logging and system metrics to Cloud Monitoring in your project.

Outputs

Environment outputs are available in service installation configs using template syntax. Reference these values to configure services with infrastructure details provisioned by Ryvn.

.ryvn.env.name

The name of the environment.

.ryvn.env.orgId

The organization ID.

.ryvn.env.defaultNamespace

The default Kubernetes namespace for the environment (typically same as environment name).

.ryvn.env.releaseChannel

The release channel for this environment.

.ryvn.env.provider.type

The provider type (e.g., aws, gcp, azure).

.ryvn.env.provider.gcp.projectId

The GCP project ID where resources are provisioned.

.ryvn.env.config

Environment configuration as a key-value map. Access custom config values you define in your environment using dot notation.

.ryvn.env.state.cluster_name

The name of the GKE cluster.

.ryvn.env.state.cluster_endpoint

Private IP endpoint of the Kubernetes API server, reachable only from inside the VPC.

.ryvn.env.state.cluster_endpoint_dns

DNS-based endpoint of the Kubernetes API server, gated by IAM.

.ryvn.env.state.cluster_region

GCP region where the GKE cluster is deployed.

.ryvn.env.state.ryvn_agent_service_account.email

Email address of the service account for the Ryvn Agent.

.ryvn.env.state.ryvn_agent_service_account.id

ID of the service account for the Ryvn Agent.

.ryvn.env.state.ryvn_agent_service_account.unique_id

Unique ID of the service account for the Ryvn Agent.

.ryvn.env.state.cert_manager_identity.email

Email address of the service account for cert-manager.

.ryvn.env.state.cert_manager_identity.id

ID of the service account for cert-manager.

.ryvn.env.state.cert_manager_identity.unique_id

Unique ID of the service account for cert-manager.

.ryvn.env.state.vpc.id

ID of the VPC network.

.ryvn.env.state.vpc.name

Name of the VPC network.
Self link of the VPC network (required for many GCP resources).

.ryvn.env.state.vpc.subnet_ids

List of subnet IDs.

.ryvn.env.state.vpc.subnet_cidrs

List of subnet CIDR blocks.

.ryvn.env.state.outbound_ips

List of public IPs used for outbound internet traffic from workloads in this environment.

.ryvn.env.state.vpc.nat_public_ips

List of public IPs assigned to Cloud NAT.

.ryvn.env.state.vpc.secondary_ranges.pods.name

Name of the secondary range for pods.

.ryvn.env.state.vpc.secondary_ranges.pods.cidr

CIDR block for the pods secondary range.

.ryvn.env.state.vpc.secondary_ranges.services.name

Name of the secondary range for services.

.ryvn.env.state.vpc.secondary_ranges.services.cidr

CIDR block for the services secondary range.

.ryvn.env.state.public_domain.name

Public root domain name for the environment.

.ryvn.env.state.public_domain.fqdn

Fully qualified domain name for the public domain (includes trailing dot).

.ryvn.env.state.public_domain.id

Cloud DNS managed zone ID for the public domain.

.ryvn.env.state.public_domain.nameservers

List of nameservers for the public domain.

.ryvn.env.state.internal_domain.name

Internal domain name for the environment.

.ryvn.env.state.internal_domain.fqdn

Fully qualified domain name for the internal domain (includes trailing dot).

.ryvn.env.state.internal_domain.id

Cloud DNS managed zone ID for the internal domain.

Examples

Multi-environment setup:
Installations for the other environments follow the same pattern. With custom domains:
Pre-provisioned environment: