Skip to content

Commit

Permalink
Merge pull request #436 from fao89/configdocs
Browse files Browse the repository at this point in the history
Update CustomServiceConfig docs
  • Loading branch information
openshift-merge-bot[bot] authored Oct 11, 2024
2 parents be8f8a7 + 88cd588 commit e72e178
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 58 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ spec:
```

In this example, we are setting `num_engine_workers` to 4. After this resource has been updated, the controller will
regenerate the ConfigMap to include the updated values in the `custom.conf` file.
regenerate the Secret to include the updated values in the `01-custom.conf` file.

```sh
❯ oc get cm heat-config-data -o jsonpath={.data} | jq '."custom.conf"' | sed 's/\\n/\n/g'
❯ oc get secret heat-config-data -o jsonpath={.data} | jq '."01-custom.conf"' | sed 's/\\n/\n/g'
"[DEFAULT]
num_engine_workers=4
"
```

We can see this change reflected in the `/etc/heat/heat.conf.d/custom.conf` file within each of the API and Engine pods:
We can see this change reflected in the `/etc/heat/heat.conf.d/01-custom.conf` file within each of the API and Engine pods:

```sh
❯ oc get po -l service=heat
NAME READY STATUS RESTARTS AGE
heat-api-5bd49b9c6d-6cprh 1/1 Running 0 2m51s
heat-engine-5565547478-v2n4j 1/1 Running 0 2m51s
❯ oc exec -it heat-engine-5565547478-v2n4j -c heat-engine -- cat /etc/heat/heat.conf.d/custom.conf
❯ oc exec -it heat-engine-5565547478-v2n4j -c heat-engine -- cat /etc/heat/heat.conf.d/01-custom.conf
[DEFAULT]
num_engine_workers=4
```
Expand Down
4 changes: 2 additions & 2 deletions api/bases/heat.openstack.org_heatapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
4 changes: 2 additions & 2 deletions api/bases/heat.openstack.org_heatcfnapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
4 changes: 2 additions & 2 deletions api/bases/heat.openstack.org_heatengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
29 changes: 14 additions & 15 deletions api/bases/heat.openstack.org_heats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/heat/heat.conf.d directory as 01-custom.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down Expand Up @@ -89,15 +88,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down Expand Up @@ -398,15 +397,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down Expand Up @@ -707,15 +706,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ type HeatServiceTemplate struct {
// +kubebuilder:validation:Optional
// CustomServiceConfig - customize the service config using this parameter to change service defaults,
// or overwrite rendered information using raw OpenStack config format. The content gets added to
// to /etc/<service>/<service>.conf.d directory as custom.conf file.
// to /etc/heat/heat.conf.d directory as 02-custom-service.conf file.
CustomServiceConfig string `json:"customServiceConfig,omitempty"`

// +kubebuilder:validation:Optional
// CustomServiceConfigSecrets - customize the service config using this parameter to specify Secrets
// that contain sensitive service config data. The content of each Secret gets added to the
// /etc/<service>/<service>.conf.d directory as a custom config file.
// /etc/heat/heat.conf.d directory as a custom config file.
CustomServiceConfigSecrets []string `json:"customServiceConfigSecrets,omitempty"`

// +kubebuilder:validation:Optional
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/heat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ type HeatSpecBase struct {
// +kubebuilder:validation:Optional
// CustomServiceConfig - customize the service config using this parameter to change service defaults,
// or overwrite rendered information using raw OpenStack config format. The content gets added to
// to /etc/<service>/<service>.conf.d directory as custom.conf file.
// to /etc/heat/heat.conf.d directory as 01-custom.conf file.
CustomServiceConfig string `json:"customServiceConfig,omitempty"`

// +kubebuilder:validation:Optional
// CustomServiceConfigSecrets - customize the service config using this parameter to specify Secrets
// that contain sensitive service config data. The content of each Secret gets added to the
// /etc/<service>/<service>.conf.d directory as a custom config file.
// /etc/heat/heat.conf.d directory as a custom config file.
CustomServiceConfigSecrets []string `json:"customServiceConfigSecrets,omitempty"`

// +kubebuilder:validation:Optional
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/heat.openstack.org_heatapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/heat.openstack.org_heatcfnapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/heat.openstack.org_heatengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
added to to /etc/heat/heat.conf.d directory as 02-custom-service.conf
file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down
29 changes: 14 additions & 15 deletions config/crd/bases/heat.openstack.org_heats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/heat/heat.conf.d directory as 01-custom.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
using this parameter to specify Secrets that contain sensitive service
config data. The content of each Secret gets added to the /etc/<service>/<service>.conf.d
config data. The content of each Secret gets added to the /etc/heat/heat.conf.d
directory as a custom config file.
items:
type: string
Expand Down Expand Up @@ -89,15 +88,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down Expand Up @@ -398,15 +397,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down Expand Up @@ -707,15 +706,15 @@ spec:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
content gets added to to /etc/heat/heat.conf.d directory as
02-custom-service.conf file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
added to the /etc/heat/heat.conf.d directory as a custom config
file.
items:
type: string
type: array
Expand Down
4 changes: 2 additions & 2 deletions controllers/heat_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,9 @@ func generateCustomData(instance *heatv1beta1.Heat, tlsCfg *tls.Service, db *mar
const myCnf string = "my.cnf"

// customData hold any customization for the service.
// custom.conf is going to /etc/heat/heat.conf.d
// 01-custom.conf is going to /etc/heat/heat.conf.d
// all other files get placed into /etc/heat to allow overwrite of e.g. policy.json
// TODO: make sure custom.conf can not be overwritten
// TODO: make sure 01-custom.conf can not be overwritten
customData := map[string]string{
heat.CustomConfigFileName: instance.Spec.CustomServiceConfig,
myCnf: db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
Expand Down
4 changes: 2 additions & 2 deletions controllers/heatapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,8 @@ func (r *HeatAPIReconciler) generateServiceSecrets(
}

// customData hold any customization for the service.
// custom.conf is going to /etc/heat/heat.conf.d
// TODO: make sure custom.conf can not be overwritten
// 02-custom-service.conf is going to /etc/heat/heat.conf.d
// TODO: make sure 02-custom-service.conf can not be overwritten
customData := map[string]string{
heat.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
Expand Down
Loading

0 comments on commit e72e178

Please sign in to comment.