Skip to content

Commit

Permalink
chart: rdma tools
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhoublue committed Aug 2, 2024
1 parent 5768102 commit 84498b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
8 changes: 8 additions & 0 deletions rdma-tools/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ return the image
{{- end -}}
{{- end -}}


{{/*
return the image
*/}}
{{- define "project.name" -}}
{{- printf "%s" .Values.name -}}
{{- printf "-%s" .Release.Name -}}
{{- end -}}
12 changes: 6 additions & 6 deletions rdma-tools/chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
spec:
selector:
matchLabels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
updateStrategy:
type: OnDelete
template:
metadata:
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
{{- if .Values.extraAnnotations }}
annotations:
{{- include "tplvalues.render" ( dict "value" .Values.extraAnnotations "context" $ ) | nindent 8 }}
Expand All @@ -33,7 +33,7 @@ spec:
hostNetwork: false
dnsPolicy: ClusterFirst
{{- end }}
serviceAccountName: {{ .Values.name | trunc 63 | trimSuffix "-" }}
serviceAccountName: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
restartPolicy: Always
{{- with .Values.tolerations }}
tolerations:
Expand Down Expand Up @@ -85,7 +85,7 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: ENV_SERVICE_NAME
value: {{ .Values.name | trunc 63 | trimSuffix "-" }}
value: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
- name: ENV_POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
4 changes: 2 additions & 2 deletions rdma-tools/chart/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
rules:
- apiGroups:
- ""
Expand Down
8 changes: 4 additions & 4 deletions rdma-tools/chart/templates/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
subjects:
- kind: ServiceAccount
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace }}
6 changes: 3 additions & 3 deletions rdma-tools/chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
spec:
type: {{ .Values.service.type }}
selector:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
ports:
- name: ssh
port: 22
Expand Down
4 changes: 2 additions & 2 deletions rdma-tools/chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.name | trunc 63 | trimSuffix "-" }}
name: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.name | trunc 63 | trimSuffix "-" }}
app: {{ include "project.name" . | trunc 63 | trimSuffix "-" | quote }}

0 comments on commit 84498b0

Please sign in to comment.