Skip to content

Commit

Permalink
Merge pull request #140 from yadneshk/add_ceilometer_ipmi
Browse files Browse the repository at this point in the history
Add CeilometerIpmi service
  • Loading branch information
openshift-merge-robot authored Jul 7, 2023
2 parents ef06291 + 4acd092 commit 67c4be4
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/bases/telemetry.openstack.org_ceilometercomputes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ spec:
initImage:
description: InitImage is the image used for the init container
type: string
ipmiImage:
description: IpmiImage is the image used for the ceilometer-agent-ipmi
container
type: string
passwordSelector:
default:
service: CeilometerPassword
Expand Down Expand Up @@ -111,6 +115,7 @@ spec:
- dataplaneInventoryConfigMap
- dataplaneSSHSecret
- initImage
- ipmiImage
- serviceAccount
type: object
status:
Expand Down
5 changes: 5 additions & 0 deletions api/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ spec:
initImage:
description: InitImage is the image used for the init container
type: string
ipmiImage:
description: IpmiImage is the image used for the ceilometer-agent-ipmi
container
type: string
passwordSelector:
default:
service: CeilometerPassword
Expand Down Expand Up @@ -193,6 +197,7 @@ spec:
- dataplaneInventoryConfigMap
- dataplaneSSHSecret
- initImage
- ipmiImage
- serviceAccount
type: object
description:
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/ceilometercompute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const (
CeilometerComputeContainerImage = "quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified"
// CeilometerComputeInitContainerImage - default fall-back image for Ceilometer Compute Init
CeilometerComputeInitContainerImage = "quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified"
// CeilometerIpmiContainerImage - default fall-back image for Ceilometer Ipmi
CeilometerIpmiContainerImage = "quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified"
)

