Skip to content

Commit

Permalink
Merge pull request #27 from itayankri/expose-loadBalancerIP
Browse files Browse the repository at this point in the history
Expose service loadBalancerIP
  • Loading branch information
itayankri authored Jan 13, 2023
2 parents 23cf2db + 6c5ce1d commit 0f96fad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/v1alpha1/valhalla_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ func (spec *PersistenceSpec) GetAccessMode() corev1.PersistentVolumeAccessMode {
}

type ServiceSpec struct {
Type corev1.ServiceType `json:"type,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Type corev1.ServiceType `json:"type,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
LoadBalancerIP *string `json:"loadBalancerIP,omitempty"`
}

type PredictedTrafficSpec struct {
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/valhalla.itayankri_valhallas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ spec:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
type:
description: Service Type string describes ingress methods for
a service
Expand Down
3 changes: 3 additions & 0 deletions internal/resource/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (builder *ServiceBuilder) Update(object client.Object) error {

if builder.Instance.Spec.Service != nil {
service.Spec.Type = builder.Instance.Spec.Service.Type
if builder.Instance.Spec.Service.LoadBalancerIP != nil {
service.Spec.LoadBalancerIP = *builder.Instance.Spec.Service.LoadBalancerIP
}
builder.setAnnotations(service)
}

Expand Down

0 comments on commit 0f96fad

Please sign in to comment.