Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
[Feature/Operator] Manage configmap and secret for override (#87)
Browse files Browse the repository at this point in the history
* manage configmap and secret for override

* add reference and update samples
  • Loading branch information
erdrix authored Mar 24, 2021
1 parent dbb9fe7 commit e739910
Show file tree
Hide file tree
Showing 21 changed files with 1,342 additions and 217 deletions.
20 changes: 20 additions & 0 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@ type NifiAccessType string
// UserState defines the state of a NifiUser
type UserState string

// ConfigmapReference states a reference to a data into a configmap
type ConfigmapReference struct {
// Name of the configmap that we want to refer.
Name string `json:"name"`
// Namespace where is located the secret that we want to refer.
Namespace string `json:"namespace,omitempty"`
// The key of the value,in data content, that we want use.
Data string `json:"data"`
}

// SecretConfigReference states a reference to a data into a secret
type SecretConfigReference struct {
// Name of the configmap that we want to refer.
Name string `json:"name"`
// Namespace where is located the secret that we want to refer.
Namespace string `json:"namespace,omitempty"`
// The key of the value,in data content, that we want use.
Data string `json:"data"`
}

// ClusterReference states a reference to a cluster for dataflow/registryclient/user
// provisioning
type ClusterReference struct {
Expand Down
39 changes: 38 additions & 1 deletion api/v1alpha1/nificluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,23 @@ type ReadOnlyConfig struct {
ZookeeperProperties ZookeeperProperties `json:"zookeeperProperties,omitempty"`
// BootstrapProperties configuration that will be applied to the node.
BootstrapProperties BootstrapProperties `json:"bootstrapProperties,omitempty"`
// Logback configuration that will be applied to the node.
LogbackConfig LogbackConfig `json:"logbackConfig,omitempty"`
// BootstrapNotificationServices configuration that will be applied to the node.
BootstrapNotificationServicesReplaceConfig BootstrapNotificationServicesConfig `json:"bootstrapNotificationServicesConfig,omitempty"`
}

// NifiProperties configuration that will be applied to the node.
type NifiProperties struct {
// Additionnals nifi.properties configuration that will override the one produced based on template and
// configuration
OverrideConfigMap *ConfigmapReference `json:"overrideConfigMap,omitempty"`
// Additionnals nifi.properties configuration that will override the one produced based
// on template and configurations.
// on template, configurations and overrideConfigMap.
OverrideConfigs string `json:"overrideConfigs,omitempty"`
// Additionnals nifi.properties configuration that will override the one produced based
// on template, configurations, overrideConfigMap and overrideConfigs.
OverrideSecretConfig *SecretConfigReference `json:"overrideSecretConfig,omitempty"`
// A comma separated list of allowed HTTP Host header values to consider when NiFi
// is running securely and will be receiving requests to a different host[:port] than it is bound to.
// https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#web-properties
Expand All @@ -168,18 +178,45 @@ type NifiProperties struct {

// ZookeeperProperties configuration that will be applied to the node.
type ZookeeperProperties struct {
// Additionnals zookeeper.properties configuration that will override the one produced based on template and
// configuration
OverrideConfigMap *ConfigmapReference `json:"overrideConfigMap,omitempty"`
// Additionnals zookeeper.properties configuration that will override the one produced based
// on template and configurations.
OverrideConfigs string `json:"overrideConfigs,omitempty"`
// Additionnals zookeeper.properties configuration that will override the one produced based
// on template, configurations, overrideConfigMap and overrideConfigs.
OverrideSecretConfig *SecretConfigReference `json:"overrideSecretConfig,omitempty"`
}

// BootstrapProperties configuration that will be applied to the node.
type BootstrapProperties struct {
// JVM memory settings
NifiJvmMemory string `json:"nifiJvmMemory,omitempty"`
// Additionnals bootstrap.properties configuration that will override the one produced based on template and
// configuration
OverrideConfigMap *ConfigmapReference `json:"overrideConfigMap,omitempty"`
// Additionnals bootstrap.properties configuration that will override the one produced based
// on template and configurations.
OverrideConfigs string `json:"overrideConfigs,omitempty"`
// Additionnals bootstrap.properties configuration that will override the one produced based
// on template, configurations, overrideConfigMap and overrideConfigs.
OverrideSecretConfig *SecretConfigReference `json:"overrideSecretConfig,omitempty"`
}

// Logback configuration that will be applied to the node.
type LogbackConfig struct {
// logback.xml configuration that will replace the one produced based on template
ReplaceConfigMap *ConfigmapReference `json:"replaceConfigMap,omitempty"`
// logback.xml configuration that will replace the one produced based on template and overrideConfigMap
ReplaceSecretConfig *SecretConfigReference `json:"replaceSecretConfig,omitempty"`
}

type BootstrapNotificationServicesConfig struct {
// bootstrap_notifications_services.xml configuration that will replace the one produced based on template
ReplaceConfigMap *ConfigmapReference `json:"replaceConfigMap,omitempty"`
// bootstrap_notifications_services.xml configuration that will replace the one produced based on template and overrideConfigMap
ReplaceSecretConfig *SecretConfigReference `json:"replaceSecretConfig,omitempty"`
}

// NodeConfig defines the node configuration
Expand Down
116 changes: 114 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e739910

Please sign in to comment.