Skip to content

Commit 6cd17f8

Browse files
committed
Merge branch 'feature/openstack-plugin' into develop
2 parents f20c255 + 9cc1f58 commit 6cd17f8

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

add_node.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ sed -e "s,WORKER_IP,$i,g" \
7777
-e "s,ETCDCACERT,`cat index.txt|grep -w ETCDCACERT|cut -d: -f2`,g" \
7878
-e "s,ETCDWORKERKEY,`cat index.txt|grep -w ETCDWORKERKEY_$i|cut -d: -f2`,g" \
7979
-e "s,ETCDWORKER,`cat index.txt|grep -w ETCDWORKER_$i|cut -d: -f2`,g" \
80+
-e "s,CLOUDCONF,`cat index.txt|grep -w CLOUDCONF|cut -d: -f2`,g" \
8081
../template/worker_proxy.yaml > node_$i.yaml
8182
echo Generated: node_$i.yaml
8283
done

create_cloudinit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ done
114114

115115
ADMINKEY=`cat admin-key.pem | gzip | base64 -w0`
116116
ADMIN=`cat admin.pem | gzip | base64 -w0`
117+
CLOUDCONF=`cat ../../cloud.conf | gzip | base64 -w0`
117118

118119
#create indexfile with hashes
119120
echo CAKEY:$CAKEY >> index.txt
@@ -124,6 +125,7 @@ echo APISERVERKEY:$APISERVERKEY >> index.txt
124125
echo APISERVER:$APISERVER >> index.txt
125126
echo ADMINKEY:$ADMINKEY >> index.txt
126127
echo ADMIN:$ADMIN >> index.txt
128+
echo CLOUDCONF:$CLOUDCONF >> index.txt
127129

128130
#convert ssh public key to base64 gzip.
129131
UCK1=`echo $USER_CORE_KEY1 | gzip | base64 -w0`
@@ -147,6 +149,7 @@ sed -e "s,MASTER_HOST_FQDN,$MASTER_HOST_FQDN,g" \
147149
-e "s,ETCDCACERT,$ETCDCACERT,g" \
148150
-e "s,ETCDAPISERVERKEY,$ETCDAPISERVERKEY,g" \
149151
-e "s,ETCDAPISERVER,$ETCDAPISERVER,g" \
152+
-e "s,CLOUDCONF,$CLOUDCONF,g" \
150153
../template/controller.yaml > node_$MASTER_HOST_IP.yaml
151154
echo ----------------------
152155
echo Generated: Master: node_$MASTER_HOST_IP.yaml
@@ -170,6 +173,7 @@ sed -e "s,WORKER_IP,$i,g" \
170173
-e "s,ETCDCACERT,$ETCDCACERT,g" \
171174
-e "s,ETCDWORKERKEY,`cat index.txt|grep -w ETCDWORKERKEY_$i|cut -d: -f2`,g" \
172175
-e "s,ETCDWORKER,`cat index.txt|grep -w ETCDWORKER_$i|cut -d: -f2`,g" \
176+
-e "s,CLOUDCONF,$CLOUDCONF,g" \
173177
../template/worker.yaml > node_$i.yaml
174178
echo Generated: Worker: node_$i.yaml
175179
done

template/controller.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ coreos:
8484
--cluster_dns=CLUSTER_DNS \
8585
--cluster_domain=cluster.local \
8686
--client-ca-file=/etc/kubernetes/ssl/ca.pem \
87-
--anonymous-auth=false
87+
--anonymous-auth=false \
88+
--cloud-provider=openstack \
89+
--cloud-config=/etc/kubernetes/cloud.conf
8890
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet-pod.uuid
8991
Restart=always
9092
RestartSec=10
@@ -285,6 +287,8 @@ write_files:
285287
- --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver.pem
286288
- --kubelet-client-key=/etc/kubernetes/ssl/apiserver-key.pem
287289
- --anonymous-auth=false
290+
- --cloud-provider=openstack
291+
- --cloud-config=/etc/kubernetes/ssl/cloud.conf
288292
livenessProbe:
289293
httpGet:
290294
host: 127.0.0.1
@@ -364,6 +368,8 @@ write_files:
364368
- --leader-elect=true
365369
- --service-account-private-key-file=/etc/kubernetes/ssl/apiserver-key.pem
366370
- --root-ca-file=/etc/kubernetes/ssl/ca.pem
371+
- --cloud-provider=openstack
372+
- --cloud-config=/etc/kubernetes/ssl/cloud.conf
367373
resources:
368374
requests:
369375
cpu: 200m
@@ -471,6 +477,18 @@ write_files:
471477
owner: "root"
472478
content: |
473479
ETCDCACERT
480+
- path: "/etc/kubernetes/cloud.conf"
481+
permissions: "0664"
482+
encoding: "gzip+base64"
483+
owner: "root"
484+
content: |
485+
CLOUDCONF
486+
- path: "/etc/kubernetes/ssl/cloud.conf"
487+
permissions: "0664"
488+
encoding: "gzip+base64"
489+
owner: "root"
490+
content: |
491+
CLOUDCONF
474492
- path: /etc/motd.d/k8s.conf
475493
owner: "root"
476494
permissions: "0644"

template/worker.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ coreos:
8787
--tls-cert-file=/etc/kubernetes/ssl/worker.pem \
8888
--tls-private-key-file=/etc/kubernetes/ssl/worker-key.pem \
8989
--client-ca-file=/etc/kubernetes/ssl/ca.pem \
90-
--anonymous-auth=false
90+
--anonymous-auth=false \
91+
--cloud-provider=openstack \
92+
--cloud-config=/etc/kubernetes/ssl/cloud.conf
9193
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet-pod.uuid
9294
Restart=always
9395
RestartSec=10
@@ -365,6 +367,12 @@ write_files:
365367
owner: "root"
366368
content: |
367369
ETCDWORKER
370+
- path: "/etc/kubernetes/ssl/cloud.conf"
371+
permissions: "0664"
372+
encoding: "gzip+base64"
373+
owner: "root"
374+
content: |
375+
CLOUDCONF
368376
- path: /etc/motd.d/k8s.conf
369377
owner: "root"
370378
permissions: "0644"

template/worker_proxy.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ coreos:
8787
--tls-cert-file=/etc/kubernetes/ssl/worker.pem \
8888
--tls-private-key-file=/etc/kubernetes/ssl/worker-key.pem \
8989
--client-ca-file=/etc/kubernetes/ssl/ca.pem \
90-
--anonymous-auth=false
90+
--anonymous-auth=false \
91+
--cloud-provider=openstack \
92+
--cloud-config=/etc/kubernetes/ssl/cloud.conf
9193
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet-pod.uuid
9294
Restart=always
9395
RestartSec=10
@@ -365,6 +367,12 @@ write_files:
365367
owner: "root"
366368
content: |
367369
ETCDWORKER
370+
- path: "/etc/kubernetes/ssl/cloud.conf"
371+
permissions: "0664"
372+
encoding: "gzip+base64"
373+
owner: "root"
374+
content: |
375+
CLOUDCONF
368376
- path: /etc/motd.d/k8s.conf
369377
owner: "root"
370378
permissions: "0644"

0 commit comments

Comments
 (0)