K8s Operator
Introduction
Section titled “Introduction”LocalStack K8s operator is a custom Kubernetes operator that offers LocalStack emulator as a native resource in Kubernetes environments. The operator is designed to simplify the deployment and management of LocalStack in Kubernetes clusters.
Installation
Section titled “Installation”To install the K8s operator, run the following commands:
kubectl apply -f https://raw.githubusercontent.com/localstack/localstack-k8s-operator/v0.2.0/release/crds.yamlkubectl apply -f https://raw.githubusercontent.com/localstack/localstack-k8s-operator/v0.2.0/release/controller.yamlYou can then deploy a LocalStack instance by storing the following file content as localstack.yml and applying it against the cluster via kubectl apply -f localstack.yml.
apiVersion: api.localstack.cloud/v1alpha1kind: LocalStackmetadata:  name: env-0  namespace: defaultspec:  image: localstack/localstack-pro:latest  debug: trace
  authToken: "<my-auth-token>" # Set your LocalStack Auth Token here  autoLoadPods: ["<my-cloudpod>"] # Set your Cloud Pods to automatically load them here (optional)
  dnsProvider: coredns  dnsConfigName: coredns  dnsConfigNamespace: kube-systemAPI Reference
Section titled “API Reference”Resource Types
Section titled “Resource Types”Appears in:
| Field | Description | 
|---|---|
| readyConfigNamestring | |
| bootConfigNamestring | |
| shutdownConfigNamestring | |
| startConfigNamestring | 
Use as described in the Initialization Hooks reference.
LocalStack
Section titled “LocalStack”LocalStack is the Schema for the localstacks API
Appears in:
| Field | Description | 
|---|---|
| apiVersionstring | api.localstack.cloud/v1alpha1 | 
| kindstring | LocalStack | 
| kindstring | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | 
| apiVersionstring | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | 
| metadataObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | 
| specLocalStackSpec | |
| statusLocalStackStatus | 
LocalStackList
Section titled “LocalStackList”LocalStackList contains a list of LocalStack
| Field | Description | 
|---|---|
| apiVersionstring | api.localstack.cloud/v1alpha1 | 
| kindstring | LocalStackList | 
| kindstring | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | 
| apiVersionstring | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | 
| metadataListMeta | Refer to Kubernetes API documentation for fields of metadata. | 
| itemsLocalStack array | 
LocalStackSpec
Section titled “LocalStackSpec”LocalStackSpec defines the desired state of LocalStack
Appears in:
| Field | Description | 
|---|---|
| dnsProviderstring | |
| dnsConfigNamestring | |
| dnsConfigNamespacestring | |
| debugstring | Select one of the following: trace, trace-internal, debug, info, warn, error, warning. | 
| autoLoadPodsstring array | |
| authTokenstring | |
| hooksHooks | |
| imagestring | Validate docker image name (with optional tag and registry address) | 
| resourcesResourceRequirements | |
| readiness_probeProbe | |
| liveness_probeProbe | |
| envFromEnvFromSource array | |
| envEnvVar array | |
| dnsPolicyDNSPolicy | 
LocalStackStatus
Section titled “LocalStackStatus”LocalStackStatus defines the observed state of LocalStack
Appears in:
| Field | Description | 
|---|---|
| readyboolean | |
| ipstring | |
| dnsstring | 
PodSpec
Section titled “PodSpec”Appears in:
| Field | Description | 
|---|---|
| imagestring | Validate docker image name (with optional tag and registry address) | 
| resourcesResourceRequirements | |
| readiness_probeProbe | |
| liveness_probeProbe | |
| envFromEnvFromSource array | |
| envEnvVar array | |
| dnsPolicyDNSPolicy |