Skip to content
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
38 changes: 31 additions & 7 deletions charts/charts/k8s-node-image9/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
{{- $dot := . }}
{{- $prefix := include "pnnlmiscscripts.k8s-node-image-full.ingress.prefix" . }}

{{- if .Values.ingress.enabled }}
{{- $ingressPrefix := include "pnnlmiscscripts.k8s-node-image-full.ingress.prefix" . }}
Contact information

{{- range .Values.ingress.hosts }}
{{- if . }}
Repo:
http://{{ . }}{{ $prefix }}
http://{{ . }}{{ $ingressPrefix }}
Kernel:
http://{{ . }}{{ $ingressPrefix }}/vmlinuz
Initrd:
http://{{ . }}{{ $ingressPrefix }}/initrd.img
{{- else }}
Repo:
http://xx.xx.xx.xx{{ $ingressPrefix }}
Kernel:
http://xx.xx.xx.xx{{ $ingressPrefix }}/vmlinuz
Initrd:
http://xx.xx.xx.xx{{ $ingressPrefix }}/initrd.img
{{- end }}
{{- end }}
{{- end }}

{{- if .Values.httpRoute.enabled }}
{{- $httpRoutePrefix := include "pnnlmiscscripts.k8s-node-image-full.httpRoute.prefix" . }}
Contact information

{{- range .Values.httpRoute.hostnames }}
Repo:
http://{{ . }}{{ $httpRoutePrefix }}
Kernel:
http://{{ . }}{{ $prefix }}/vmlinuz
http://{{ . }}{{ $httpRoutePrefix }}/vmlinuz
Initrd:
http://{{ . }}{{ $prefix }}/initrd.img
http://{{ . }}{{ $httpRoutePrefix }}/initrd.img
{{- else }}
Repo:
http://xx.xx.xx.xx{{ $prefix }}
http://xx.xx.xx.xx{{ $httpRoutePrefix }}
Kernel:
http://xx.xx.xx.xx{{ $prefix }}/vmlinuz
http://xx.xx.xx.xx{{ $httpRoutePrefix }}/vmlinuz
Initrd:
http://xx.xx.xx.xx{{ $prefix }}/initrd.img
http://xx.xx.xx.xx{{ $httpRoutePrefix }}/initrd.img
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/charts/k8s-node-image9/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ takes dot, prefix, suffix, and type. type can be either f or d.
{{- end }}
{{- end -}}

{{- define "pnnlmiscscripts.k8s-node-image-full.httpRoute.prefix" -}}
{{- if .Values.httpRoute.enableVersionPrefix -}}
{{- $tag := dict "dot" . "section" .Values.k8sNode.image | include (printf "%s.tag" .Values.k8sNode.prefix) -}}
{{- printf "%s/9-%s" .Values.httpRoute.prefix $tag -}}
{{- else }}
{{- .Values.httpRoute.prefix -}}
{{- end }}
{{- end }}

{{/*
Common labels
*/}}
Expand Down
90 changes: 90 additions & 0 deletions charts/charts/k8s-node-image9/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{{- if .Values.httpRoute.enabled -}}
{{- $prefix := include "pnnlmiscscripts.k8s-node-image-full.httpRoute.prefix" . }}
{{- $aFullName := include "pnnlmiscscripts.k8s-node-image-full.anaconda.fullname" . -}}
{{- $nFullName := include "pnnlmiscscripts.k8s-node-image-full.k8s-node.fullname" . -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "pnnlmiscscripts.k8s-node-image-full.fullname" . }}
labels:
{{- include "pnnlmiscscripts.k8s-node-image-full.labels" . | nindent 4 }}
{{- with .Values.httpRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs:
{{- with .Values.httpRoute.parentRefs }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.httpRoute.hostnames }}
hostnames:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- matches:
- path:
type: PathPrefix
value: {{ printf "%s/images" $prefix }}
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /images
backendRefs:
- name: {{ $aFullName }}
port: 80
- matches:
- path:
type: Exact
value: {{ printf "%s/.treeinfo" $prefix }}
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /.treeinfo
backendRefs:
- name: {{ $aFullName }}
port: 80
- matches:
- path:
type: Exact
value: {{ printf "%s/LICENSE" $prefix }}
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /LICENSE
backendRefs:
- name: {{ $aFullName }}
port: 80
- matches:
- path:
type: Exact
value: {{ printf "%s/RockyLinux_BuildTag" $prefix }}
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /RockyLinux_BuildTag
backendRefs:
- name: {{ $aFullName }}
port: 80
- matches:
- path:
type: PathPrefix
value: {{ $prefix }}
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: {{ $nFullName }}
port: 80
{{- end }}
10 changes: 5 additions & 5 deletions charts/charts/k8s-node-image9/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@ spec:
- http:
paths:
- path: {{ dict "dot" $dot "prefix" $prefix "suffix" "" "type" "d" | include "pnnlmiscscripts.k8s-node-image-full.ingress" }}
pathType: Prefix
pathType: ImplementationSpecific
backend:
service:
name: {{ $nFullName }}
port:
name: http
- path: {{ dict "dot" $dot "prefix" $prefix "suffix" "images" "type" "d" | include "pnnlmiscscripts.k8s-node-image-full.ingress" }}
pathType: Prefix
pathType: ImplementationSpecific
backend:
service:
name: {{ $aFullName }}
port:
name: http
- path: {{ dict "dot" $dot "prefix" $prefix "suffix" ".treeinfo" "type" "f" | include "pnnlmiscscripts.k8s-node-image-full.ingress" }}
pathType: Prefix
pathType: ImplementationSpecific
backend:
service:
name: {{ $aFullName }}
port:
name: http
- path: {{ dict "dot" $dot "prefix" $prefix "suffix" "LICENSE" "type" "f" | include "pnnlmiscscripts.k8s-node-image-full.ingress" }}
pathType: Prefix
pathType: ImplementationSpecific
backend:
service:
name: {{ $aFullName }}
port:
name: http
- path: {{ dict "dot" $dot "prefix" $prefix "suffix" "RockyLinux_BuildTag" "type" "f" | include "pnnlmiscscripts.k8s-node-image-full.ingress" }}
pathType: Prefix
pathType: ImplementationSpecific
backend:
service:
name: {{ $aFullName }}
Expand Down
13 changes: 13 additions & 0 deletions charts/charts/k8s-node-image9/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ ingress:
# hosts:
# - chart-example.local

httpRoute:
enabled: false
enableVersionPrefix: true
prefix: ""
annotations: {}

parentRefs: {}
#- name: gateway
# sectionName: http

hostnames: []
#- chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down