Skip to content

Commit

Permalink
[Misc] Operator: CRD(s)/Type(s) updated
Browse files Browse the repository at this point in the history
Update types and CRDs for:
- supporting `Service` type workloads in CAV
- Domain and ClusterDomain resources and reference from CA
  • Loading branch information
Pavan-SAP committed Jan 8, 2025
1 parent 3afeb5d commit 207cffc
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 0 deletions.
25 changes: 25 additions & 0 deletions crds/sme.sap.com_capapplicationversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ spec:
items:
type: string
type: array
serviceExposures:
items:
properties:
routes:
items:
properties:
path:
type: string
port:
format: int32
type: integer
workloadName:
type: string
required:
- port
- workloadName
type: object
type: array
subDomain:
type: string
required:
- routes
- subDomain
type: object
type: array
tenantOperations:
properties:
deprovisioning:
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/sme.sap.com/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ type CAPApplicationVersionSpec struct {
TenantOperations *TenantOperations `json:"tenantOperations,omitempty"`
// Content Jobs may be used to specify the sequence of content jobs when several jobs exist
ContentJobs []string `json:"contentJobs,omitempty"`
// Configuration for the service(s) to be exposed (relevant only for 'Service' type deployment workloads)
ServiceExposures []ServiceExposure `json:"serviceExposures,omitempty"`
}

// WorkloadDetails specifies the details of the Workload
Expand Down Expand Up @@ -258,6 +260,24 @@ type DeploymentDetails struct {
Monitoring *WorkloadMonitoring `json:"monitoring,omitempty"`
}

// ServiceExposure specifies the details of the VirtualService to be exposed for `Service` type workload(s)
type ServiceExposure struct {
// Subdomain under which the service is exposed (used as the Key for identifying the VirtualService)
SubDomain string `json:"subDomain"`
// Routes specifies the routing configuration (http match) for the exposed service
Routes []Route `json:"routes"`
}

// Routing configuration (http match) for the exposed service
type Route struct {
// Name of the workload (eventually a service to route requests to); must be a valid workload name (Deployment)
WorkloadName string `json:"workloadName"`
// Port number used for the service (must be present in the workload/service)
Port int32 `json:"port"`
// A unique routing path used (as a match/prefix) to route requests to the workload (when omitted, "/" would be used)
Path string `json:"path,omitempty"`
}

// WorkloadMonitoring specifies the metrics related to the workload
type WorkloadMonitoring struct {
// DeletionRules specify the metrics conditions that need to be satisfied for the version to be deleted automatically.
Expand Down Expand Up @@ -334,6 +354,8 @@ const (
DeploymentRouter DeploymentType = "Router"
// Additional deployment type
DeploymentAdditional DeploymentType = "Additional"
// Service deployment type
DeploymentService DeploymentType = "Service"
)

// JobDetails specifies the details of the Job
Expand Down
44 changes: 44 additions & 0 deletions pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go

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

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

46 changes: 46 additions & 0 deletions pkg/client/applyconfiguration/sme.sap.com/v1alpha1/route.go

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

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

4 changes: 4 additions & 0 deletions pkg/client/applyconfiguration/utils.go

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

0 comments on commit 207cffc

Please sign in to comment.