Kubernetes
When installing on Kubernetes, these configuration settings can be used to override the default Kubernetes
configuration. Kubernetes configuration can be set on each component in the install API using the kubeSpec
field.
The API allows for customization of every field in the rendered Kubernetes manifests. The more common configuration fields, such as resources and service type, are supported directly; and can be configured like so:
apiVersion: install.tetrate.io/v1alpha1
kind: ManagementPlane
metadata:
name: managementplane
spec:
hub: docker.io/tetrate
components:
apiServer:
kubeSpec:
service:
type: LoadBalancer
deployment:
resources:
limits:
memory: 750Mi
requests:
memory: 500Mi
All components have a deployment
and service
object. Some, such as apiServer
, also have a job
object
associated with them. This can be configured in a similar manner:
apiVersion: install.tetrate.io/v1alpha1
kind: ManagementPlane
metadata:
name: managementplane
spec:
hub: docker.io/tetrate
components:
apiServer:
kubeSpec:
job:
podAnnotations:
annotation-key: annotation-value
Not all fields in a Kubernetes manifest can be configured directly. This is to avoid re-implementing the entire
Kubernetes API within the install API. Instead, the kubeSpec
object provides an overlays mechanism. This field
is applied after the operator renders the initial manifests and enables support for customization of any field
in a rendered manifest.
Overlays can be applied by selecting the Kubernetes object you wish to overlay and then describe a list of patches
you wish to apply. For example, to add a hostPort
on port 8443 to the frontEnvoy
component, do the following:
apiVersion: install.tetrate.io/v1alpha1
kind: ManagementPlane
metadata:
name: managementplane
spec:
hub: docker.io/tetrate
components:
frontEnvoy:
kubeSpec:
overlays:
- apiVersion: apps/v1
kind: Deployment
name: envoy
patches:
- path: spec.template.spec.containers.[name:envoy].ports.[containerPort:8443].hostPort
value: 8443
The path refers to the location of the field in the Kubernetes object you with to patch. The format is
a.[key1:value1].b.[:value2]
. Where [key1:value1]
is a selector for a key-value pair to identify a list
element and [:value]
is a value selector to identify a list element in a leaf list. All path intermediate nodes
must exist.
Overlays are inspired by and bear a loose resemblence to [kustomize](https://kustomize.io/)
. We use the library from the Istio Operator. For more examples of how to construct paths take a look
at the tests in the upstream.
Affinity
The scheduling constraints for the pod. https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
Field | Description | Validation Rule |
---|---|---|
nodeAffinity | tetrateio.api.install.kubernetes.NodeAffinity | – |
podAffinity | tetrateio.api.install.kubernetes.PodAffinity | – |
podAntiAffinity | tetrateio.api.install.kubernetes.PodAntiAffinity | – |
CNI
Configure Istio's CNI plugin For further details see: https://istio.io/docs/setup/additional-setup/cni/
Field | Description | Validation Rule |
---|---|---|
binaryDirectory | string | – |
configurationDirectory | string | – |
chained | bool | – |
configurationFileName | string | – |
clusterRole | string | – |
ClientIPConfig
Field | Description | Validation Rule |
---|---|---|
timeoutSeconds | – |
ConfigMapKeySelector
Field | Description | Validation Rule |
---|---|---|
localObjectReference | – | |
key | – | |
optional | – |
ContainerPort
ContainerPort represents a network port in a single container.
Field | Description | Validation Rule |
---|---|---|
name | string | – |
hostPort | int32 | – |
containerPort | int32 | – |
protocol | string | – |
hostIP | string | – |
CrossVersionObjectReference
Field | Description | Validation Rule |
---|---|---|
kind | – | |
name | – | |
apiVersion | – |
Deployment
The Kubernetes resource configuration for a Deployment
Field | Description | Validation Rule |
---|---|---|
podAnnotations | map<string, string> | – |
env | List of tetrateio.api.install.kubernetes.EnvVar | – |
affinity | tetrateio.api.install.kubernetes.Affinity | – |
replicaCount | uint32 | – |
resources | tetrateio.api.install.kubernetes.Resources | – |
strategy | tetrateio.api.install.kubernetes.DeploymentStrategy | – |
tolerations | List of k8s.io.api.core.v1.Toleration | – |
hpaSpec | tetrateio.api.install.kubernetes.HorizontalPodAutoscalerSpec | – |
DeploymentStrategy
The deployment strategy to use to replace existing pods with new ones. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#deploymentstrategy-v1-apps
Field | Description | Validation Rule |
---|---|---|
type | – | |
rollingUpdate | – |
EnvVar
Field | Description | Validation Rule |
---|---|---|
name | – | |
value | – | |
valueFrom | – |