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.yaml
You 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-system
API Reference
Section titled “API Reference”Resource Types
Section titled “Resource Types”Appears in:
Field | Description |
---|---|
readyConfigName string | |
bootConfigName string | |
shutdownConfigName string | |
startConfigName string |
Use as described in the Initialization Hooks reference.
LocalStack
Section titled “LocalStack”LocalStack is the Schema for the localstacks
API
Appears in:
Field | Description |
---|---|
apiVersion string | api.localstack.cloud/v1alpha1 |
kind string | LocalStack |
kind string | 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 |
apiVersion string | 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 |
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata . |
spec LocalStackSpec | |
status LocalStackStatus |
LocalStackList
Section titled “LocalStackList”LocalStackList contains a list of LocalStack
Field | Description |
---|---|
apiVersion string | api.localstack.cloud/v1alpha1 |
kind string | LocalStackList |
kind string | 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 |
apiVersion string | 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 |
metadata ListMeta | Refer to Kubernetes API documentation for fields of metadata . |
items LocalStack array |
LocalStackSpec
Section titled “LocalStackSpec”LocalStackSpec defines the desired state of LocalStack
Appears in:
Field | Description |
---|---|
dnsProvider string | |
dnsConfigName string | |
dnsConfigNamespace string | |
debug string | Select one of the following: trace, trace-internal, debug, info, warn, error, warning. |
autoLoadPods string array | |
authToken string | |
hooks Hooks | |
image string | Validate docker image name (with optional tag and registry address) |
resources ResourceRequirements | |
readiness_probe Probe | |
liveness_probe Probe | |
envFrom EnvFromSource array | |
env EnvVar array | |
dnsPolicy DNSPolicy |
LocalStackStatus
Section titled “LocalStackStatus”LocalStackStatus defines the observed state of LocalStack
Appears in:
Field | Description |
---|---|
ready boolean | |
ip string | |
dns string |
PodSpec
Section titled “PodSpec”Appears in:
Field | Description |
---|---|
image string | Validate docker image name (with optional tag and registry address) |
resources ResourceRequirements | |
readiness_probe Probe | |
liveness_probe Probe | |
envFrom EnvFromSource array | |
env EnvVar array | |
dnsPolicy DNSPolicy |