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 }} |
| 19 | {{- $name := .Values.conf.ue.name }} |
| 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: |
| 79 | serviceAccountName: {{ $releaseName }}-{{ $name }} |
| 80 | hostNetwork: true |
| 81 | initContainers: |
| 82 | - name: ue-dep-check |
| 83 | image: {{ .Values.images.tags.dep_check | quote }} |
| 84 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 85 | securityContext: |
| 86 | allowPrivilegeEscalation: false |
| 87 | readOnlyRootFilesystem: false |
| 88 | runAsUser: 0 |
| 89 | env: |
| 90 | - name: POD_NAME |
| 91 | valueFrom: |
| 92 | fieldRef: |
| 93 | apiVersion: v1 |
| 94 | fieldPath: metadata.name |
| 95 | - name: NAMESPACE |
| 96 | valueFrom: |
| 97 | fieldRef: |
| 98 | apiVersion: v1 |
| 99 | fieldPath: metadata.namespace |
| 100 | - name: PATH |
| 101 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 102 | - name: COMMAND |
| 103 | value: "echo done" |
| 104 | - name: DEPENDENCY_POD_JSON |
| 105 | value: '[{"labels": {"app": "oai-enb"}, "requireSameNode": true}]' |
| 106 | command: |
| 107 | - kubernetes-entrypoint |
| 108 | volumeMounts: |
| 109 | [] |
| 110 | - name: ue-gen-usim |
| 111 | image: {{ .Values.images.tags.ue | quote }} |
| 112 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 113 | command: |
| 114 | - /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 115 | volumeMounts: |
| 116 | - name: script |
| 117 | mountPath: /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 118 | subPath: ue-gen-usim.sh |
| 119 | - name: config |
| 120 | mountPath: /opt/oaisim/ue/config |
| 121 | - name: pod-share |
| 122 | mountPath: /etc/oaisim/ue |
| 123 | - name: ue-init |
| 124 | image: {{ .Values.images.tags.ue | quote }} |
| 125 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 126 | securityContext: |
| 127 | privileged: true |
| 128 | command: |
| 129 | - /opt/oaisim/ue/scripts/ue-init.sh |
| 130 | volumeMounts: |
| 131 | - name: script |
| 132 | mountPath: /opt/oaisim/ue/scripts/ue-init.sh |
| 133 | subPath: ue-init.sh |
| 134 | containers: |
| 135 | - name: {{ $name }} |
| 136 | image: {{ .Values.images.tags.ue | quote }} |
| 137 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 138 | securityContext: |
| 139 | privileged: true |
| 140 | command: |
| 141 | - /opt/oaisim/ue/scripts/ue-run.sh |
| 142 | - start |
| 143 | lifecycle: |
| 144 | preStop: |
| 145 | exec: |
| 146 | command: |
| 147 | - /opt/oaisim/enb/scripts/ue-run.sh |
| 148 | - stop |
| 149 | env: |
| 150 | - name: UE_LOCAL_IP |
| 151 | valueFrom: |
| 152 | fieldRef: |
| 153 | fieldPath: status.podIP |
| 154 | volumeMounts: |
| 155 | - name: script |
| 156 | mountPath: /opt/oaisim/ue/scripts/ue-run.sh |
| 157 | subPath: ue-run.sh |
| 158 | - name: config |
| 159 | mountPath: /opt/oaisim/ue/config |
| 160 | - name: pod-share |
| 161 | mountPath: /etc/oaisim/ue |
| 162 | volumes: |
| 163 | - name: config |
| 164 | configMap: |
| 165 | name: {{ $name }} |
| 166 | defaultMode: 420 |
| 167 | - name: script |
| 168 | configMap: |
| 169 | name: {{ $name }} |
| 170 | defaultMode: 493 |
| 171 | - name: pod-share |
| 172 | emptyDir: {} |