Skip to content

Commit 06bcfde

Browse files
committed
Add ssm-agent installer daemonset
1 parent 5d61dcf commit 06bcfde

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
echo "Deploying SSM Agent daemonset ..."
5+
6+
kubectl apply -f ./ssm-daemonset.yaml
7+
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
echo "Removing SSM Agent daemonset ..."
5+
echo "SSM Agent will not be installed on new nodes, it will continue to run on existing nodes"
6+
7+
kubectl delete -f ./ssm-daemonset.yaml
8+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
k8s-app: ssm-installer
6+
name: ssm-installer
7+
namespace: kube-system
8+
spec:
9+
selector:
10+
matchLabels:
11+
k8s-app: ssm-installer
12+
template:
13+
metadata:
14+
labels:
15+
k8s-app: ssm-installer
16+
spec:
17+
containers:
18+
- name: sleeper
19+
image: busybox
20+
command: ['sh', '-c', 'echo I keep things running! && sleep 3600']
21+
initContainers:
22+
- image: amazonlinux
23+
imagePullPolicy: Always
24+
name: ssm
25+
command: ["/bin/bash"]
26+
args: ["-c","echo '* * * * * root yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm & rm -rf /etc/cron.d/ssmstart' > /etc/cron.d/ssmstart"]
27+
securityContext:
28+
allowPrivilegeEscalation: true
29+
volumeMounts:
30+
- mountPath: /etc/cron.d
31+
name: cronfile
32+
terminationMessagePath: /dev/termination-log
33+
terminationMessagePolicy: File
34+
volumes:
35+
- name: cronfile
36+
hostPath:
37+
path: /etc/cron.d
38+
type: Directory
39+
dnsPolicy: ClusterFirst
40+
restartPolicy: Always
41+
schedulerName: default-scheduler
42+
terminationGracePeriodSeconds: 30

0 commit comments

Comments
 (0)