Skip to content

Commit

Permalink
support edit generate service type (#147)
Browse files Browse the repository at this point in the history
* support edit generate service type

* add charts value
  • Loading branch information
kqzh authored Aug 29, 2022
1 parent eb2e483 commit e8e42e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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

0 comments on commit e8e42e2

Please sign in to comment.