@@ -91,3 +91,60 @@ Create the name of the service account to use
9191{ {- default " default" .Values.serviceAccount.name } }
9292{ {- end } }
9393{ {- end } }
94+
95+ { {/*
96+ Create the name of the controller manager service account
97+ */} }
98+ { {- define " aibrix.controllerManager.serviceAccountName" -} }
99+ { {- if and .Values.controllerManager.serviceAccount.create (eq .Values.controllerManager.serviceAccount.name " " ) -} }
100+ { {- $sa := default (include " aibrix.fullname" .) .Values.controllerManager.serviceAccount.name } }
101+ { {- printf " %s-controller-manager" $sa } }
102+ { {- else if and .Values.controllerManager.serviceAccount.create (not (eq .Values.controllerManager.serviceAccount.name " " )) -} }
103+ { {- .Values.controllerManager.serviceAccount.name -} }
104+ { {- else -} }
105+ { {- include " aibrix.serviceAccountName" . -} }
106+ { {- end -} }
107+ { {- end -} }
108+
109+ { {/*
110+ Create the name of the gateway plugin service account
111+ */} }
112+ { {- define " aibrix.gatewayPlugin.serviceAccountName" -} }
113+ { {- if and .Values.gatewayPlugin.serviceAccount.create (eq .Values.gatewayPlugin.serviceAccount.name " " ) -} }
114+ { {- $sa := default (include " aibrix.fullname" .) .Values.gatewayPlugin.serviceAccount.name } }
115+ { {- printf " %s-gateway-plugin" $sa } }
116+ { {- else if and .Values.gatewayPlugin.serviceAccount.create (not (eq .Values.gatewayPlugin.serviceAccount.name " " )) -} }
117+ { {- .Values.gatewayPlugin.serviceAccount.name -} }
118+ { {- else -} }
119+ { {- include " aibrix.serviceAccountName" . -} }
120+ { {- end -} }
121+ { {- end -} }
122+
123+
124+ { {/*
125+ Create the name of the gateway plugin service account
126+ */} }
127+ { {- define " aibrix.gpuOptimizer.serviceAccountName" -} }
128+ { {- if and .Values.gpuOptimizer.serviceAccount.create (eq .Values.gpuOptimizer.serviceAccount.name " " ) -} }
129+ { {- $sa := default (include " aibrix.fullname" .) .Values.gpuOptimizer.serviceAccount.name } }
130+ { {- printf " %s-gpu-optimizer" $sa } }
131+ { {- else if and .Values.gpuOptimizer.serviceAccount.create (not (eq .Values.gpuOptimizer.serviceAccount.name " " )) -} }
132+ { {- .Values.gpuOptimizer.serviceAccount.name -} }
133+ { {- else -} }
134+ { {- include " aibrix.serviceAccountName" . -} }
135+ { {- end -} }
136+ { {- end -} }
137+
138+ { {/*
139+ Create the name of the metadata service service account
140+ */} }
141+ { {- define " aibrix.metadata.serviceAccountName" -} }
142+ { {- if and .Values.metadata.serviceAccount.create (eq .Values.metadata.serviceAccount.name " " ) -} }
143+ { {- $sa := default (include " aibrix.fullname" .) .Values.metadata.serviceAccount.name } }
144+ { {- printf " %s-metadata-service" $sa } }
145+ { {- else if and .Values.metadata.serviceAccount.create (not (eq .Values.metadata.serviceAccount.name " " )) -} }
146+ { {- .Values.metadata.serviceAccount.name -} }
147+ { {- else -} }
148+ { {- include " aibrix.serviceAccountName" . -} }
149+ { {- end -} }
150+ { {- end -} }
0 commit comments