-
Notifications
You must be signed in to change notification settings - Fork 33
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
Expose 6653 port on each node through NodePort to allow OF Master/Standby connection #201
Merged
Andrea-Campanella
merged 7 commits into
onosproject:master
from
Andrea-Campanella:n-of-endpoints
Sep 7, 2020
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
44c40ee
[VOL-3415] exposing openflow on all ONOS replicas through nodeports
Andrea-Campanella 88654ba
Fixing the selector
Andrea-Campanella 1c363be
Using only nodeports with pod name as selector
Andrea-Campanella 2f35160
fixing selector and adding values to expose nodeports
Andrea-Campanella a7e5c71
Bumping the chart version
Andrea-Campanella a7ce973
Defaulting exposeNodePorts to false
Andrea-Campanella 1ad15dd
Changing flag name
Andrea-Campanella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.idea/ | ||
build/release | ||
build/_output | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,51 @@ | ||
--- | ||
{{- if .Values.onosOfPort }} | ||
{{- if .Values.onosApiPort }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: onos-of | ||
name: onos-api | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: onos-of | ||
port: 6653 | ||
nodePort: {{ .Values.onosOfPort }} | ||
- name: onos-api | ||
port: 8181 | ||
nodePort: {{ .Values.onosApiPort }} | ||
selector: | ||
app: {{ template "fullname" . }} | ||
{{- end}} | ||
{{- end}} | ||
--- | ||
{{- if .Values.onosApiPort }} | ||
{{- if .Values.onosSshPort }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: onos-api | ||
name: onos-ssh | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: onos-api | ||
port: 8181 | ||
nodePort: {{ .Values.onosApiPort }} | ||
- name: onos-ssh | ||
port: 8101 | ||
nodePort: {{ .Values.onosSshPort }} | ||
selector: | ||
app: {{ template "fullname" . }} | ||
{{- end}} | ||
{{- end}} | ||
|
||
# workaround for . not working, see | ||
# https://github.com/helm/helm/issues/1311 | ||
{{- if .Values.exposeNodePorts }} | ||
{{- $root := . -}} | ||
{{ range $k, $index := until (atoi (quote .Values.replicas) | default 3) }} | ||
--- | ||
{{- if .Values.onosSshPort }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: onos-ssh | ||
name: onos-of-{{ $index }} | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: onos-ssh | ||
port: 8101 | ||
nodePort: {{ .Values.onosSshPort }} | ||
- name: onos-of-{{ $index }} | ||
port: 6653 | ||
nodePort: {{ add $index 31653 }} | ||
selector: | ||
app: {{ template "fullname" . }} | ||
statefulset.kubernetes.io/pod-name: onos-onos-classic-{{ $index }} | ||
{{ end }} | ||
{{- end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really even that
.
doesn't work. It actually does work as intended. This is just a limitation of variable scopes in Go templates. It does make for some pretty messy workarounds. We probably won't get anything out of tracking the issue...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but since it took me a little to understand what was going on I still think it's worth tracking, also to show people why I have done something like that and to help if in the future something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep it took me a while to understand how it worked too. It can be pretty frustrating.