// CeilometerComputeSpec defines the desired state of CeilometerCompute
Expand Down Expand Up @@ -76,6 +78,10 @@ type CeilometerComputeSpec struct {
// +kubebuilder:validation:Required
ComputeImage string `json:"computeImage"`

// IpmiImage is the image used for the ceilometer-agent-ipmi container
// +kubebuilder:validation:Required
IpmiImage string `json:"ipmiImage"`

// DataplaneSSHSecret
// +kubebuilder:validation:Required
DataplaneSSHSecret string `json:"dataplaneSSHSecret"`
Expand Down Expand Up @@ -155,6 +161,7 @@ func SetupDefaultsCeilometerCompute() {
ceilometercomputeDefaults := CeilometerComputeDefaults{
ComputeContainerImageURL: util.GetEnvVar("CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT", CeilometerComputeContainerImage),
ComputeInitContainerImageURL: util.GetEnvVar("CEILOMETER_COMPUTE_INIT_IMAGE_URL_DEFAULT", CeilometerComputeInitContainerImage),
IpmiContainerImageURL: util.GetEnvVar("CEILOMETER_IPMI_IMAGE_URL_DEFAULT", CeilometerIpmiContainerImage),
}

SetupCeilometerComputeDefaults(ceilometercomputeDefaults)
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/ceilometercompute_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
type CeilometerComputeDefaults struct {
ComputeContainerImageURL string
ComputeInitContainerImageURL string
IpmiContainerImageURL string
}

var ceilometercomputeDefaults CeilometerComputeDefaults
Expand Down Expand Up @@ -68,6 +69,9 @@ func (spec *CeilometerComputeSpec) Default() {
if spec.InitImage == "" {
spec.InitImage = ceilometercomputeDefaults.ComputeInitContainerImageURL
}
if spec.IpmiImage == "" {
spec.IpmiImage = ceilometercomputeDefaults.IpmiContainerImageURL
}
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func SetupDefaultsTelemetry() {
CentralInitContainerImageURL: util.GetEnvVar("CEILOMETER_CENTRAL_INIT_IMAGE_URL_DEFAULT", CeilometerCentralInitContainerImage),
ComputeContainerImageURL: util.GetEnvVar("CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT", CeilometerComputeContainerImage),
ComputeInitContainerImageURL: util.GetEnvVar("CEILOMETER_COMPUTE_INIT_IMAGE_URL_DEFAULT", CeilometerComputeInitContainerImage),
IpmiContainerImageURL: util.GetEnvVar("CEILOMETER_IPMI_IMAGE_URL_DEFAULT", CeilometerIpmiContainerImage),
NotificationContainerImageURL: util.GetEnvVar("CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT", CeilometerNotificationContainerImage),
NodeExporterContainerImageURL: util.GetEnvVar("TELEMETRY_NODE_EXPORTER_IMAGE_URL_DEFAULT", NodeExporterContainerImage),
SgCoreContainerImageURL: util.GetEnvVar("CEILOMETER_SGCORE_IMAGE_URL_DEFAULT", CeilometerSgCoreContainerImage),
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/telemetry_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type TelemetryDefaults struct {
NotificationContainerImageURL string
SgCoreContainerImageURL string
NodeExporterContainerImageURL string
IpmiContainerImageURL string
}

var telemetryDefaults TelemetryDefaults
Expand Down Expand Up @@ -77,6 +78,9 @@ func (spec *TelemetrySpec) Default() {
if spec.CeilometerCompute.ComputeImage == "" {
spec.CeilometerCompute.ComputeImage = telemetryDefaults.ComputeContainerImageURL
}
if spec.CeilometerCompute.IpmiImage == "" {
spec.CeilometerCompute.IpmiImage = telemetryDefaults.IpmiContainerImageURL
}
if spec.CeilometerCompute.InitImage == "" {
spec.CeilometerCompute.InitImage = telemetryDefaults.ComputeInitContainerImageURL
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ spec:
initImage:
description: InitImage is the image used for the init container
type: string
ipmiImage:
description: IpmiImage is the image used for the ceilometer-agent-ipmi
container
type: string
passwordSelector:
default:
service: CeilometerPassword
Expand Down Expand Up @@ -111,6 +115,7 @@ spec:
- dataplaneInventoryConfigMap
- dataplaneSSHSecret
- initImage
- ipmiImage
- serviceAccount
type: object
status:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ spec:
initImage:
description: InitImage is the image used for the init container
type: string
ipmiImage:
description: IpmiImage is the image used for the ceilometer-agent-ipmi
container
type: string
passwordSelector:
default:
service: CeilometerPassword
Expand Down Expand Up @@ -193,6 +197,7 @@ spec:
- dataplaneInventoryConfigMap
- dataplaneSSHSecret
- initImage
- ipmiImage
- serviceAccount
type: object
description:
Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
value: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
- name: CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified
- name: CEILOMETER_IPMI_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified
- name: CEILOMETER_SGCORE_IMAGE_URL_DEFAULT
value: quay.io/infrawatch/sg-core:latest
- name: TELEMETRY_NODE_EXPORTER_IMAGE_URL_DEFAULT
Expand Down
1 change: 1 addition & 0 deletions config/samples/telemetry_v1beta1_ceilometercompute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ spec:
dataplaneInventoryConfigMap: dataplanerole-edpm-compute
initImage: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
computeImage: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
ipmiImage: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified
1 change: 1 addition & 0 deletions config/samples/telemetry_v1beta1_telemetry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
ceilometerCompute:
initImage: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
computeImage: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
ipmiImage: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified
dataplaneSSHSecret: dataplane-ansible-ssh-private-key-secret
dataplaneInventoryConfigMap: dataplanerole-edpm-compute
serviceAccount: telemetry-operator-telemetry
Expand Down
1 change: 1 addition & 0 deletions controllers/ceilometercompute_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ func (r *CeilometerComputeReconciler) generateServiceConfigMaps(
templateParameters := map[string]interface{}{
"KeystoneInternalURL": keystoneInternalURL,
"ceilometer_compute_image": instance.Spec.ComputeImage,
"ceilometer_ipmi_image": instance.Spec.IpmiImage,
}

cms := []util.Template{
Expand Down
24 changes: 24 additions & 0 deletions templates/ceilometercompute/config/ceilometer-agent-ipmi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"command": "/usr/bin/ceilometer-polling --polling-namespaces ipmi --logfile /var/log/containers/ceilometer/ipmi.log",
"config_files": [
{
"source": "/var/lib/openstack/config/ceilometer.conf",
"dest": "/etc/ceilometer/ceilometer.conf",
"owner": "ceilometer",
"perm": "0600"
},
{
"source": "/var/lib/openstack/config/polling.yaml",
"dest": "/etc/ceilometer/polling.yaml",
"owner": "ceilometer",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/containers/ceilometer",
"owner": "ceilometer:ceilometer",
"recurse": true
}
]
}
25 changes: 25 additions & 0 deletions templates/ceilometercompute/config/ceilometer_agent_ipmi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "{{ .ceilometer_ipmi_image }}",
"user": "root",
"restart": "always",
"command": "kolla_start",
"net": "host",
"environment": {
"KOLLA_CONFIG_STRATEGY":"COPY_ALWAYS",
"KOLLA_CONFIG_FILE":"/var/lib/openstack/config/ceilometer-agent-ipmi.json",
"OS_ENDPOINT_TYPE":"internal"
},
"volumes": [
"/var/lib/openstack/config/ceilometer:/var/lib/openstack/config/:z",
"/var/log/containers/ceilometer:/var/log/containers/ceilometer:z",
"/run/libvirt:/run/libvirt:z",
"/etc/hosts:/etc/hosts:z",
"/etc/pki/tls/certs/ca-bundle.trust.crt:/etc/pki/tls/certs/ca-bundle.trust.crt:z",
"/etc/localtime:/etc/localtime:z",
"/etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:z",
"/etc/pki/ca-trust/source/anchors:/etc/pki/ca-trust/source/anchors:z",
"/dev/log:/dev/log:z",
"/etc/pki/tls/cert.pem:/etc/pki/tls/cert.pem:z",
"/etc/pki/tls/certs/ca-bundle.crt:/etc/pki/tls/certs/ca-bundle.crt:z"
]
}
1 change: 1 addition & 0 deletions templates/ceilometercompute/config/polling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ sources:
- switch.*
- storage.*
- volume.*
- hardware.*

0 comments on commit 67c4be4

Please sign in to comment.