Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1460
(An Untitled Masterwork)
Active
Public
Actions
Authored by
vsellier
on Sep 22 2022, 2:49 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
---
apiVersion: v1
kind: ConfigMap
metadata:
name: test
namespace: swh
data:
pre-stop.sh: |
#!/bin/bash
set -ex
if [ ! -e /var/run/stopped ]; then
kill 1
else
echo "Doing noting"
fi
touch /var/run/stopped
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: swh
name: test-local-storage
spec:
revisionHistoryLimit: 2
selector:
matchLabels:
app: swh-test
template:
metadata:
labels:
app: swh-test
spec:
#affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: "kubernetes.io/hostname"
# operator: In
# values:
# - "rancher-node-production-worker01"
terminationGracePeriodSeconds: 3600
containers:
- name: test-local-storage
image: debian:bullseye
command:
- /bin/sleep
args:
- "3600"
imagePullPolicy: Always
volumeMounts:
- name: local
mountPath: /tmp
lifecycle:
preStop:
exec:
command: ["/pre-stop.sh"]
volumeMounts:
- name: test
mountPath: /pre-stop.sh
subPath: "pre-stop.sh"
volumes:
- name: local
emptyDir: {}
- name: test
configMap:
name: test
defaultMode: 0777
items:
- key: "pre-stop.sh"
path: "pre-stop.sh"
- name: metadata-fetcher-credentials
secret:
secretName: metadata-fetcher-credentials
optional: true
Event Timeline
vsellier
created this paste.
Sep 22 2022, 2:49 PM
2022-09-22 14:49:36 (UTC+2)
Log In to Comment