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 | |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 17 | --- |
| 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
| 20 | metadata: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 21 | name: ue-teardown-if |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 22 | labels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 23 | {{ tuple "ue" . | include "oaisim.metadata_labels" | indent 4 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 24 | annotations: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 25 | "helm.sh/hook": "post-delete" |
| 26 | "helm.sh/hook-delete-policy": "before-hook-creation" |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 27 | spec: |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 31 | {{ tuple "ue" . | include "oaisim.metadata_labels" | indent 8 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 32 | spec: |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 33 | {{- if .Values.nodeSelectors.enabled }} |
| 34 | nodeSelector: |
| 35 | {{ .Values.nodeSelectors.ue.label }}: {{ .Values.nodeSelectors.ue.value }} |
| 36 | {{- end }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 37 | restartPolicy: Never |
| 38 | containers: |
| 39 | - name: ue-teardown-if-job |
| 40 | image: {{ .Values.images.tags.ue | quote }} |
| 41 | securityContext: |
| 42 | privileged: true |
| 43 | runAsUser: 0 |
| 44 | command: ["bash", "-xc"] |
| 45 | args: |
| 46 | - if chroot /mnt/host-rootfs lsmod | grep -q ue_ip;then chroot /mnt/host-rootfs rmmod ue_ip;fi |
| 47 | volumeMounts: |
| 48 | - name: host-rootfs |
| 49 | mountPath: /mnt/host-rootfs |
| 50 | volumes: |
| 51 | - name: host-rootfs |
| 52 | hostPath: |
| 53 | path: / |