2024-09-03 14:24:03 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
type ServiceResource struct {
|
|
|
|
Action string `yaml:"action,omitempty"`
|
2024-10-11 13:44:16 +02:00
|
|
|
SuccessCondition string `yaml:"successCondition,omitempty"`
|
2024-09-03 14:24:03 +02:00
|
|
|
FailureCondition string `yaml:"failureCondition,omitempty"`
|
|
|
|
SetOwnerReference bool `yaml:"setOwnerReference,omitempty"`
|
|
|
|
Manifest string `yaml:"manifest,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
2024-10-11 13:44:16 +02:00
|
|
|
APIVersion string `yaml:"apiVersion"`
|
|
|
|
Kind string `yaml:"kind"`
|
|
|
|
Metadata Metadata `yaml:"metadata"`
|
|
|
|
Spec ServiceSpec `yaml:"spec"`
|
2024-09-03 14:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Metadata struct {
|
2024-10-11 13:44:16 +02:00
|
|
|
Name string `yaml:"name"`
|
2024-09-03 14:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ServiceSpec is the specification of the Kubernetes Service
|
|
|
|
type ServiceSpec struct {
|
2024-10-11 13:44:16 +02:00
|
|
|
Selector map[string]string `yaml:"selector,omitempty"`
|
|
|
|
Ports []ServicePort `yaml:"ports"`
|
|
|
|
ClusterIP string `yaml:"clusterIP,omitempty"`
|
|
|
|
Type string `yaml:"type,omitempty"`
|
2024-09-03 14:24:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ServicePort defines a port for a Kubernetes Service
|
|
|
|
type ServicePort struct {
|
2024-10-11 13:44:16 +02:00
|
|
|
Name string `yaml:"name"` // Even if empty need to be in the yaml
|
|
|
|
Protocol string `yaml:"protocol,omitempty"`
|
|
|
|
Port int `yaml:"port"`
|
|
|
|
TargetPort int `yaml:"targetPort,omitempty"`
|
|
|
|
}
|