Skip to content

Commit

Permalink
Merge pull request #234 from olliewalsh/ovn_tls
Browse files Browse the repository at this point in the history
OVN TLS support
  • Loading branch information
openshift-merge-bot[bot] committed Mar 7, 2024
2 parents 3abd273 + fb78131 commit 826f326
Show file tree
Hide file tree
Showing 47 changed files with 1,839 additions and 108 deletions.
11 changes: 11 additions & 0 deletions api/bases/ovn.openstack.org_ovncontrollers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- ovnContainerImage
- ovsContainerImage
Expand Down
11 changes: 11 additions & 0 deletions api/bases/ovn.openstack.org_ovndbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ spec:
storageRequest:
description: StorageRequest
type: string
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- containerImage
- dbType
Expand Down
11 changes: 11 additions & 0 deletions api/bases/ovn.openstack.org_ovnnorthds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- containerImage
type: object
Expand Down
9 changes: 9 additions & 0 deletions api/v1beta1/ovncontroller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1beta1

import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -33,6 +34,9 @@ const (
OvnControllerOvsContainerImage = "quay.io/podified-antelope-centos9/openstack-ovn-base:current-podified"
// OvnControllerContainerImage is the fall-back container image for OVNController ovn-controller
OvnControllerContainerImage = "quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified"

// ServiceNameOvnController - ovn-controller service name
ServiceNameOvnController = "ovn-controller"
)

// OVNControllerSpec defines the desired state of OVNController
Expand Down Expand Up @@ -78,6 +82,11 @@ type OVNControllerSpecCore struct {
// If present, the IP of the attachment named "tenant", will be used as the OvnEncapIP.

NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// TLS - Parameters related to TLS
TLS tls.SimpleService `json:"tls,omitempty"`
}

// OVNControllerStatus defines the observed state of OVNController
Expand Down
12 changes: 10 additions & 2 deletions api/v1beta1/ovndbcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ import (
"fmt"

"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
// NBDBType - Northbound database type
NBDBType = "NB"
NBDBType = "NB"
ServiceNameNB = "ovsdbserver-nb"
// SBDBType - Southbound database type
SBDBType = "SB"
SBDBType = "SB"
ServiceNameSB = "ovsdbserver-sb"

// ServiceHeadlessType - Constant to identify Headless services
ServiceHeadlessType = "headless"
Expand Down Expand Up @@ -114,6 +117,11 @@ type OVNDBClusterSpecCore struct {
// NetworkAttachment is a NetworkAttachment resource name to expose the service to the given network.
// If specified the IP address of this network is used as the dbAddress connection.
NetworkAttachment string `json:"networkAttachment"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// TLS - Parameters related to TLS
TLS tls.SimpleService `json:"tls,omitempty"`
}

// OVNDBClusterStatus defines the observed state of OVNDBCluster
Expand Down
8 changes: 8 additions & 0 deletions api/v1beta1/ovnnorthd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1beta1

import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -28,6 +29,8 @@ const (

// OvnNorthdContainerImage is the fall-back container image for OVNNorthd
OvnNorthdContainerImage = "quay.io/podified-antelope-centos9/openstack-ovn-northd:current-podified"
// ServiceNameOvnNorthd -
ServiceNameOvnNorthd = "ovn-northd"
)

// OVNNorthdSpec defines the desired state of OVNNorthd
Expand Down Expand Up @@ -67,6 +70,11 @@ type OVNNorthdSpecCore struct {
// NetworkAttachment is a NetworkAttachment resource name to expose the service to the given network.
// If specified the IP address of this network is used as the dbAddress connection.
NetworkAttachment string `json:"networkAttachment"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// TLS - Parameters related to TLS
TLS tls.SimpleService `json:"tls,omitempty"`
}

// OVNNorthdStatus defines the observed state of OVNNorthd
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions config/crd/bases/ovn.openstack.org_ovncontrollers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- ovnContainerImage
- ovsContainerImage
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/ovn.openstack.org_ovndbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ spec:
storageRequest:
description: StorageRequest
type: string
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- containerImage
- dbType
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/ovn.openstack.org_ovnnorthds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
tls:
description: TLS - Parameters related to TLS
properties:
caBundleSecretName:
description: CaBundleSecretName - holding the CA certs in a pre-created
bundle file
type: string
secretName:
description: SecretName - holding the cert, key for the service
type: string
type: object
required:
- containerImage
type: object
Expand Down
12 changes: 12 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ rules:
verbs:
- get
- list
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down
30 changes: 30 additions & 0 deletions controllers/ovn_common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright 2024.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers

// fields to index to reconcile when changed
const (
tlsField = ".spec.tls.secretName"
caBundleSecretNameField = ".spec.tls.caBundleSecretName"
)

var (
allWatchFields = []string{
caBundleSecretNameField,
tlsField,
}
)
Loading

0 comments on commit 826f326

Please sign in to comment.