Bicep resource definition
The fluxConfigurations resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
Bicep Samples
A basic example of deploying Kubernetes Flux Configuration.
param location string = 'westeurope'
param resourceName string = 'acctest0001'
resource managedCluster 'Microsoft.ContainerService/managedClusters@2023-04-02-preview' = {
name: resourceName
location: location
properties: {
agentPoolProfiles: [
{
count: 1
mode: 'System'
name: 'default'
vmSize: 'Standard_DS2_v2'
}
]
dnsPrefix: resourceName
}
}
resource extension 'Microsoft.KubernetesConfiguration/extensions@2022-11-01' = {
name: resourceName
scope: managedCluster
properties: {
autoUpgradeMinorVersion: true
extensionType: 'microsoft.flux'
}
}
resource fluxConfiguration 'Microsoft.KubernetesConfiguration/fluxConfigurations@2022-03-01' = {
name: resourceName
scope: managedCluster
dependsOn: [
extension
]
properties: {
gitRepository: {
repositoryRef: {
branch: 'branch'
}
syncIntervalInSeconds: 120
timeoutInSeconds: 120
url: 'https://github.com/Azure/arc-k8s-demo'
}
kustomizations: {
applications: {
dependsOn: [
'shared'
]
force: false
path: 'cluster-config/applications'
prune: false
retryIntervalInSeconds: 60
syncIntervalInSeconds: 60
timeoutInSeconds: 600
}
shared: {
force: false
path: 'cluster-config/shared'
prune: false
retryIntervalInSeconds: 60
syncIntervalInSeconds: 60
timeoutInSeconds: 600
}
}
namespace: 'flux-system'
scope: 'cluster'
sourceKind: 'GitRepository'
suspend: false
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
To create a Microsoft.KubernetesConfiguration/fluxConfigurations resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.KubernetesConfiguration/fluxConfigurations@2022-01-01-preview' = {
scope: resourceSymbolicName or scope
name: 'string'
properties: {
bucket: {
accessKey: 'string'
bucketName: 'string'
insecure: bool
localAuthRef: 'string'
syncIntervalInSeconds: int
timeoutInSeconds: int
url: 'string'
}
configurationProtectedSettings: {
{customized property}: 'string'
}
gitRepository: {
httpsCACert: 'string'
httpsUser: 'string'
localAuthRef: 'string'
repositoryRef: {
branch: 'string'
commit: 'string'
semver: 'string'
tag: 'string'
}
sshKnownHosts: 'string'
syncIntervalInSeconds: int
timeoutInSeconds: int
url: 'string'
}
kustomizations: {
{customized property}: {
dependsOn: [
{
kustomizationName: 'string'
}
]
force: bool
path: 'string'
prune: bool
retryIntervalInSeconds: int
syncIntervalInSeconds: int
timeoutInSeconds: int
}
}
namespace: 'string'
scope: 'string'
sourceKind: 'string'
suspend: bool
}
}
Property Values
Microsoft.KubernetesConfiguration/fluxConfigurations
| Name |
Description |
Value |
| name |
The resource name |
string (required) |
| properties |
Properties to create a Flux Configuration resource |
FluxConfigurationProperties |
| scope |
Use when creating a resource at a scope that is different than the deployment scope. |
Set this property to the symbolic name of a resource to apply the extension resource. |
BucketDefinition
| Name |
Description |
Value |
| accessKey |
Plaintext access key used to securely access the S3 bucket |
string |
| bucketName |
The bucket name to sync from the url endpoint for the flux configuration. |
string |
| insecure |
Specify whether to use insecure communication when puling data from the S3 bucket. |
bool |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration S3 bucket. |
string |
DependsOnDefinition
| Name |
Description |
Value |
| kustomizationName |
Name of the kustomization to claim dependency on |
string |
FluxConfigurationProperties
| Name |
Description |
Value |
| bucket |
Parameters to reconcile to the Bucket source kind type. |
BucketDefinition |
| configurationProtectedSettings |
Key-value pairs of protected configuration settings for the configuration |
FluxConfigurationPropertiesConfigurationProtectedSettings |
| gitRepository |
Parameters to reconcile to the GitRepository source kind type. |
GitRepositoryDefinition |
| kustomizations |
Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. |
FluxConfigurationPropertiesKustomizations |
| namespace |
The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. |
string |
| scope |
Scope at which the operator will be installed. |
'cluster' 'namespace' |
| sourceKind |
Source Kind to pull the configuration data from. |
'Bucket' 'GitRepository' |
| suspend |
Whether this configuration should suspend its reconciliation of its kustomizations and sources. |
bool |
FluxConfigurationPropertiesConfigurationProtectedSettings
FluxConfigurationPropertiesKustomizations
GitRepositoryDefinition
| Name |
Description |
Value |
| httpsCACert |
Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS |
string |
| httpsUser |
Plaintext HTTPS username used to access private git repositories over HTTPS |
string |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| repositoryRef |
The source reference for the GitRepository object. |
RepositoryRefDefinition |
| sshKnownHosts |
Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration git repository. |
string |
KustomizationDefinition
| Name |
Description |
Value |
| dependsOn |
Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. |
DependsOnDefinition[] |
| force |
Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. |
bool |
| path |
The path in the source reference to reconcile on the cluster. |
string |
| prune |
Enable/disable garbage collections of Kubernetes objects created by this Kustomization. |
bool |
| retryIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. |
int |
| syncIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the Kustomization on the cluster. |
int |
RepositoryRefDefinition
| Name |
Description |
Value |
| branch |
The git repository branch name to checkout. |
string |
| commit |
The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. |
string |
| semver |
The semver range used to match against git repository tags. This takes precedence over tag. |
string |
| tag |
The git repository tag name to checkout. This takes precedence over branch. |
string |
ARM template resource definition
The fluxConfigurations resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
To create a Microsoft.KubernetesConfiguration/fluxConfigurations resource, add the following JSON to your template.
{
"type": "Microsoft.KubernetesConfiguration/fluxConfigurations",
"apiVersion": "2022-01-01-preview",
"name": "string",
"properties": {
"bucket": {
"accessKey": "string",
"bucketName": "string",
"insecure": "bool",
"localAuthRef": "string",
"syncIntervalInSeconds": "int",
"timeoutInSeconds": "int",
"url": "string"
},
"configurationProtectedSettings": {
"{customized property}": "string"
},
"gitRepository": {
"httpsCACert": "string",
"httpsUser": "string",
"localAuthRef": "string",
"repositoryRef": {
"branch": "string",
"commit": "string",
"semver": "string",
"tag": "string"
},
"sshKnownHosts": "string",
"syncIntervalInSeconds": "int",
"timeoutInSeconds": "int",
"url": "string"
},
"kustomizations": {
"{customized property}": {
"dependsOn": [
{
"kustomizationName": "string"
}
],
"force": "bool",
"path": "string",
"prune": "bool",
"retryIntervalInSeconds": "int",
"syncIntervalInSeconds": "int",
"timeoutInSeconds": "int"
}
},
"namespace": "string",
"scope": "string",
"sourceKind": "string",
"suspend": "bool"
}
}
Property Values
Microsoft.KubernetesConfiguration/fluxConfigurations
| Name |
Description |
Value |
| apiVersion |
The api version |
'2022-01-01-preview' |
| name |
The resource name |
string (required) |
| properties |
Properties to create a Flux Configuration resource |
FluxConfigurationProperties |
| type |
The resource type |
'Microsoft.KubernetesConfiguration/fluxConfigurations' |
BucketDefinition
| Name |
Description |
Value |
| accessKey |
Plaintext access key used to securely access the S3 bucket |
string |
| bucketName |
The bucket name to sync from the url endpoint for the flux configuration. |
string |
| insecure |
Specify whether to use insecure communication when puling data from the S3 bucket. |
bool |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration S3 bucket. |
string |
DependsOnDefinition
| Name |
Description |
Value |
| kustomizationName |
Name of the kustomization to claim dependency on |
string |
FluxConfigurationProperties
| Name |
Description |
Value |
| bucket |
Parameters to reconcile to the Bucket source kind type. |
BucketDefinition |
| configurationProtectedSettings |
Key-value pairs of protected configuration settings for the configuration |
FluxConfigurationPropertiesConfigurationProtectedSettings |
| gitRepository |
Parameters to reconcile to the GitRepository source kind type. |
GitRepositoryDefinition |
| kustomizations |
Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. |
FluxConfigurationPropertiesKustomizations |
| namespace |
The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. |
string |
| scope |
Scope at which the operator will be installed. |
'cluster' 'namespace' |
| sourceKind |
Source Kind to pull the configuration data from. |
'Bucket' 'GitRepository' |
| suspend |
Whether this configuration should suspend its reconciliation of its kustomizations and sources. |
bool |
FluxConfigurationPropertiesConfigurationProtectedSettings
FluxConfigurationPropertiesKustomizations
GitRepositoryDefinition
| Name |
Description |
Value |
| httpsCACert |
Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS |
string |
| httpsUser |
Plaintext HTTPS username used to access private git repositories over HTTPS |
string |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| repositoryRef |
The source reference for the GitRepository object. |
RepositoryRefDefinition |
| sshKnownHosts |
Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration git repository. |
string |
KustomizationDefinition
| Name |
Description |
Value |
| dependsOn |
Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. |
DependsOnDefinition[] |
| force |
Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. |
bool |
| path |
The path in the source reference to reconcile on the cluster. |
string |
| prune |
Enable/disable garbage collections of Kubernetes objects created by this Kustomization. |
bool |
| retryIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. |
int |
| syncIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the Kustomization on the cluster. |
int |
RepositoryRefDefinition
| Name |
Description |
Value |
| branch |
The git repository branch name to checkout. |
string |
| commit |
The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. |
string |
| semver |
The semver range used to match against git repository tags. This takes precedence over tag. |
string |
| tag |
The git repository tag name to checkout. This takes precedence over branch. |
string |
The fluxConfigurations resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
A basic example of deploying Kubernetes Flux Configuration.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "managedCluster" {
type = "Microsoft.ContainerService/managedClusters@2023-04-02-preview"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
identity {
type = "SystemAssigned"
identity_ids = []
}
body = {
properties = {
agentPoolProfiles = [
{
count = 1
mode = "System"
name = "default"
vmSize = "Standard_DS2_v2"
},
]
dnsPrefix = var.resource_name
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "extension" {
type = "Microsoft.KubernetesConfiguration/extensions@2022-11-01"
parent_id = azapi_resource.managedCluster.id
name = var.resource_name
body = {
properties = {
autoUpgradeMinorVersion = true
extensionType = "microsoft.flux"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "fluxConfiguration" {
type = "Microsoft.KubernetesConfiguration/fluxConfigurations@2022-03-01"
name = var.resource_name
parent_id = azapi_resource.managedCluster.id
body = {
properties = {
scope = "cluster"
namespace = "flux-system"
sourceKind = "GitRepository"
suspend = false
gitRepository = {
url = "https://github.com/Azure/arc-k8s-demo"
timeoutInSeconds = 120
syncIntervalInSeconds = 120
repositoryRef = {
branch = "branch"
}
}
kustomizations = {
shared = {
path = "cluster-config/shared"
timeoutInSeconds = 600
syncIntervalInSeconds = 60
retryIntervalInSeconds = 60
prune = false
force = false
}
applications = {
path = "cluster-config/applications"
dependsOn = ["shared"]
timeoutInSeconds = 600
syncIntervalInSeconds = 60
retryIntervalInSeconds = 60
prune = false
force = false
}
}
}
}
depends_on = [
azapi_resource.extension
]
}
To create a Microsoft.KubernetesConfiguration/fluxConfigurations resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.KubernetesConfiguration/fluxConfigurations@2022-01-01-preview"
name = "string"
parent_id = "string"
body = {
properties = {
bucket = {
accessKey = "string"
bucketName = "string"
insecure = bool
localAuthRef = "string"
syncIntervalInSeconds = int
timeoutInSeconds = int
url = "string"
}
configurationProtectedSettings = {
{customized property} = "string"
}
gitRepository = {
httpsCACert = "string"
httpsUser = "string"
localAuthRef = "string"
repositoryRef = {
branch = "string"
commit = "string"
semver = "string"
tag = "string"
}
sshKnownHosts = "string"
syncIntervalInSeconds = int
timeoutInSeconds = int
url = "string"
}
kustomizations = {
{customized property} = {
dependsOn = [
{
kustomizationName = "string"
}
]
force = bool
path = "string"
prune = bool
retryIntervalInSeconds = int
syncIntervalInSeconds = int
timeoutInSeconds = int
}
}
namespace = "string"
scope = "string"
sourceKind = "string"
suspend = bool
}
}
}
Property Values
Microsoft.KubernetesConfiguration/fluxConfigurations
| Name |
Description |
Value |
| name |
The resource name |
string (required) |
| parent_id |
The ID of the resource to apply this extension resource to. |
string (required) |
| properties |
Properties to create a Flux Configuration resource |
FluxConfigurationProperties |
| type |
The resource type |
"Microsoft.KubernetesConfiguration/fluxConfigurations@2022-01-01-preview" |
BucketDefinition
| Name |
Description |
Value |
| accessKey |
Plaintext access key used to securely access the S3 bucket |
string |
| bucketName |
The bucket name to sync from the url endpoint for the flux configuration. |
string |
| insecure |
Specify whether to use insecure communication when puling data from the S3 bucket. |
bool |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration S3 bucket. |
string |
DependsOnDefinition
| Name |
Description |
Value |
| kustomizationName |
Name of the kustomization to claim dependency on |
string |
FluxConfigurationProperties
| Name |
Description |
Value |
| bucket |
Parameters to reconcile to the Bucket source kind type. |
BucketDefinition |
| configurationProtectedSettings |
Key-value pairs of protected configuration settings for the configuration |
FluxConfigurationPropertiesConfigurationProtectedSettings |
| gitRepository |
Parameters to reconcile to the GitRepository source kind type. |
GitRepositoryDefinition |
| kustomizations |
Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. |
FluxConfigurationPropertiesKustomizations |
| namespace |
The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. |
string |
| scope |
Scope at which the operator will be installed. |
'cluster' 'namespace' |
| sourceKind |
Source Kind to pull the configuration data from. |
'Bucket' 'GitRepository' |
| suspend |
Whether this configuration should suspend its reconciliation of its kustomizations and sources. |
bool |
FluxConfigurationPropertiesConfigurationProtectedSettings
FluxConfigurationPropertiesKustomizations
GitRepositoryDefinition
| Name |
Description |
Value |
| httpsCACert |
Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS |
string |
| httpsUser |
Plaintext HTTPS username used to access private git repositories over HTTPS |
string |
| localAuthRef |
Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. |
string |
| repositoryRef |
The source reference for the GitRepository object. |
RepositoryRefDefinition |
| sshKnownHosts |
Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH |
string |
| syncIntervalInSeconds |
The interval at which to re-reconcile the cluster git repository source with the remote. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the cluster git repository source with the remote. |
int |
| url |
The URL to sync for the flux configuration git repository. |
string |
KustomizationDefinition
| Name |
Description |
Value |
| dependsOn |
Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. |
DependsOnDefinition[] |
| force |
Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. |
bool |
| path |
The path in the source reference to reconcile on the cluster. |
string |
| prune |
Enable/disable garbage collections of Kubernetes objects created by this Kustomization. |
bool |
| retryIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. |
int |
| syncIntervalInSeconds |
The interval at which to re-reconcile the Kustomization on the cluster. |
int |
| timeoutInSeconds |
The maximum time to attempt to reconcile the Kustomization on the cluster. |
int |
RepositoryRefDefinition
| Name |
Description |
Value |
| branch |
The git repository branch name to checkout. |
string |
| commit |
The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. |
string |
| semver |
The semver range used to match against git repository tags. This takes precedence over tag. |
string |
| tag |
The git repository tag name to checkout. This takes precedence over branch. |
string |