|
| 1 | +# Copyright (c) 2019-2025, NVIDIA CORPORATION. All rights reserved. |
| 2 | +# |
| 3 | +# Redistribution and use in source and binary forms, with or without |
| 4 | +# modification, are permitted provided that the following conditions |
| 5 | +# are met: |
| 6 | +# * Redistributions of source code must retain the above copyright |
| 7 | +# notice, this list of conditions and the following disclaimer. |
| 8 | +# * Redistributions in binary form must reproduce the above copyright |
| 9 | +# notice, this list of conditions and the following disclaimer in the |
| 10 | +# documentation and/or other materials provided with the distribution. |
| 11 | +# * Neither the name of NVIDIA CORPORATION nor the names of its |
| 12 | +# contributors may be used to endorse or promote products derived |
| 13 | +# from this software without specific prior written permission. |
| 14 | +# |
| 15 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY |
| 16 | +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 18 | +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 19 | +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 20 | +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 21 | +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 22 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 23 | +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | + |
| 27 | +# Configures RBAC if required for the platform to support running with |
| 28 | +# NFS volumes and pinned non-root UIDs as required |
| 29 | + |
| 30 | +{{- if .Values.tags.openshift }} |
| 31 | +apiVersion: security.openshift.io/v1 |
| 32 | +kind: SecurityContextConstraints |
| 33 | +metadata: |
| 34 | + name: {{ template "triton-inference-server.fullname" . }} |
| 35 | + annotations: |
| 36 | + kubernetes.io/description: triton has the same settings as restricted-v2, |
| 37 | + except it also allows non-root UIDs and NFS mounts. |
| 38 | + labels: |
| 39 | + app: {{ template "triton-inference-server.name" . }} |
| 40 | + chart: {{ template "triton-inference-server.chart" . }} |
| 41 | + release: {{ .Release.Name }} |
| 42 | + heritage: {{ .Release.Service }} |
| 43 | +allowHostDirVolumePlugin: false |
| 44 | +allowHostIPC: false |
| 45 | +allowHostNetwork: false |
| 46 | +allowHostPID: false |
| 47 | +allowHostPorts: false |
| 48 | +allowPrivilegeEscalation: false |
| 49 | +allowPrivilegedContainer: false |
| 50 | +allowedCapabilities: |
| 51 | +- NET_BIND_SERVICE |
| 52 | +defaultAddCapabilities: null |
| 53 | +fsGroup: |
| 54 | + type: RunAsAny |
| 55 | +groups: [] |
| 56 | +priority: null |
| 57 | +readOnlyRootFilesystem: false |
| 58 | +requiredDropCapabilities: |
| 59 | +- ALL |
| 60 | +runAsUser: |
| 61 | + type: MustRunAsNonRoot |
| 62 | +seLinuxContext: |
| 63 | + type: MustRunAs |
| 64 | +seccompProfiles: |
| 65 | +- runtime/default |
| 66 | +supplementalGroups: |
| 67 | + type: RunAsAny |
| 68 | +users: [] |
| 69 | +volumes: |
| 70 | +- configMap |
| 71 | +- csi |
| 72 | +- downwardAPI |
| 73 | +- emptyDir |
| 74 | +- ephemeral |
| 75 | +- nfs |
| 76 | +- persistentVolumeClaim |
| 77 | +- projected |
| 78 | +- secret |
| 79 | +--- |
| 80 | +kind: Role |
| 81 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 82 | +metadata: |
| 83 | + name: {{ include "triton-inference-server.fullname" . }}-scc |
| 84 | + namespace: {{ .Release.Namespace }} |
| 85 | + labels: |
| 86 | + app: {{ template "triton-inference-server.name" . }} |
| 87 | + chart: {{ template "triton-inference-server.chart" . }} |
| 88 | + release: {{ .Release.Name }} |
| 89 | + heritage: {{ .Release.Service }} |
| 90 | +rules: |
| 91 | +- apiGroups: ["security.openshift.io"] |
| 92 | + resources: ["securitycontextconstraints"] |
| 93 | + resourceNames: [{{ include "triton-inference-server.fullname" . | quote }}] |
| 94 | + verbs: ["use"] |
| 95 | +--- |
| 96 | +kind: RoleBinding |
| 97 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 98 | +metadata: |
| 99 | + name: {{ include "triton-inference-server.fullname" . }}-scc |
| 100 | + namespace: {{ .Release.Namespace }} |
| 101 | + labels: |
| 102 | + app: {{ template "triton-inference-server.name" . }} |
| 103 | + chart: {{ template "triton-inference-server.chart" . }} |
| 104 | + release: {{ .Release.Name }} |
| 105 | + heritage: {{ .Release.Service }} |
| 106 | +subjects: |
| 107 | +- kind: ServiceAccount |
| 108 | + name: {{ template "triton-inference-server.fullname" . }} |
| 109 | + namespace: {{ .Release.Namespace }} |
| 110 | +roleRef: |
| 111 | + kind: Role |
| 112 | + name: {{ include "triton-inference-server.fullname" . }}-scc |
| 113 | + apiGroup: rbac.authorization.k8s.io |
| 114 | +{{- end -}} |
0 commit comments