{
  "description": "allows customize `clickhouse-operator` settings, need restart clickhouse-operator pod after adding, more details https://github.com/Altinity/clickhouse-operator/blob/master/docs/operator_configuration.md",
  "properties": {
    "spec": {
      "description": "Allows to define settings of the clickhouse-operator.\nMore info: https://github.com/Altinity/clickhouse-operator/blob/master/config/config.yaml\nCheck into etc-clickhouse-operator* ConfigMaps if you need more control\n",
      "properties": {
        "annotation": {
          "description": "defines which metadata.annotations items will include or exclude during render StatefulSet, Pod, PVC resources",
          "properties": {
            "exclude": {
              "description": "When propagating labels from the chi's `metadata.annotations` section to child objects' `metadata.annotations`,\nexclude annotations with names from the following list\n",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "include": {
              "description": "When propagating labels from the chi's `metadata.annotations` section to child objects' `metadata.annotations`,\ninclude annotations with names from the following list\n",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "clickhouse": {
          "description": "Clickhouse related parameters used by clickhouse-operator",
          "properties": {
            "access": {
              "description": "parameters which use for connect to clickhouse from clickhouse-operator deployment",
              "properties": {
                "password": {
                  "description": "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName",
                  "type": "string"
                },
                "port": {
                  "description": "Port to be used by operator to connect to ClickHouse instances",
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                },
                "rootCA": {
                  "description": "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse",
                  "type": "string"
                },
                "scheme": {
                  "description": "The scheme to user for connecting to ClickHouse. Possible values: http, https, auto",
                  "type": "string"
                },
                "secret": {
                  "properties": {
                    "name": {
                      "description": "Name of k8s Secret with username and password to be used by operator to connect to ClickHouse instances",
                      "type": "string"
                    },
                    "namespace": {
                      "description": "Location of k8s Secret with username and password to be used by operator to connect to ClickHouse instances",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "timeouts": {
                  "description": "Timeouts used to limit connection and queries from the operator to ClickHouse instances, In seconds",
                  "properties": {
                    "connect": {
                      "description": "Timout to setup connection from the operator to ClickHouse instances. In seconds.",
                      "maximum": 10,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "query": {
                      "description": "Timout to perform SQL query from the operator to ClickHouse instances. In seconds.",
                      "maximum": 600,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "username": {
                  "description": "ClickHouse username to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "addons": {
              "description": "Configuration addons specifies additional settings",
              "properties": {
                "rules": {
                  "description": "Array of set of rules per specified ClickHouse versions",
                  "items": {
                    "properties": {
                      "spec": {
                        "description": "spec",
                        "properties": {
                          "configuration": {
                            "description": "allows configure multiple aspects and behavior for `clickhouse-server` instance and also allows describe multiple `clickhouse-server` clusters inside one `chi` resource",
                            "properties": {
                              "files": {
                                "description": "see same section from CR spec",
                                "type": "object",
                                "x-kubernetes-preserve-unknown-fields": true
                              },
                              "profiles": {
                                "description": "see same section from CR spec",
                                "type": "object",
                                "x-kubernetes-preserve-unknown-fields": true
                              },
                              "quotas": {
                                "description": "see same section from CR spec",
                                "type": "object",
                                "x-kubernetes-preserve-unknown-fields": true
                              },
                              "settings": {
                                "description": "see same section from CR spec",
                                "type": "object",
                                "x-kubernetes-preserve-unknown-fields": true
                              },
                              "users": {
                                "description": "see same section from CR spec",
                                "type": "object",
                                "x-kubernetes-preserve-unknown-fields": true
                              }
                            },
                            "type": "object",
                            "additionalProperties": false
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      },
                      "version": {
                        "description": "ClickHouse version expression",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "array"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "configuration": {
              "properties": {
                "file": {
                  "properties": {
                    "path": {
                      "description": "Each 'path' can be either absolute or relative.\nIn case path is absolute - it is used as is.\nIn case path is relative - it is relative to the folder where configuration file you are reading right now is located.\n",
                      "properties": {
                        "common": {
                          "description": "Path to the folder where ClickHouse configuration files common for all instances within a CHI are located.\nDefault value - config.d\n",
                          "type": "string"
                        },
                        "host": {
                          "description": "Path to the folder where ClickHouse configuration files unique for each instance (host) within a CHI are located.\nDefault value - conf.d\n",
                          "type": "string"
                        },
                        "user": {
                          "description": "Path to the folder where ClickHouse configuration files with users settings are located.\nFiles are common for all instances within a CHI.\nDefault value - users.d\n",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "network": {
                  "description": "Default network parameters for any user which will create",
                  "properties": {
                    "hostRegexpTemplate": {
                      "description": "ClickHouse server configuration `<host_regexp>...</host_regexp>` for any <user>",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "user": {
                  "description": "Default parameters for any user which will create",
                  "properties": {
                    "default": {
                      "properties": {
                        "networksIP": {
                          "description": "ClickHouse server configuration `<networks><ip>...</ip></networks>` for any <user>",
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "password": {
                          "description": "ClickHouse server configuration `<password>...</password>` for any <user>",
                          "type": "string"
                        },
                        "profile": {
                          "description": "ClickHouse server configuration `<profile>...</profile>` for any <user>",
                          "type": "string"
                        },
                        "quota": {
                          "description": "ClickHouse server configuration `<quota>...</quota>` for any <user>",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "configurationRestartPolicy": {
              "description": "Configuration restart policy describes what configuration changes require ClickHouse restart",
              "properties": {
                "rules": {
                  "description": "Array of set of rules per specified ClickHouse versions",
                  "items": {
                    "properties": {
                      "rules": {
                        "description": "Set of configuration rules for specified ClickHouse version",
                        "items": {
                          "description": "setting: value pairs for configuration restart policy",
                          "type": "object",
                          "x-kubernetes-preserve-unknown-fields": true
                        },
                        "type": "array"
                      },
                      "version": {
                        "description": "ClickHouse version expression",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "array"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "metrics": {
              "description": "parameters which use for connect to fetch metrics from clickhouse by clickhouse-operator",
              "properties": {
                "timeouts": {
                  "description": "Timeouts used to limit connection and queries from the metrics exporter to ClickHouse instances\nSpecified in seconds.\n",
                  "properties": {
                    "collect": {
                      "description": "Timeout used to limit metrics collection request. In seconds.\nUpon reaching this timeout metrics collection is aborted and no more metrics are collected in this cycle.\nAll collected metrics are returned.\n",
                      "maximum": 600,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "label": {
          "description": "defines which metadata.labels will include or exclude during render StatefulSet, Pod, PVC resources",
          "properties": {
            "appendScope": {
              "description": "Whether to append *Scope* labels to StatefulSet and Pod\n- \"LabelShardScopeIndex\"\n- \"LabelReplicaScopeIndex\"\n- \"LabelCHIScopeIndex\"\n- \"LabelCHIScopeCycleSize\"\n- \"LabelCHIScopeCycleIndex\"\n- \"LabelCHIScopeCycleOffset\"\n- \"LabelClusterScopeIndex\"\n- \"LabelClusterScopeCycleSize\"\n- \"LabelClusterScopeCycleIndex\"\n- \"LabelClusterScopeCycleOffset\"\n",
              "enum": [
                "",
                "0",
                "1",
                "False",
                "false",
                "True",
                "true",
                "No",
                "no",
                "Yes",
                "yes",
                "Off",
                "off",
                "On",
                "on",
                "Disable",
                "disable",
                "Enable",
                "enable",
                "Disabled",
                "disabled",
                "Enabled",
                "enabled"
              ],
              "type": "string"
            },
            "exclude": {
              "description": "When propagating labels from the chi's `metadata.labels` section to child objects' `metadata.labels`,\nexclude labels from the following list\n",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "include": {
              "description": "When propagating labels from the chi's `metadata.labels` section to child objects' `metadata.labels`,\ninclude labels from the following list\n",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "logger": {
          "description": "allow setup clickhouse-operator logger behavior",
          "properties": {
            "alsologtostderr": {
              "description": "boolean allows logs to stderr and files both",
              "type": "string"
            },
            "log_backtrace_at": {
              "description": "It can be set to a file and line number with a logging line.\nEx.: file.go:123\nEach time when this line is being executed, a stack trace will be written to the Info log.\n",
              "type": "string"
            },
            "logtostderr": {
              "description": "boolean, allows logs to stderr",
              "type": "string"
            },
            "stderrthreshold": {
              "type": "string"
            },
            "v": {
              "description": "verbosity level of clickhouse-operator log, default - 1 max - 9",
              "type": "string"
            },
            "vmodule": {
              "description": "Comma-separated list of filename=N, where filename (can be a pattern) must have no .go ext, and N is a V level.\nEx.: file*=2 sets the 'V' to 2 in all files with names like file*.\n",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "metrics": {
          "description": "defines metrics exporter options",
          "properties": {
            "labels": {
              "description": "defines metric labels options",
              "properties": {
                "exclude": {
                  "description": "When adding labels to a metric exclude labels with names from the following list\n",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "pod": {
          "description": "define pod specific parameters",
          "properties": {
            "terminationGracePeriod": {
              "description": "Optional duration in seconds the pod needs to terminate gracefully. \nLook details in `pod.spec.terminationGracePeriodSeconds`\n",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "reconcile": {
          "description": "allow tuning reconciling process",
          "properties": {
            "host": {
              "description": "Whether the operator during reconcile procedure should wait for a ClickHouse host:\n  - to be excluded from a ClickHouse cluster\n  - to complete all running queries\n  - to be included into a ClickHouse cluster\nrespectfully before moving forward\n",
              "properties": {
                "wait": {
                  "properties": {
                    "exclude": {
                      "description": "Whether the operator during reconcile procedure should wait for a ClickHouse host to be excluded from a ClickHouse cluster",
                      "enum": [
                        "",
                        "0",
                        "1",
                        "False",
                        "false",
                        "True",
                        "true",
                        "No",
                        "no",
                        "Yes",
                        "yes",
                        "Off",
                        "off",
                        "On",
                        "on",
                        "Disable",
                        "disable",
                        "Enable",
                        "enable",
                        "Disabled",
                        "disabled",
                        "Enabled",
                        "enabled"
                      ],
                      "type": "string"
                    },
                    "include": {
                      "description": "Whether the operator during reconcile procedure should wait for a ClickHouse host to be included into a ClickHouse cluster",
                      "enum": [
                        "",
                        "0",
                        "1",
                        "False",
                        "false",
                        "True",
                        "true",
                        "No",
                        "no",
                        "Yes",
                        "yes",
                        "Off",
                        "off",
                        "On",
                        "on",
                        "Disable",
                        "disable",
                        "Enable",
                        "enable",
                        "Disabled",
                        "disabled",
                        "Enabled",
                        "enabled"
                      ],
                      "type": "string"
                    },
                    "queries": {
                      "description": "Whether the operator during reconcile procedure should wait for a ClickHouse host to complete all running queries",
                      "enum": [
                        "",
                        "0",
                        "1",
                        "False",
                        "false",
                        "True",
                        "true",
                        "No",
                        "no",
                        "Yes",
                        "yes",
                        "Off",
                        "off",
                        "On",
                        "on",
                        "Disable",
                        "disable",
                        "Enable",
                        "enable",
                        "Disabled",
                        "disabled",
                        "Enabled",
                        "enabled"
                      ],
                      "type": "string"
                    },
                    "replicas": {
                      "description": "Whether the operator during reconcile procedure should wait for replicas to catch-up",
                      "properties": {
                        "all": {
                          "description": "Whether the operator during reconcile procedure should wait for all replicas to catch-up",
                          "enum": [
                            "",
                            "0",
                            "1",
                            "False",
                            "false",
                            "True",
                            "true",
                            "No",
                            "no",
                            "Yes",
                            "yes",
                            "Off",
                            "off",
                            "On",
                            "on",
                            "Disable",
                            "disable",
                            "Enable",
                            "enable",
                            "Disabled",
                            "disabled",
                            "Enabled",
                            "enabled"
                          ],
                          "type": "string"
                        },
                        "delay": {
                          "description": "replication max absolute delay to consider replica is not delayed",
                          "type": "integer"
                        },
                        "new": {
                          "description": "Whether the operator during reconcile procedure should wait for new replicas to catch-up",
                          "enum": [
                            "",
                            "0",
                            "1",
                            "False",
                            "false",
                            "True",
                            "true",
                            "No",
                            "no",
                            "Yes",
                            "yes",
                            "Off",
                            "off",
                            "On",
                            "on",
                            "Disable",
                            "disable",
                            "Enable",
                            "enable",
                            "Disabled",
                            "disabled",
                            "Enabled",
                            "enabled"
                          ],
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "runtime": {
              "description": "runtime parameters for clickhouse-operator process which are used during reconcile cycle",
              "properties": {
                "reconcileCHIsThreadsNumber": {
                  "description": "How many goroutines will be used to reconcile CHIs in parallel, 10 by default",
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                },
                "reconcileShardsMaxConcurrencyPercent": {
                  "description": "The maximum percentage of cluster shards that may be reconciled in parallel, 50 percent by default.",
                  "maximum": 100,
                  "minimum": 0,
                  "type": "integer"
                },
                "reconcileShardsThreadsNumber": {
                  "description": "How many goroutines will be used to reconcile shards of a cluster in parallel, 1 by default",
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "statefulSet": {
              "description": "Allow change default behavior for reconciling StatefulSet which generated by clickhouse-operator",
              "properties": {
                "create": {
                  "description": "Behavior during create StatefulSet",
                  "properties": {
                    "onFailure": {
                      "description": "What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds\nPossible options:\n1. abort - do nothing, just break the process and wait for admin.\n2. delete - delete newly created problematic StatefulSet.\n3. ignore (default) - ignore error, pretend nothing happened and move on to the next StatefulSet.\n",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "update": {
                  "description": "Behavior during update StatefulSet",
                  "properties": {
                    "onFailure": {
                      "description": "What to do in case updated StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds\nPossible options:\n1. abort - do nothing, just break the process and wait for admin.\n2. rollback (default) - delete Pod and rollback StatefulSet to previous Generation. Pod would be recreated by StatefulSet based on rollback-ed configuration.\n3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet.\n",
                      "type": "string"
                    },
                    "pollInterval": {
                      "description": "How many seconds to wait between checks for created/updated StatefulSet status",
                      "type": "integer"
                    },
                    "timeout": {
                      "description": "How many seconds to wait for created/updated StatefulSet to be Ready",
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "statefulSet": {
          "description": "define StatefulSet-specific parameters",
          "properties": {
            "revisionHistoryLimit": {
              "description": "revisionHistoryLimit is the maximum number of revisions that will be\nmaintained in the StatefulSet's revision history.                         \nLook details in `statefulset.spec.revisionHistoryLimit`\n",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "status": {
          "description": "defines status options",
          "properties": {
            "fields": {
              "description": "defines status fields options",
              "properties": {
                "action": {
                  "description": "Whether the operator should fill status field 'action'",
                  "enum": [
                    "",
                    "0",
                    "1",
                    "False",
                    "false",
                    "True",
                    "true",
                    "No",
                    "no",
                    "Yes",
                    "yes",
                    "Off",
                    "off",
                    "On",
                    "on",
                    "Disable",
                    "disable",
                    "Enable",
                    "enable",
                    "Disabled",
                    "disabled",
                    "Enabled",
                    "enabled"
                  ],
                  "type": "string"
                },
                "actions": {
                  "description": "Whether the operator should fill status field 'actions'",
                  "enum": [
                    "",
                    "0",
                    "1",
                    "False",
                    "false",
                    "True",
                    "true",
                    "No",
                    "no",
                    "Yes",
                    "yes",
                    "Off",
                    "off",
                    "On",
                    "on",
                    "Disable",
                    "disable",
                    "Enable",
                    "enable",
                    "Disabled",
                    "disabled",
                    "Enabled",
                    "enabled"
                  ],
                  "type": "string"
                },
                "error": {
                  "description": "Whether the operator should fill status field 'error'",
                  "enum": [
                    "",
                    "0",
                    "1",
                    "False",
                    "false",
                    "True",
                    "true",
                    "No",
                    "no",
                    "Yes",
                    "yes",
                    "Off",
                    "off",
                    "On",
                    "on",
                    "Disable",
                    "disable",
                    "Enable",
                    "enable",
                    "Disabled",
                    "disabled",
                    "Enabled",
                    "enabled"
                  ],
                  "type": "string"
                },
                "errors": {
                  "description": "Whether the operator should fill status field 'errors'",
                  "enum": [
                    "",
                    "0",
                    "1",
                    "False",
                    "false",
                    "True",
                    "true",
                    "No",
                    "no",
                    "Yes",
                    "yes",
                    "Off",
                    "off",
                    "On",
                    "on",
                    "Disable",
                    "disable",
                    "Enable",
                    "enable",
                    "Disabled",
                    "disabled",
                    "Enabled",
                    "enabled"
                  ],
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "template": {
          "description": "Parameters which are used if you want to generate ClickHouseInstallationTemplate custom resources from files which are stored inside clickhouse-operator deployment",
          "properties": {
            "chi": {
              "properties": {
                "path": {
                  "description": "Path to folder where ClickHouseInstallationTemplate .yaml manifests are located.",
                  "type": "string"
                },
                "policy": {
                  "description": "CHI template updates handling policy\nPossible policy values:\n  - ReadOnStart. Accept CHIT updates on the operators start only.\n  - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply news CHITs on next regular reconcile of the CHI\n",
                  "enum": [
                    "",
                    "ReadOnStart",
                    "ApplyOnNextReconcile"
                  ],
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "watch": {
          "description": "Parameters for watch kubernetes resources which used by clickhouse-operator deployment",
          "properties": {
            "namespaces": {
              "description": "List of namespaces where clickhouse-operator watches for events.",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "x-kubernetes-preserve-unknown-fields": true,
      "additionalProperties": false
    },
    "status": {
      "type": "object",
      "x-kubernetes-preserve-unknown-fields": true
    }
  },
  "type": "object",
  "x-kubernetes-preserve-unknown-fields": true
}
