content/influxdb3/clustered/install/set-up-cluster/configure-cluster/directly.md
Configure your InfluxDB cluster by editing configuration options in
the AppInstance resource provided by InfluxData.
Resource configuration for your cluster includes the following:
influxdb-docker-config.json: an authenticated Docker configuration file.
The InfluxDB Clustered software is in a secure container registry.
This file grants access to the collection of container images required to
install InfluxDB Clustered.
A tarball that contains the following files:
app-instance-schema.json: Defines the schema
that you can use to validate example-customer.yml and your cluster configuration in tools like Visual Studio Code (VS Code).
example-customer.yml: Configuration for your InfluxDB cluster that includes
information about prerequisites.
[!Note] The following sections refer to a
myinfluxdb.ymlfile that you copy fromexample-customer.ymland edit for your InfluxDB cluster.
When ready to configure your InfluxDB cluster, have the following information available:
You deploy {{% product-name %}} to a Kubernetes namespace, referred to as the
target namespace in the following procedures.
For simplicity, we assume this namespace is influxdb--you can use any name you like.
To manage {{% product-name %}} installation, updates, and upgrades, you edit
and apply a Kubernetes custom resource (CRD)
(AppInstance), which you define in a YAML file that conforms to the app-instance-schema.json schema.
{{% product-name %}} includes example-customer.yml as a configuration template.
The AppInstance resource contains key information, such as:
[!Note]
Update your namespace if using a namespace other than influxdb
If you use a namespace name other than
influxdb, update themetadata.namespaceproperty in yourmyinfluxdb.ymlto use your custom namespace name.
Copy the provided example-customer.yml file to create a new configuration file
specific to your InfluxDB cluster. For example, myinfluxdb.yml.
cp example-customer.yml myinfluxdb.yml
[!Note]
Use VS Code to edit your configuration file
We recommend using Visual Studio Code (VS Code) to edit your
myinfluxdb.ymlconfiguration file due to its JSON Schema support, including autocompletion and validation features that help when editing your InfluxDB configuration. InfluxData provides anapp-instance-schema.jsonJSON schema file that VS Code can use to validate your configuration settings.
The provided influxdb-docker-config.json grants access to a collection of
container images required to run {{% product-name %}}.
Your Kubernetes Cluster needs access to the container registry to pull and
install InfluxDB.
When pulling the {{% product-name %}} image, you're likely in one of two scenarios:
In both scenarios, you need a valid pull secret.
{{< tabs-wrapper >}} {{% tabs %}} Public registry Private registry (air-gapped) {{% /tabs %}}
{{% tab-content %}}
<!--------------------------- BEGIN Public Registry --------------------------->To pull from the InfluxData registry, you need to create a Kubernetes secret in the target namespace.
kubectl create secret docker-registry gar-docker-secret \
--from-file=.dockerconfigjson=influxdb-docker-config.json \
--namespace influxdb
If successful, the output is the following:
secret/gar-docker-secret created
By default, the name of the secret is gar-docker-secret.
If you change the name of the secret, you must also change the value of the
imagePullSecret field in the AppInstance custom resource to match.
{{% /tab-content %}} {{% tab-content %}}
<!--------------------------- BEGIN PRIVATE REGISTRY (AIR-GAPPED) -------------------------->If your Kubernetes cluster can't use a public network to download container images from the InfluxData container registry, follow these steps to copy images and configure the AppInstance for a private registry:
Use crane to copy images from the InfluxData registry to your own private registry.
{{% code-placeholders "PACKAGE_VERSION" %}}
mkdir -p /tmp/influxdbsecret
cp influxdb-docker-config.json /tmp/influxdbsecret/config.json
DOCKER_CONFIG=/tmp/influxdbsecret \
crane manifest \
us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:PACKAGE_VERSION
{{% /code-placeholders %}}
Replace {{% code-placeholder-key %}}PACKAGE_VERSION{{% /code-placeholder-key %}}
with your InfluxDB Clustered package version.
If your Docker configuration is valid and you’re able to connect to the container registry, the command succeeds and the output is the JSON manifest for the Docker image, similar to the following:
{{< expand-wrapper >}} {{% expand "View JSON manifest" %}}
{
"schemaVersion": 2,
"config": {
"mediaType": "application/vnd.kubecfg.bundle.config.v1+json",
"digest": "sha256:6900d2f248e678176c68f3768e7e48958bb96a59232070ff31b3b018cf299aa7",
"size": 8598
},
"layers": [
{
"mediaType": "application/vnd.kubecfg.bundle.tar+gzip",
"digest": "sha256:7c1d62e76287035a9b22b2c155f328fae9beff2c6aa7a09a2dd2697539f41d98",
"size": 404059
}
],
"annotations": {
"org.opencontainers.image.created": "1970-01-01T00:00:00Z",
"org.opencontainers.image.revision": "unknown",
"org.opencontainers.image.source": "kubecfg pack"
}
}
{{% /expand %}} {{< /expand-wrapper >}}
If there’s a problem with the Docker configuration, crane won't retrieve the manifest and the output is similar to the following error:
Error: fetching manifest us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:<package-version>: GET https://us-docker.pkg.dev/v2/token?scope=repository%3Ainfluxdb2-artifacts%2Fclustered%2Finfluxdb%3Apull&service=: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/influxdb2-artifacts/locations/us/repositories/clustered" (or it may not exist)
{{% code-placeholders "PACKAGE_VERSION" %}}
<!-- pytest.mark.skip -->DOCKER_CONFIG=/tmp/influxdbsecret \
crane config \
us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:PACKAGE_VERSION \
| jq -r '.metadata["oci.image.list"].images[]' \
> /tmp/images.txt
{{% /code-placeholders %}}
The output is a list of image names, similar to the following:
us-docker.pkg.dev/influxdb2-artifacts/idpe/idpe-cd-ioxauth@sha256:5f015a7f28a816df706b66d59cb9d6f087d24614f485610619f0e3a808a73864
us-docker.pkg.dev/influxdb2-artifacts/iox/iox@sha256:b59d80add235f29b806badf7410239a3176bc77cf2dc335a1b07ab68615b870c
...
crane to copy the images to your private registry:{{% code-placeholders "REGISTRY_HOSTNAME" %}}
<!-- pytest.mark.skip --></tmp/images.txt xargs -I% crane cp % REGISTRY_HOSTNAME/%
{{% /code-placeholders %}}
Replace {{% code-placeholder-key %}}REGISTRY_HOSTNAME{{% /code-placeholder-key %}}
with the hostname of your private registry--for example:
myregistry.mydomain.io
Configure your AppInstance resource with a reference to your private registry name.
In your myinfluxdb.yml:
spec.package.spec.images.registryOverride to the location of your private registry.spec.imagePullSecrets.name to the pull secret name.{{% expand-wrapper %}}
{{% expand "View myinfluxdb.yml AppInstance configuration" %}}
{{% code-placeholders "REGISTRY_HOSTNAME | PULL_SECRET_NAME" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
metadata:
name: influxdb
namespace: influxdb
spec:
package:
spec:
images:
registryOverride: REGISTRY_HOSTNAME
# Configure connection to PostgreSQL database
values:
global:
catalog:
dsn: "postgres://username:password@postgres-host:5432/influxdb?sslmode=require"
# Configure S3-compatible object storage
objectStorage:
bucket: "influxdb-bucket"
endpoint: "https://s3-endpoint"
accessKeyId: "ACCESS_KEY"
secretAccessKey: "SECRET_KEY"
region: "region"
# Configure image pull secrets if needed
imagePullSecrets:
- name: PULL_SECRET_NAME
{{% /code-placeholders %}} {{% /expand %}} {{% /expand-wrapper %}}
<!---------------------------- END Private Registry (AIR-GAPPED) --------------------------->{{% /tab-content %}} {{< /tabs-wrapper >}}
Update your myinfluxdb.yml configuration file with credentials necessary to
connect your cluster to your prerequisites.
To configure ingress, provide values for the following fields in your
myinfluxdb.yml configuration file:
spec.package.spec.ingress.hosts: Cluster hostnames
Provide the hostnames that Kubernetes should
use to expose the InfluxDB API endpoints.
For example: {{< influxdb/host >}}.
You can provide multiple hostnames. The ingress layer accepts incoming requests for all listed hostnames. This can be useful if you want to have distinct paths for your internal and external traffic.
[!Note] You are responsible for configuring and managing DNS. Options include:
- Manually managing DNS records
- Using external-dns to synchronize exposed Kubernetes services and ingresses with DNS providers.
spec.package.spec.ingress.tlsSecretName: TLS certificate secret name
(Optional): Provide the name of the secret that contains your TLS certificate
and key. The examples in this guide use the name ingress-tls.
[!Note] Writing to and querying data from InfluxDB does not require TLS. For simplicity, you can wait to enable TLS before moving into production. For more information, see Phase 4 of the InfluxDB Clustered installation process, Secure your cluster.
{{% code-callout "ingress-tls|cluster-host.com" "green" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
# ...
ingress:
hosts:
- {{< influxdb/host >}}
tlsSecretName: ingress-tls
{{% /code-callout %}}
To connect your InfluxDB cluster to your object store, provide the required
credentials in your myinfluxdb.yml. The credentials required depend on your
object storage provider.
{{< tabs-wrapper >}} {{% tabs %}} Amazon S3 or S3-compatible Azure Blob Storage Google Cloud Storage {{% /tabs %}}
{{% tab-content %}}
<!---------------------------------- BEGIN S3 --------------------------------->If using Amazon S3 or an S3-compatible object store, provide values for the
following fields in your myinfluxdb.yml:
spec.package.spec.objectStore
bucket: Object storage bucket names3
endpoint: Object storage endpoint URLallowHttp: Set to true to allow unencrypted HTTP connectionsaccessKey.value: Object storage access keysecretKey.value: Object storage secret keyregion: Object storage region{{% code-placeholders "S3_(URL|ACCESS_KEY|SECRET_KEY|BUCKET_NAME|REGION)" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
objectStore:
s3:
# URL for S3 Compatible object store
endpoint: S3_URL
# Set to true to allow communication over HTTP (instead of HTTPS)
allowHttp: 'true'
# S3 Access Key
# This can also be provided as a valueFrom: secretKeyRef:
accessKey:
value: S3_ACCESS_KEY
# S3 Secret Key
# This can also be provided as a valueFrom: secretKeyRef:
secretKey:
value: S3_SECRET_KEY
# Bucket that the Parquet files will be stored in
bucket: S3_BUCKET_NAME
# This value is required for AWS S3, it may or may not be required for other providers.
region: S3_REGION
{{% /code-placeholders %}}
Replace the following:
S3_URL{{% /code-placeholder-key %}}: Object storage endpoint URLS3_ACCESS_KEY{{% /code-placeholder-key %}}: Object storage access keyS3_SECRET_KEY{{% /code-placeholder-key %}}: Object storage secret keyS3_BUCKET_NAME{{% /code-placeholder-key %}}: Object storage bucket nameS3_REGION{{% /code-placeholder-key %}}: Object storage region{{% /tab-content %}} {{% tab-content %}}
<!-------------------------------- BEGIN AZURE -------------------------------->If using Azure Blob Storage as your object store, provide values for the
following fields in your myinfluxdb.yml:
spec.package.spec.objectStore
bucket: Azure Blob Storage bucket nameazure:
accessKey.value: Azure Blob Storage access key
(can use a value literal or valueFrom to retrieve the value from a secret)account.value: Azure Blob Storage account ID
(can use a value literal or valueFrom to retrieve the value from a secret){{% code-placeholders "AZURE_(BUCKET_NAME|ACCESS_KEY|STORAGE_ACCOUNT)" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
objectStore:
# Bucket that the Parquet files will be stored in
bucket: AZURE_BUCKET_NAME
azure:
# Azure Blob Storage Access Key
# This can also be provided as a valueFrom:
accessKey:
value: AZURE_ACCESS_KEY
# Azure Blob Storage Account
# This can also be provided as a valueFrom: secretKeyRef:
account:
value: AZURE_STORAGE_ACCOUNT
{{% /code-placeholders %}}
Replace the following:
AZURE_BUCKET_NAME{{% /code-placeholder-key %}}: Object storage bucket nameAZURE_ACCESS_KEY{{% /code-placeholder-key %}}: Azure Blob Storage access keyAZURE_STORAGE_ACCOUNT{{% /code-placeholder-key %}}: Azure Blob Storage account ID{{% /tab-content %}} {{% tab-content %}}
<!-------------------------------- BEGIN AZURE -------------------------------->If using Google Cloud Storage as your object store, provide values for the
following fields in your myinfluxdb.yml:
spec.package.spec.objectStore
bucket: Google Cloud Storage bucket namegoogle:
serviceAccountSecret.name: the Kubernetes Secret name that contains your
Google IAM service account credentialsserviceAccountSecret.key: the key inside of your Google IAM secret that
contains your Google IAM account credentials{{% code-placeholders "GOOGLE_(BUCKET_NAME|IAM_SECRET|CREDENTIALS_KEY)" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
objectStore:
# Bucket that the Parquet files will be stored in
bucket: GOOGLE_BUCKET_NAME
google:
# This section is not needed if you are using GKE Workload Identity.
# It is only required to use explicit service account secrets (JSON files)
serviceAccountSecret:
# Kubernetes Secret name containing the credentials for a Google IAM
# Service Account.
name: GOOGLE_IAM_SECRET
# The key within the Secret containing the credentials.
key: GOOGLE_CREDENTIALS_KEY
{{% /code-placeholders %}}
Replace the following:
GOOGLE_BUCKET_NAME{{% /code-placeholder-key %}}:
Google Cloud Storage bucket nameGOOGLE_IAM_SECRET{{% /code-placeholder-key %}}:
the Kubernetes Secret name that contains your Google IAM service account
credentialsGOOGLE_CREDENTIALS_KEY{{% /code-placeholder-key %}}:
the key inside of your Google IAM secret that contains your Google IAM account
credentials{{% /tab-content %}} {{< /tabs-wrapper >}}
The InfluxDB catalog is a PostgreSQL-compatible relational database that stores
metadata about your time series data.
To connect your InfluxDB cluster to your PostgreSQL-compatible database,
provide values for the following fields in your myinfluxdb.yml configuration file:
[!Note] We recommend storing sensitive credentials, such as your PostgreSQL-compatible DSN, as secrets in your Kubernetes cluster.
spec.package.spec.catalog.dsn.valueFrom.secretKeyRef
.name: Secret name.key: Key in the secret that contains the DSN{{% code-placeholders "SECRET_(NAME|KEY)" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
catalog:
# A postgresql style DSN that points to a postgresql compatible database.
# postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]
dsn:
valueFrom:
secretKeyRef:
name: SECRET_NAME
key: SECRET_KEY
{{% /code-placeholders %}}
Replace the following:
SECRET_NAME{{% /code-placeholder-key %}}:
Name of the secret containing your PostgreSQL-compatible DSNSECRET_KEY{{% /code-placeholder-key %}}:
Key in the secret that references your PostgreSQL-compatible DSN[!Warning]
Percent-encode special symbols in PostgreSQL DSNs
Percent-encode special symbols in PostgreSQL DSNs to ensure {{% product-name %}} parses them correctly. Consider this when using DSNs with auto-generated passwords that include special symbols for added security.
If a DSN contains special characters that aren't percent-encoded, you might encounter an error similar to the following:
txtCatalog DSN error: A catalog error occurred: unhandled external error: error with configuration: invalid port > numberFor more information, see the PostgreSQL Connection URI docs.
{{< expand-wrapper >}} {{% expand "View percent-encoded DSN example" %}} To use the following DSN containing special characters:
{{% code-callout "#" %}}
postgresql://postgres:meow#[email protected]:5432/postgres
{{% /code-callout %}}
You must percent-encode the special characters in the connection string:
{{% code-callout "%23" %}}
postgresql://postgres:meow%[email protected]:5432/postgres
{{% /code-callout %}}
{{% /expand %}} {{< /expand-wrapper >}}
[!Note]
PostgreSQL instances without TLS or SSL
If your PostgreSQL-compatible instance runs without TLS or SSL, you must include the
sslmode=disableparameter in the DSN. For example:{{% code-callout "sslmode=disable" %}}
postgres://username:passw0rd@mydomain:5432/influxdb?sslmode=disable
{{% /code-callout %}}
InfluxDB ingesters require local storage to store the Write Ahead Log (WAL) for
incoming data.
To connect your InfluxDB cluster to local storage, provide values for the
following fields in your myinfluxdb.yml configuration file:
spec.package.spec.ingesterStorage
.storageClassName: Kubernetes storage class.
This differs based on the Kubernetes environment and desired storage characteristics.storage: Storage size. We recommend a minimum of 2 gibibytes (2Gi).{{% code-placeholders "STORAGE_(CLASS|SIZE)" %}}
apiVersion: kubecfg.dev/v1alpha1
kind: AppInstance
# ...
spec:
package:
spec:
ingesterStorage:
storageClassName: STORAGE_CLASS
storage: STORAGE_SIZE
{{% /code-placeholders %}}
Replace the following:
STORAGE_CLASS{{% /code-placeholder-key %}}:
Kubernetes storage classSTORAGE_SIZE{{% /code-placeholder-key %}}:
Storage size (example: 2Gi){{< page-nav prev="/influxdb3/clustered/install/secure-cluster/auth/" prevText="Set up authentication" next="/influxdb3/clustered/install/set-up-cluster/licensing/" nextText="Install your license" >}}