Skip to content

Commit

Permalink
Return gateway info in GenericResourceService api
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 31, 2024
1 parent 1892580 commit f53d8b2
Show file tree
Hide file tree
Showing 206 changed files with 192,371 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apis/core/v1alpha1/generic_resource_service_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
kmapi "kmodules.xyz/client-go/api/v1"
"kmodules.xyz/resource-metadata/apis/shared"

catalogapi "go.bytebuilders.dev/catalog/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down Expand Up @@ -57,6 +58,8 @@ type GenericResourceServiceFacilities struct {
Backup GenericResourceServiceFacilitator `json:"backup,omitempty"`
Monitoring GenericResourceServiceFacilitator `json:"monitoring,omitempty"`
Exec []ExecServiceFacilitator `json:"exec,omitempty"`
// +optional
Gateway *catalogapi.Gateway `json:"gateway,omitempty"`
}

type GenericResourceServiceFacilitator struct {
Expand Down
7 changes: 6 additions & 1 deletion apis/core/v1alpha1/openapi_generated.go

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

6 changes: 6 additions & 0 deletions apis/core/v1alpha1/zz_generated.deepcopy.go

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

119 changes: 119 additions & 0 deletions crds/core.k8s.appscode.com_genericresourceservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,125 @@ spec:
required:
- usage
type: object
gateway:
properties:
hostname:
type: string
ip:
type: string
name:
type: string
namespace:
type: string
services:
description: Services is an optional configuration for services
used to expose database
items:
properties:
alias:
description: Alias represents the identifier of the
service.
type: string
ports:
items:
description: GatewayPort contains information on Gateway
service's port.
properties:
backendServicePort:
description: Number of the port to access the
backend service.
format: int32
type: integer
name:
description: The name of this port within the
gateway service.
type: string
nodePort:
description: The port on each node on which this
gateway service is exposed when type is NodePort
or LoadBalancer.
format: int32
type: integer
port:
description: The port that will be exposed by
the gateway service.
format: int32
type: integer
required:
- port
type: object
type: array
required:
- alias
- ports
type: object
type: array
ui:
description: UI is an optional list of database web uis
items:
properties:
alias:
description: Alias represents the identifier of the
service. This should match the db ui chart name
type: string
helmRelease:
description: HelmRelease is the name of the helm release
used to deploy this ui The name format is typically
<alias>-<db-name>
properties:
name:
default: ""
description: 'Name of the referent. This field is
effectively required, but due to backwards compatibility
is allowed to be empty. Instances of this type
with an empty value here are almost certainly
wrong. TODO: Add other useful fields. apiVersion,
kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen
doesn''t need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.'
type: string
type: object
x-kubernetes-map-type: atomic
port:
description: GatewayPort contains information on Gateway
service's port.
properties:
backendServicePort:
description: Number of the port to access the backend
service.
format: int32
type: integer
name:
description: The name of this port within the gateway
service.
type: string
nodePort:
description: The port on each node on which this
gateway service is exposed when type is NodePort
or LoadBalancer.
format: int32
type: integer
port:
description: The port that will be exposed by the
gateway service.
format: int32
type: integer
required:
- port
type: object
url:
description: URL of the database ui
type: string
required:
- alias
- port
- url
type: object
type: array
required:
- name
- namespace
type: object
monitoring:
properties:
refs:
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/yudai/gojsondiff v1.0.0
go.bytebuilders.dev/catalog v0.0.7
go.bytebuilders.dev/license-verifier v0.14.1
golang.org/x/net v0.26.0
gomodules.xyz/encoding v0.0.8
Expand Down Expand Up @@ -87,6 +88,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.33.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down Expand Up @@ -121,6 +123,7 @@ require (
gotest.tools/v3 v3.1.0 // indirect
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
kmodules.xyz/offshoot-api v0.30.0 // indirect
kubevault.dev/apimachinery v0.18.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.bytebuilders.dev/catalog v0.0.7 h1:RY2H7L9CoG779oCZjlZkU+f7FNSRSD2m4mdvLvuK2qA=
go.bytebuilders.dev/catalog v0.0.7/go.mod h1:zKCfHWFNHEaZV6BWC8vo6CYBwPDQsl3IIXW1P9Q62QA=
go.bytebuilders.dev/license-verifier v0.14.1 h1:Pk0a4NKgRjMt6eBZATHwLmPUuTQL00kQB3AQoxhCsUE=
go.bytebuilders.dev/license-verifier v0.14.1/go.mod h1:GB9XTSQUcllJ4AVq29TdJI6yRjoI86HGz0XMqq9nLwY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
Expand Down Expand Up @@ -352,6 +354,8 @@ kmodules.xyz/resource-metrics v0.30.4 h1:8HBPtYmo9ETY91gsc55JE8Z986+3ZuRq57M0wZ9
kmodules.xyz/resource-metrics v0.30.4/go.mod h1:w9+rz7/s/kGP1GWzYSuRdCn+l7EwpesmESSEHkLBnIQ=
kmodules.xyz/schema-checker v0.4.1 h1:V5UEjR6UMAXf307lTgw+9rDRfHLTNA8g/q9DngqYI9M=
kmodules.xyz/schema-checker v0.4.1/go.mod h1:BRXLB3Osuc9raHRJxHOgZFGecZ2aZumLXCHAOa5NPdA=
kubevault.dev/apimachinery v0.18.3 h1:Bq180AGBYnRXXNWbJ6Zg82+8/3M1Y8WYPez32uTry8I=
kubevault.dev/apimachinery v0.18.3/go.mod h1:b9uUVFx3a3ThDziL2J2O4xQL+muY1/pGavAhDdJC99E=
sigs.k8s.io/cli-utils v0.34.0 h1:zCUitt54f0/MYj/ajVFnG6XSXMhpZ72O/3RewIchW8w=
sigs.k8s.io/cli-utils v0.34.0/go.mod h1:EXyMwPMu9OL+LRnj0JEMsGG/fRvbgFadcVlSnE8RhFs=
sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
Expand Down
7 changes: 7 additions & 0 deletions vendor/github.com/onsi/gomega/.gitignore

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

Loading

0 comments on commit f53d8b2

Please sign in to comment.