forked from kubermatic/community-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws-priv-ip-seed-cluster-controller-deployment.yaml
More file actions
58 lines (54 loc) · 1.67 KB
/
aws-priv-ip-seed-cluster-controller-deployment.yaml
File metadata and controls
58 lines (54 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: aws-priv-ip-enforce-seed-cluster-controller
name: aws-priv-ip-enforce-seed-cluster-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: aws-priv-ip-enforce-seed-cluster-controller
strategy: {}
template:
metadata:
labels:
app: aws-priv-ip-enforce-seed-cluster-controller
spec:
serviceAccountName: machine-controller
terminationGracePeriodSeconds: 5
containers:
- image: quay.io/kubermatic/util:1.1.2
name: util
command:
- bash
- -c
- |
ltmp=$(mktemp -d) ; trap "rm -rv $ltmp" EXIT
# syncrun to update every md in the seed
syncrun() {
echo "start syncrun: $(date)"
kubectl get -n kube-system -o json machinedeployments \
| jq -r '.items[]|select(.spec.template.spec.providerSpec.value.cloudProviderSpec.assignPublicIP != false) .metadata.name' \
> $ltmp/machinedeployments
while read -r md; do
echo "Found machinedeployment $md with assignment of public IP's. Setting 'assignPublicIP=false'"
kubectl patch -n kube-system machinedeployment $md --type=json -p='
- op: replace
path: /spec/template/spec/providerSpec/value/cloudProviderSpec/assignPublicIP
value: false
'
done < $ltmp/machinedeployments
}
while true; do
syncrun
sleep 5
done
resources:
requests:
cpu: 10m
memory: 200M
limits:
cpu: 50m