Skip to content

Instantly share code, notes, and snippets.

@ams0
Created May 1, 2019 10:05
Show Gist options
  • Save ams0/46b2f8e0818b8fe40aceca436aa3dac4 to your computer and use it in GitHub Desktop.
Save ams0/46b2f8e0818b8fe40aceca436aa3dac4 to your computer and use it in GitHub Desktop.
Installs a package on a node
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: apt-get-install
spec:
selector:
matchLabels:
name: apt-get-install
template:
metadata:
labels:
name: apt-get-install
spec:
initContainers:
- name: apt-get-install
securityContext:
privileged: true
image: ubuntu
args: [/bin/sh, -c,
'chroot /mnt/rootnode sh -c "apt-get update && apt-get install mc -y"']
volumeMounts:
- name: root-volume
mountPath: /mnt/rootnode
volumes:
- hostPath:
path: /
name: root-volume
containers:
- name: pause
image: gcr.io/google_containers/pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment