blob: 3ce77a2e1577715761a090a1ffe6a20e9a3ac72d (
plain)
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
|
#!/bin/bash
IMAGE_URL=https://fedorapeople.org/groups/magnum
IMAGE_NAME=fedora-21-atomic-6
IMAGE=${IMAGE_NAME}.qcow2
if ! [ -f "$IMAGE" ]; then
echo "Downloading ${IMAGE_NAME} image"
curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE
fi
NIC_ID=$(openstack network show public1 | awk '/ id /{print $4}')
openstack image delete ${IMAGE_NAME} 2> /dev/null
echo "Loading ${IMAGE_NAME} image into glance"
openstack image create --public --disk-format qcow2 --container-format bare --file ./$IMAGE ${IMAGE_NAME}
GLANCE_IMAGE_ID=$(openstack image show ${IMAGE_NAME} | grep id | awk '{print $4}')
echo "Registering os-distro property with image"
openstack image set $GLANCE_IMAGE_ID --property os_distro=fedora-atomic
echo "Creating cluster-template"
magnum cluster-template-create \
--name testclustertemplate \
--image $GLANCE_IMAGE_ID \
--keypair mykey \
--fixed-network 10.0.3.0/24 \
--external-network $NIC_ID \
--tls-disabled \
--dns-nameserver 8.8.8.8 --flavor m1.small \
--docker-volume-size 5 --coe kubernetes
echo "Creating cluster"
magnum cluster-create --name testcluster --cluster-template testclustertemplate --node-count 2
|