Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support edit generate service type #147

Merged
merged 2 commits into from
Aug 29, 2022
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
9 changes: 7 additions & 2 deletions apis/apps/v1alpha1/nebulacluster_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,13 @@ func generateService(c NebulaClusterComponentter) *corev1.Service {
if c.IsHeadlessService() {
service.Spec.ClusterIP = corev1.ClusterIPNone
service.Spec.PublishNotReadyAddresses = true
} else if serviceSpec != nil && serviceSpec.ClusterIP != nil {
service.Spec.ClusterIP = *serviceSpec.ClusterIP
} else if serviceSpec != nil {
if serviceSpec.ClusterIP != nil {
service.Spec.ClusterIP = *serviceSpec.ClusterIP
}
if serviceSpec.Type != "" {
service.Spec.Type = serviceSpec.Type
}
}

return service
Expand Down
2 changes: 1 addition & 1 deletion charts/nebula-cluster/templates/nebula-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
env: {{ toYaml .Values.nebula.graphd.env | nindent 6 }}
config: {{ toYaml .Values.nebula.graphd.config | nindent 6 }}
service:
type: NodePort
type: {{ .Values.nebula.graphd.serviceType }}
externalTrafficPolicy: Local
logVolumeClaim:
resources:
Expand Down
1 change: 1 addition & 0 deletions charts/nebula-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ nebula:
graphd:
image: vesoft/nebula-graphd
replicas: 2
serviceType: NodePort
env: []
config: {}
resources:
Expand Down