Skip to content

Commit

Permalink
Add Keycloak provisioning
Browse files Browse the repository at this point in the history
With this commit it's now possible to provision a fairly default
Keycloak instance backed by our PostgreSQL implementation.
  • Loading branch information
Kidswiss committed Jan 24, 2024
1 parent 7ba9e4f commit 4669e00
Show file tree
Hide file tree
Showing 18 changed files with 9,860 additions and 126 deletions.
21 changes: 19 additions & 2 deletions apis/vshn/v1/dbaas_vshn_keycloak.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.default={})"
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.properties.size.default={})"
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.properties.service.default={})"
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.properties.service.properties.postgreSQLParameters.default={})"
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.properties.tls.default={})"
//go:generate yq -i e ../../generated/vshn.appcat.vshn.io_vshnkeycloaks.yaml --expression "with(.spec.versions[]; .schema.openAPIV3Schema.properties.spec.properties.parameters.properties.backup.default={})"

Expand Down Expand Up @@ -74,8 +75,17 @@ type VSHNKeycloakParameters struct {

// VSHNKeycloakServiceSpec contains keycloak DBaaS specific properties
type VSHNKeycloakServiceSpec struct {
// +kubebuilder:validation:Enum=22
// +kubebuilder:default=22
// FQDN contains the FQDN which will be used for the ingress.
// If it's not set, no ingress will be deployed.
// This also enables strict hostname checking for this FQDN.
FQDN string `json:"fqdn,omitempty"`

// RelativePath on which Keycloak will listen.
// +kubebuilder:default="/"
RelativePath string `json:"relativePath,omitempty"`

// +kubebuilder:validation:Enum="23"
// +kubebuilder:default="23"

// Version contains supported version of keycloak.
// Multiple versions are supported. The latest version 22 is the default version.
Expand All @@ -86,8 +96,15 @@ type VSHNKeycloakServiceSpec struct {

// ServiceLevel defines the service level of this service. Either Best Effort or Guaranteed Availability is allowed.
ServiceLevel VSHNDBaaSServiceLevel `json:"serviceLevel,omitempty"`

// PostgreSQLParameters can be used to set any supported setting in the
// underlying PostgreSQL instance.
PostgreSQLParameters *VSHNPostgreSQLParameters `json:"postgreSQLParameters,omitempty"`
}

// VSHNKeycloakSettings contains Keycloak specific settings.
type VSHNKeycloakSettings struct{}

// VSHNKeycloakSizeSpec contains settings to control the sizing of a service.
type VSHNKeycloakSizeSpec struct {

Expand Down
4 changes: 4 additions & 0 deletions apis/vshn/v1/dbaas_vshn_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,7 @@ type XVSHNPostgreSQLList struct {
func (pg *VSHNPostgreSQL) GetInstanceNamespace() string {
return fmt.Sprintf("vshn-postgresql-%s", pg.GetName())
}

func (pg *XVSHNPostgreSQL) GetInstanceNamespace() string {
return fmt.Sprintf("vshn-postgresql-%s", pg.GetName())
}
4 changes: 4 additions & 0 deletions apis/vshn/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ func init() {
&XVSHNRedisList{},
&XVSHNMinio{},
&XVSHNMinioList{},
&XVSHNKeycloak{},
&XVSHNKeycloakList{},
&VSHNKeycloakList{},
&VSHNKeycloak{},
)
}
22 changes: 21 additions & 1 deletion apis/vshn/v1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 4669e00

Please sign in to comment.