The examples below illustrate the use of Resource Definitions to realize a particular capability.
An example may contain several Resource Definitions working in conjunction. These Resource Definitions may be of different Resource Types. Therefore, there is not always a one-to-one relationship of capability to Resource Type. Refer to the description of the individual examples for details.
Add Sidecar
Template Driver
The workload Resource Type can be used to make updates to resources before they are deployed into the cluster. In this example, a Resource Definition implementing the
workload
Resource Type is used to inject the Open Telemetry agent as a sidecar into every workload. In addition to adding the sidecar, it also adds an environment variable called OTEL_EXPORTER_OTLP_ENDPOINT
to each container running in the workload.
(...)
Affinity
Template Driver
This section contains example Resource Definitions using the Template Driver for the affinity of Kubernetes Pods.
(...)
Azure Blob
Terraform DriverBackends
Terraform Driver
Humanitec manages the state file for the
local
backend. This is the backend that is used if no backend is specified.
(...)
Co Provision
Terraform Driver
This section contains an example of Resource Definitions using the Terraform Driver and illustrating the co-provisioning concept.
(...)
Credentials
Terraform Driver
Different Terraform providers have different ways of being configured. Generally, there are 3 ways that providers can be configured:
(...)
Dynamic Credentials
K8s Cluster Aks
This section contains example Resource Definitions using dynamic credentials for connecting to AKS clusters.
(...)
Dynamic Credentials
K8s Cluster Eks
This section contains example Resource Definitions using dynamic credentials for connecting to EKS clusters.
(...)
Dynamic Credentials
K8s Cluster Gke
This section contains example Resource Definitions using dynamic credentials for connecting to GKE clusters.
(...)
Dynamic Credentials
Terraform Driver
Using a Cloud Account type that supports dynamic credentials, those credentials can be easily injected into a Resource Definition using the Terraform Driver. Use a
driver_account
referencing the Cloud Account in the Resource Definition, and access its the credentials through the supplied values as shown in the examples.
(...)
Labels
Template DriverNamespace
Echo Driver
This section contains example Resource Definitions using the Echo Driver for managing Kubernetes namespaces.
(...)
Namespace
Template Driver
This section contains example Resource Definitions using the Template Driver for managing Kubernetes namespaces.
(...)
Node Selector
Template Driver
This section contains example Resource Definitions using the Template Driver for setting nodeSelectors on your Pods.
(...)
Postgres
Echo Driver
This section contains example Resource Definitions using the Echo Driver for PostgreSQL.
(...)
Private Git Repo
Terraform Driver
The Terraform Driver can access Terraform definitions stored in a Git repository. In the case that this repository requires authentication, you must supply credentials to the Driver. The examples in this section show how to provide those as part of the secrets in the Resource Definition based on the Terraform Driver.
(...)
Redis
Echo DriverRunner
Terraform Driver
The Terraform Driver can be configured to execute the Terraform scripts as part of a Kubernetes Job execution in a target Kubernetes cluster, instead of in the Humanitec infrastructure. In this case, you must supply access data to the cluster to the Humanitec Platform Orchestrator.
(...)
Runner Pod Configuration
Terraform Driver
The Terraform Driver can be configured to execute the Terraform scripts as part of a Kubernetes Job execution in a target Kubernetes cluster, instead of in the Humanitec infrastructure. In this case, you must supply access data to the cluster to the Humanitec Platform Orchestrator.
(...)
S3
Terraform DriverSecurity Context
Template Driver
This section contains example Resource Definitions using the Template Driver for adding Security Context on Kubernetes
Deployment
.
(...)
Static Credentials
K8s Cluster Aks
This section contains example Resource Definitions using static credentials for connecting to AKS clusters.
(...)
Static Credentials
K8s Cluster Eks
This section contains example Resource Definitions using static credentials for connecting to EKS clusters.
(...)
Static Credentials
K8s Cluster Git
This section contains example Resource Definitions using static credentials for connecting to a Git repository in (GitOps mode).
(...)
Static Credentials
K8s Cluster Gke
This section contains example Resource Definitions using static credentials for connecting to GKE clusters.
(...)
Static Credentials
K8s Cluster
This section contains example Resource Definitions using static credentials for connecting to generic Kubernetes clusters.
(...)
Tolerations
Template Driver
This section contains example Resource Definitions using the Template Driver for managing tolerations on your Pods.
(...)
Volumes Static Provisioning
Template Driver
This example will let participating Workloads share a common persistent storage service through the Kubernetes volumes system.
(...)