Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3041,6 +3041,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -10231,6 +10234,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -15307,6 +15313,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down
9 changes: 9 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3680,6 +3680,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -10870,6 +10873,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -15946,6 +15952,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ spec:
# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
# serviceLabels:
# rack: rack-22
# nodePort: 32017
# hostAliases:
# - ip: "10.10.0.2"
# hostnames:
Expand Down
9 changes: 9 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3680,6 +3680,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -10870,6 +10873,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -15946,6 +15952,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down
9 changes: 9 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3680,6 +3680,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -10870,6 +10873,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -15946,6 +15952,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down
9 changes: 9 additions & 0 deletions e2e-tests/version-service/conf/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3680,6 +3680,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -10870,6 +10873,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -15946,6 +15952,9 @@ spec:
items:
type: string
type: array
nodePort:
format: int32
type: integer
serviceAnnotations:
additionalProperties:
type: string
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/psmdb/v1/psmdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ type Expose struct {
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
ServiceLabels map[string]string `json:"serviceLabels,omitempty"`
NodePort int32 `json:"nodePort,omitempty"`
}

func (e *Expose) SaveOldMeta() bool {
Expand Down
6 changes: 6 additions & 0 deletions pkg/psmdb/mongos.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ func MongosServiceSpec(cr *api.PerconaServerMongoDB, podName string) corev1.Serv
case corev1.ServiceTypeNodePort:
spec.Type = corev1.ServiceTypeNodePort
spec.ExternalTrafficPolicy = "Local"
if !cr.Spec.Sharding.Mongos.Expose.ServicePerPod {
for i, port := range spec.Ports {
port.NodePort = cr.Spec.Sharding.Mongos.Expose.NodePort
spec.Ports[i] = port
}
}
case corev1.ServiceTypeLoadBalancer:
spec.Type = corev1.ServiceTypeLoadBalancer
spec.ExternalTrafficPolicy = "Cluster"
Expand Down