Skip to content

Commit

Permalink
Add Horizon to OpenStackControlPlane
Browse files Browse the repository at this point in the history
This change adds the necessary pieces to deploy the Horizon operator.
  • Loading branch information
bshephar committed Apr 4, 2023
1 parent 43ccdbc commit f8dfff9
Show file tree
Hide file tree
Showing 16 changed files with 378 additions and 706 deletions.
89 changes: 89 additions & 0 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6138,6 +6138,95 @@ spec:
- storageRequest
type: object
type: object
horizon:
properties:
enabled:
default: false
type: boolean
template:
properties:
containerImage:
default: quay.io/tripleozedcentos9/openstack-horizon:current-tripleo
type: string
customServiceConfig:
default: '# add your customization here'
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
nodeSelector:
additionalProperties:
type: string
type: object
preserveJobs:
default: false
type: boolean
replicas:
default: 1
format: int32
maximum: 32
minimum: 0
type: integer
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
route:
properties:
routeLocation:
type: string
routeName:
default: horizon
type: string
routeTLSCA:
type: string
routeTLSEnabled:
type: string
routeTLSKey:
type: string
type: object
secret:
type: string
sharedMemcached:
type: string
required:
- secret
type: object
type: object
ironic:
properties:
enabled:
Expand Down
15 changes: 15 additions & 0 deletions apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const (
// OpenStackControlPlaneIronicReadyCondition Status=True condition which indicates if Ironic is configured and operational
OpenStackControlPlaneIronicReadyCondition condition.Type = "OpenStackControlPlaneIronicReady"

// OpenStackControlPlaneHorizonReadyCondition Status=True condition which indicates if Horizon is configured and operational
OpenStackControlPlaneHorizonReadyCondition condition.Type = "OpenStackControlPlaneHorizonReady"

// OpenStackControlPlaneClientReadyCondition Status=True condition which indicates if OpenStackClient is configured and operational
OpenStackControlPlaneClientReadyCondition condition.Type = "OpenStackControlPlaneClientReady"

Expand Down Expand Up @@ -246,4 +249,16 @@ const (

// OpenStackControlPlaneClientReadyErrorMessage
OpenStackControlPlaneClientReadyErrorMessage = "OpenStackControlPlane Client error occured %s"

// OpenStackControlPlaneHorizonReadyInitMessage
OpenStackControlPlaneHorizonReadyInitMessage = "OpenStackControlPlane Horizon not started"

// OpenStackControlPlaneHorizonReadyMessage
OpenStackControlPlaneHorizonReadyMessage = "OpenStackControlPlane Horizon completed"

// OpenStackControlPlaneHorizonReadyRunningMessage
OpenStackControlPlaneHorizonReadyRunningMessage = "OpenStackControlPlane Horizon in progress"

// OpenStackControlPlaneHorizonReadyErrorMessage
OpenStackControlPlaneHorizonReadyErrorMessage = "OpenStackControlPlane Horizon error occured %s"
)
19 changes: 18 additions & 1 deletion apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
glancev1 "github.com/openstack-k8s-operators/glance-operator/api/v1beta1"
horizonv1 "github.com/openstack-k8s-operators/horizon-operator/api/v1alpha1"
memcachedv1 "github.com/openstack-k8s-operators/infra-operator/apis/memcached/v1beta1"
ironicv1 "github.com/openstack-k8s-operators/ironic-operator/api/v1beta1"
keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
Expand Down Expand Up @@ -121,6 +122,10 @@ type OpenStackControlPlaneSpec struct {

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Horizon - Parameters related to the Horizon services
Horizon HorizonSection `json:"horizon,omitempty"`

// +kubebuilder:validation:Optional
// ExtraMounts containing conf files and credentials that should be provided
// to the underlying operators.
// This struct can be defined in the top level CR and propagated to the
Expand Down Expand Up @@ -378,6 +383,18 @@ type ManilaSection struct {
Template manilav1.ManilaSpec `json:"template,omitempty"`
}

// HorizonSection defines the desired state of Horizon services
type HorizonSection struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// Enabled - Whether Horizon services should be deployed and managed
Enabled bool `json:"enabled"`

// +kubebuilder:validation:Optional
// Template - Overrides to use when creating the Horizon services
Template horizonv1.HorizonSpec `json:"template,omitempty"`
}

// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane
type OpenStackControlPlaneStatus struct {
//+operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
Expand Down Expand Up @@ -461,7 +478,7 @@ func (instance OpenStackControlPlane) InitConditions() {
condition.UnknownCondition(OpenStackControlPlaneIronicReadyCondition, condition.InitReason, OpenStackControlPlaneIronicReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneClientReadyCondition, condition.InitReason, OpenStackControlPlaneClientReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneManilaReadyCondition, condition.InitReason, OpenStackControlPlaneManilaReadyInitMessage),

condition.UnknownCondition(OpenStackControlPlaneHorizonReadyCondition, condition.InitReason, OpenStackControlPlaneHorizonReadyInitMessage),
// Also add the overall status condition as Unknown
condition.UnknownCondition(condition.ReadyCondition, condition.InitReason, condition.ReadyInitMessage),
)
Expand Down
17 changes: 17 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

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

15 changes: 8 additions & 7 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.19
require (
github.com/openstack-k8s-operators/cinder-operator/api v0.0.0-20230324152956-2cf9d6fe36e6
github.com/openstack-k8s-operators/glance-operator/api v0.0.0-20230321204834-1c4e58f83ac8
github.com/openstack-k8s-operators/horizon-operator/api v0.0.0-20230312232024-591e818ffc42
github.com/openstack-k8s-operators/infra-operator/apis v0.0.0-20230324141445-d1ac945900ed
github.com/openstack-k8s-operators/ironic-operator/api v0.0.0-20230322170604-426978d6cdc9
github.com/openstack-k8s-operators/keystone-operator/api v0.0.0-20230320104825-e625fcd50844
Expand All @@ -22,14 +23,14 @@ require (

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -55,18 +56,18 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.29.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit f8dfff9

Please sign in to comment.