Skip to content

Commit

Permalink
support hostNetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
knightXun committed Feb 16, 2020
1 parent eb6a69f commit c3e7329
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 5 additions & 4 deletions kubernetes/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ Create the name of the service account to use

{{- define "metad.endpoints" -}}
{{- $thriftPort := toString (.Values.port.metad.thriftPort) }}
{{- $replicas := int (toString (.Values.replication.metad.replicas)) }}
{{- $uname := printf "nebula-metad" }}
{{- range $i, $e := untilStep 0 $replicas 1 -}}
{{ $uname }}-{{ $i }}.nebula-metad:{{ $thriftPort }},
{{- range .Values.Hosts }}
{{- $uname := printf "" }}
{{- with . }}
{{ $uname }}-{{ .value }}:{{ $thriftPort }},
{{- end -}}
{{- end -}}
{{- end -}}
8 changes: 8 additions & 0 deletions kubernetes/helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ spec:
terminationGracePeriodSeconds: 60
# hostname: meta.nebula.services
restartPolicy: Always
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
containers:
- name: nebula-metad
image: "{{ .Values.image.metad.repository }}:{{ .Values.image.metad.tag }}"
Expand Down Expand Up @@ -96,6 +100,10 @@ spec:
spec:
terminationGracePeriodSeconds: 60
restartPolicy: Always
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
containers:
- name: nebula-storaged
image: "{{ .Values.image.storaged.repository }}:{{ .Values.image.storaged.tag }}"
Expand Down
8 changes: 7 additions & 1 deletion kubernetes/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ livenessProbe:
Enable: true
storaged:
Enable: true

hosts:
- hostIP: 192.168.8.21
- hostIP: 192.168.8.22
- hostIP: 192.168.8.23

## Optional resource requests and limits for the nebula container
resources:
Expand Down Expand Up @@ -95,7 +100,8 @@ storage:
metad:
size: 20Gi

nodeSelector: {}
nodeSelector:
nebula: "yes"

tolerations: []

Expand Down

0 comments on commit c3e7329

Please sign in to comment.