Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Drop DataPlaneService ConfigMaps and Secrets
Browse files Browse the repository at this point in the history
- Drops the ConfigMaps and Secrets fields from OpenStackDataPlaneService.
- Updates all services under config/services to use the
  OpenStackDataPlaneService.Spec.DataSources field instead.
- Removes some un-needed labels from some services as they aren't needed
  and for brevity.
- Update docs for the switch to DataSources.

Depends-On: openstack-k8s-operators/install_yamls#846
Depends-On: openstack-k8s-operators/ci-framework#1847
Depends-On: openstack-k8s-operators/architecture#276
Signed-off-by: James Slagle <[email protected]>
  • Loading branch information
slagle committed Jun 6, 2024
1 parent b6af43d commit 6f354e2
Show file tree
Hide file tree
Showing 28 changed files with 62 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ spec:
type: string
certsFrom:
type: string
configMaps:
items:
type: string
type: array
containerImageFields:
items:
type: string
Expand Down Expand Up @@ -79,10 +75,6 @@ spec:
type: string
playbook:
type: string
secrets:
items:
type: string
type: array
tlsCerts:
additionalProperties:
properties:
Expand Down
8 changes: 0 additions & 8 deletions api/v1beta1/openstackdataplaneservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ type OpenstackDataPlaneServiceCert struct {

// OpenStackDataPlaneServiceSpec defines the desired state of OpenStackDataPlaneService
type OpenStackDataPlaneServiceSpec struct {
// ConfigMaps list of ConfigMap names to mount as ExtraMounts for the OpenStackAnsibleEE
// +kubebuilder:validation:Optional
ConfigMaps []string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"`

// Secrets list of Secret names to mount as ExtraMounts for the OpenStackAnsibleEE
// +kubebuilder:validation:Optional
Secrets []string `json:"secrets,omitempty"`

// DataSources list of DataSource objects to mount as ExtraMounts for the
// OpenStackAnsibleEE
DataSources []DataSource `json:"dataSources,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions api/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ spec:
type: string
certsFrom:
type: string
configMaps:
items:
type: string
type: array
containerImageFields:
items:
type: string
Expand Down Expand Up @@ -79,10 +75,6 @@ spec:
type: string
playbook:
type: string
secrets:
items:
type: string
type: array
tlsCerts:
additionalProperties:
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-bootstrap
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: bootstrap
spec:
playbook: osp.edpm.bootstrap
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-configure-network
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: configure-network
spec:
playbook: osp.edpm.configure_network
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-configure-ovs-dpdk
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: configure-ovs-dpdk
spec:
playbook: osp.edpm.configure_ovs_dpdk
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-derive-pci-devicespec
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: derive-pci-devicespec
spec:
playbook: osp.edpm.sriov_derive_device_spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-download-cache
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: download-cache
spec:
playbook: osp.edpm.download_cache
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-install-certs
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: install-certs
spec:
playbook: osp.edpm.install_certs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ metadata:
name: libvirt
spec:
playbook: osp.edpm.libvirt
secrets:
dataSources:
# NOTE: this Secret needs to be created before deploying the data plane.
# It should contain the libvirt sasl auth password using the key LibvirtPassword
- libvirt-secret
- secretRef:
name: libvirt-secret
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: OpenStackDataPlaneService
metadata:
name: logging
spec:
secrets:
- logging-compute-config-data
dataSources:
- secretRef:
name: logging-compute-config-data
playbook: osp.edpm.telemetry_logging
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: neutron-dhcp
spec:
playbook: osp.edpm.neutron_dhcp
secrets:
- neutron-dhcp-agent-neutron-config
dataSources:
- secretRef:
name: neutron-dhcp-agent-neutron-config
caCerts: combined-ca-bundle
containerImageFields:
- EdpmNeutronDhcpAgentImage
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ metadata:
name: neutron-metadata
spec:
playbook: osp.edpm.neutron_metadata
secrets:
- neutron-ovn-metadata-agent-neutron-config
- nova-metadata-neutron-config
dataSources:
- secretRef:
name: neutron-ovn-metadata-agent-neutron-config
- secretRef:
name: nova-metadata-neutron-config
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: neutron-ovn
spec:
playbook: osp.edpm.neutron_ovn
secrets:
- neutron-ovn-agent-neutron-config
dataSources:
- secretRef:
name: neutron-ovn-agent-neutron-config
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: neutron-sriov
spec:
playbook: osp.edpm.neutron_sriov
secrets:
- neutron-sriov-agent-neutron-config
dataSources:
- secretRef:
name: neutron-sriov-agent-neutron-config
caCerts: combined-ca-bundle
containerImageFields:
- EdpmNeutronSriovAgentImage
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ kind: OpenStackDataPlaneService
metadata:
name: nova
spec:
secrets:
- nova-cell1-compute-config
dataSources:
- secretRef:
name: nova-cell1-compute-config
# NOTE: this Secret needs to be created before deploying the data plane.
# It should contain an ssh key-pair in the secret fields: ssh-privatekey
# and ssh-publickey
- nova-migration-ssh-key
- secretRef:
name: nova-migration-ssh-key
playbook: osp.edpm.nova
caCerts: combined-ca-bundle
containerImageFields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: ovn
spec:
playbook: osp.edpm.ovn
configMaps:
- ovncontroller-config
dataSources:
- configMapRef:
name: ovncontroller-config
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: ovn-bgp-agent
spec:
playbook: osp.edpm.ovn_bgp_agent
secrets:
- neutron-ovn-agent-neutron-config
dataSources:
- secretRef:
name: neutron-ovn-agent-neutron-config
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ metadata:
name: swift
spec:
playbook: osp.edpm.swift
secrets:
- swift-conf
configMaps:
- swift-storage-config-data
- swift-ring-files
dataSources:
- secretRef:
name: swift-conf
- configMapRef:
name: swift-storage-config-data
- configMapRef:
name: swift-ring-files
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ kind: OpenStackDataPlaneService
metadata:
name: telemetry
spec:
secrets:
- ceilometer-compute-config-data
dataSources:
- secretRef:
name: ceilometer-compute-config-data
playbook: osp.edpm.telemetry
tlsCerts:
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-validate-network
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dataplane-operator
name: validate-network
spec:
playbook: osp.edpm.validate_network
10 changes: 0 additions & 10 deletions docs/assemblies/custom_resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,6 @@ OpenStackDataPlaneServiceSpec defines the desired state of OpenStackDataPlaneSer
|===
| Field | Description | Scheme | Required
| configMaps
| ConfigMaps list of ConfigMap names to mount as ExtraMounts for the OpenStackAnsibleEE
| []string
| false
| secrets
| Secrets list of Secret names to mount as ExtraMounts for the OpenStackAnsibleEE
| []string
| false
| dataSources
| DataSources list of DataSource objects to mount as ExtraMounts for the OpenStackAnsibleEE
| []<<datasource,DataSource>>
Expand Down
20 changes: 12 additions & 8 deletions docs/assemblies/proc_creating-a-custom-service.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:

. Optional: Designate and configure a node set for a Compute feature or workload. For more information, see xref:proc_configuring-a-node-set-for-a-Compute-feature-or-workload_dataplane[Configuring a node set for a Compute feature or workload].

. Optional: Specify `Secret` resources to use to pass secrets into the `OpenStackAnsibleEE` job. Secrets are specified with a `name` and `required` field. When `required` is false, the service deployment will not fail if the secret doesn't exist.
. Optional: Specify <<datasource>> resources to use to pass `ConfigMaps` or `Secrets` into the `OpenStackAnsibleEE` job. When the `optional` field is true on a <<datasource>> `configMapRef` or `secretRef`, the resource is optional, and an error won't occur when it doesn't exist.
+
----
apiVersion: dataplane.openstack.org/v1beta1
Expand All @@ -79,14 +79,18 @@ spec:
...
play: |
...
secrets:
- name: hello-world-secret-0
required: true
- name: hello-world-secret-1
required: false
dataSources:
- configMapRef:
name: hello-world-cm-0
- secretRef:
name: hello-world-secret-0
- secretRef:
name: hello-world-secret-1
# This secret is optional, it does not need to exist.
optional: true
----
+
A mount is created for each `secret` in the `OpenStackAnsibleEE` pod with a filename that matches the `secret` value. The mounts are created under `/var/lib/openstack/configs/<service name>`.
A mount is created for each `ConfigMap` and `Secret` in the `OpenStackAnsibleEE` pod with a filename that matches the resource value. The mounts are created under `/var/lib/openstack/configs/<service name>`.

. Optional: It may be necessary to run some services on all nodesets at the same time. These services need to have their `deployOnAllNodeSets` field set to true.
+
Expand All @@ -108,7 +112,7 @@ spec:
deployOnAllNodeSets: true
----

. Optional: Specify the `edpmServiceType` field for the service. Different custom services may use the same ansible content to manage the same EDPM service (such as `ovn` or `nova`). The `ConfigMaps`, `Secrets`, TLS certificates, and CA certificates need to be mounted at the same locations so they can be found by the ansible content even when using a custom service. `edpmServiceType` is used to create this association. The value is the name of the default service that uses the same ansible content as the custom service.
. Optional: Specify the `edpmServiceType` field for the service. Different custom services may use the same ansible content to manage the same EDPM service (such as `ovn` or `nova`). The `DataSources`, TLS certificates, and CA certificates need to be mounted at the same locations so they can be found by the ansible content even when using a custom service. `edpmServiceType` is used to create this association. The value is the name of the default service that uses the same ansible content as the custom service.
+
For example, a custom service that uses the `edpm_ovn` ansible content from `edpm-ansible` would set `edpmServiceType` to `ovn`, which matches the default `ovn` service name provided by `dataplane-operator`.
+
Expand Down
Loading

0 comments on commit 6f354e2

Please sign in to comment.