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

Added the ability to optionally assign NODE_IP #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 14 additions & 1 deletion charts/spegel/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If release name contains chart name it will be used as a full name.
{{- end }}

{{/*
Creates the namespace for the chart.
Creates the namespace for the chart.
Defaults to the Release namespace unless the namespaceOverride is defined.
*/}}
{{- define "spegel.namespace" -}}
Expand Down Expand Up @@ -80,3 +80,16 @@ Image reference
{{- .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
{{- end }}
{{- end }}

{{/*
Host networking
*/}}
{{- define "networking.nodeIp" -}}
{{- if .Values.service.registry.nodeIp -}}
value: {{ .Values.service.registry.nodeIp }}
{{- else -}}
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end -}}
{{- end -}}
8 changes: 2 additions & 6 deletions charts/spegel/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ spec:
- --resolve-tags={{ .Values.spegel.resolveTags }}
env:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- include "networking.nodeIp" . | nindent 10 }}
volumeMounts:
- name: containerd-config
mountPath: {{ .Values.spegel.containerdRegistryConfigPath }}
Expand Down Expand Up @@ -91,9 +89,7 @@ spec:
- --local-addr=$(NODE_IP):{{ .Values.service.registry.hostPort }}
env:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- include "networking.nodeIp" . | nindent 10 }}
ports:
- name: registry
containerPort: {{ .Values.service.registry.port }}
Expand Down
3 changes: 3 additions & 0 deletions charts/spegel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ securityContext: {}

service:
registry:
# -- Node IP address override.
nodeIp: ""
# -- Port to expose the registry via the service.
port: 5000
# -- Node port to expose the registry via the service.
Expand Down Expand Up @@ -133,3 +135,4 @@ spegel:
resolveTags: true
# -- When true latest tags will be resolved to digests.
resolveLatestTag: true