configfacets/core-concepts
You can learn about, how to implement deployment configurations in this version.
Authentication
Add API authentication details
Readme
User instructions for this resource
Configfacets Example: Deployment Configuration
In this example, we'll explore the deployment configuration for Istio. The Istio ingress controller starts with an IngressGateway, which acts as an entry point for external traffic. It receives incoming requests and processes them based on the Gateway resource, which defines hostnames, ports, and protocols. The IngressGateway then routes the traffic to the appropriate VirtualService, which specifies how requests should be forwarded to the corresponding backend services within the mesh.
Requirements
Environment | Description |
---|---|
Staging | "corp.example.com", "www.corp.example.com", "corp.apis.example.com" |
Production | "example.com", "www.example.com", "apis.example.com" |
- In both environments, all hosts listen on port 443, and the IngressGateway requires an additional NodePort listener on port 30002.
- The configuration for host setup in the Gateway resource and the Istio IngressGateway configuration must be managed within the same endpoint, allowing for easy installation and removal as needed.
Design Decisions
The Configfacets Service data structure is designed to generate configurations dynamically based on templates, overrides, and values. Additionally, it supports the creation of multiple configurations, making it an efficient solution for this use case.
Resource | Description |
---|---|
Example Inc - Values | Stores all deployment-related configuration values, identified by global variables , , and . |
Gateway Configuration | Utilizes Istio repository v1 components, including the Gateway template, Gateway Overrides and Example Inc - Values |
Istio LoadBalancer | Utilizes Kubernetes Service Resources v1 - Service, and Example Inc - Values but does not have any overrides collection |
Istio Services Request Context | Stores relevant global variable keys that need to be referenced in Example Inc - Values |
Istio Services | Istio Services executes Gateway Configuration and Istio LoadBalancer using Istio Services Request Context |
Istio Services Request Context
The Istio Services Request Context provides a dynamic way to configure Istio resources by allowing environment-based filtering at runtime.
{
"facets": [
"env:{{ env }}"
],
"globalvars": {
"__NS_ID__": "istio",
"__SVC_ID__": "loadbalancer",
"__GATEWAY_ID__": "gateway"
}
}
- The {{ env }} placeholder allows runtime substitution with values such as staging or prod.
- The resulting context is then applied to Gateway Configuration and Istio LoadBalancer
Execution
Request Body:
{
"env": "prod"
}
Step 1
During execution, the
value is injected into the Istio Services Request Context, replacing env
with "prod".{{ env }}
A filter (
) is applied to the Example Inc - Values, extracting the relevant configuration values."env:prod"
Step 2
The
are executed as per execution settings and final template is derivedGateway Configuration
The
are executed as per execution settings and final template is derivedIstio LoadBalancer
Step 3
The final values derived from
are applied to Step 1
Step 2