Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | {{- $releaseName := .Release.Name }} |
| 18 | {{- $namespace := .Release.Namespace }} |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 19 | {{- $name := .Values.config.ue.name }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 20 | --- |
| 21 | apiVersion: v1 |
| 22 | kind: ServiceAccount |
| 23 | metadata: |
| 24 | name: {{ $releaseName }}-{{ $name }} |
| 25 | namespace: {{ $namespace }} |
| 26 | --- |
| 27 | kind: Role |
| 28 | apiVersion: rbac.authorization.k8s.io/v1 |
| 29 | metadata: |
| 30 | name: {{ $releaseName }}-{{ $name }} |
| 31 | namespace: {{ $namespace }} |
| 32 | rules: |
| 33 | - apiGroups: |
| 34 | - "" |
| 35 | - extensions |
| 36 | - batch |
| 37 | - apps |
| 38 | verbs: |
| 39 | - get |
| 40 | - list |
| 41 | resources: |
| 42 | - daemonsets |
| 43 | - jobs |
| 44 | - pods |
| 45 | - services |
| 46 | - endpoints |
| 47 | --- |
| 48 | kind: RoleBinding |
| 49 | apiVersion: rbac.authorization.k8s.io/v1 |
| 50 | metadata: |
| 51 | name: {{ $releaseName }}-{{ $name }} |
| 52 | namespace: {{ $namespace }} |
| 53 | roleRef: |
| 54 | apiGroup: rbac.authorization.k8s.io |
| 55 | kind: Role |
| 56 | name: {{ $releaseName }}-{{ $name }} |
| 57 | subjects: |
| 58 | - kind: ServiceAccount |
| 59 | name: {{ $releaseName }}-{{ $name }} |
| 60 | --- |
| 61 | apiVersion: apps/v1 |
| 62 | kind: StatefulSet |
| 63 | metadata: |
| 64 | name: {{ $name }} |
| 65 | namespace: {{ $namespace }} |
| 66 | labels: |
| 67 | app: oai-ue |
| 68 | spec: |
| 69 | replicas: 1 |
| 70 | selector: |
| 71 | matchLabels: |
| 72 | app: oai-ue |
| 73 | serviceName: {{ $name | quote }} |
| 74 | template: |
| 75 | metadata: |
| 76 | labels: |
| 77 | app: oai-ue |
| 78 | spec: |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 79 | {{- if .Values.nodeSelectors.enabled }} |
| 80 | nodeSelector: |
| 81 | {{ .Values.nodeSelectors.ue.label }}: {{ .Values.nodeSelectors.ue.value }} |
| 82 | {{- end }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 83 | serviceAccountName: {{ $releaseName }}-{{ $name }} |
| 84 | hostNetwork: true |
| 85 | initContainers: |
| 86 | - name: ue-dep-check |
| 87 | image: {{ .Values.images.tags.dep_check | quote }} |
| 88 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 89 | securityContext: |
| 90 | allowPrivilegeEscalation: false |
| 91 | readOnlyRootFilesystem: false |
| 92 | runAsUser: 0 |
| 93 | env: |
| 94 | - name: POD_NAME |
| 95 | valueFrom: |
| 96 | fieldRef: |
| 97 | apiVersion: v1 |
| 98 | fieldPath: metadata.name |
| 99 | - name: NAMESPACE |
| 100 | valueFrom: |
| 101 | fieldRef: |
| 102 | apiVersion: v1 |
| 103 | fieldPath: metadata.namespace |
| 104 | - name: PATH |
| 105 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 106 | - name: COMMAND |
| 107 | value: "echo done" |
| 108 | - name: DEPENDENCY_POD_JSON |
| 109 | value: '[{"labels": {"app": "oai-enb"}, "requireSameNode": true}]' |
| 110 | command: |
| 111 | - kubernetes-entrypoint |
| 112 | volumeMounts: |
| 113 | [] |
| 114 | - name: ue-gen-usim |
| 115 | image: {{ .Values.images.tags.ue | quote }} |
| 116 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 117 | command: |
| 118 | - /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 119 | volumeMounts: |
| 120 | - name: script |
| 121 | mountPath: /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 122 | subPath: ue-gen-usim.sh |
| 123 | - name: config |
| 124 | mountPath: /opt/oaisim/ue/config |
| 125 | - name: pod-share |
| 126 | mountPath: /etc/oaisim/ue |
| 127 | - name: ue-init |
| 128 | image: {{ .Values.images.tags.ue | quote }} |
| 129 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 130 | securityContext: |
| 131 | privileged: true |
| 132 | command: |
| 133 | - /opt/oaisim/ue/scripts/ue-init.sh |
| 134 | volumeMounts: |
| 135 | - name: script |
| 136 | mountPath: /opt/oaisim/ue/scripts/ue-init.sh |
| 137 | subPath: ue-init.sh |
| 138 | containers: |
| 139 | - name: {{ $name }} |
| 140 | image: {{ .Values.images.tags.ue | quote }} |
| 141 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 142 | securityContext: |
| 143 | privileged: true |
| 144 | command: |
| 145 | - /opt/oaisim/ue/scripts/ue-run.sh |
| 146 | - start |
| 147 | lifecycle: |
| 148 | preStop: |
| 149 | exec: |
| 150 | command: |
| 151 | - /opt/oaisim/enb/scripts/ue-run.sh |
| 152 | - stop |
| 153 | env: |
| 154 | - name: UE_LOCAL_IP |
| 155 | valueFrom: |
| 156 | fieldRef: |
| 157 | fieldPath: status.podIP |
| 158 | volumeMounts: |
| 159 | - name: script |
| 160 | mountPath: /opt/oaisim/ue/scripts/ue-run.sh |
| 161 | subPath: ue-run.sh |
| 162 | - name: config |
| 163 | mountPath: /opt/oaisim/ue/config |
| 164 | - name: pod-share |
| 165 | mountPath: /etc/oaisim/ue |
| 166 | volumes: |
| 167 | - name: config |
| 168 | configMap: |
| 169 | name: {{ $name }} |
| 170 | defaultMode: 420 |
| 171 | - name: script |
| 172 | configMap: |
| 173 | name: {{ $name }} |
| 174 | defaultMode: 493 |
| 175 | - name: pod-share |
| 176 | emptyDir: {} |