Browse Source

Switch to Atomic 23

Change the devstack image to the default Atomic 23 image.
Update templates not to rely on interface naming because the names
changed between Atomic 21 and Atomic 23 images.
Add a functional test to validate minion node registration.
Update docs to refer to a generic Atomic image.

Co-Authored-By: Hongbin Lu <hongbin.lu@huawei.com>

Implements: blueprint atomic23
Change-Id: Id67244e3f452b3c7c3c46fdabcca3a5c141a76c0
changes/32/276232/14
Corey O'Brien 6 years ago committed by Hongbin Lu
parent
commit
32f917c8d7
  1. 5
      devstack/README.rst
  2. 8
      devstack/lib/magnum
  3. 11
      devstack/plugin.sh
  4. 10
      doc/source/dev/manual-devstack.rst
  5. 6
      doc/source/dev/quickstart.rst
  6. 4
      doc/source/dev/tls.rst
  7. 4
      doc/source/magnum-proxy.rst
  8. 6
      doc/source/troubleshooting-guide.rst
  9. 2
      functional_creds.conf.sample
  10. 2
      magnum/templates/kubernetes/fragments/configure-kubernetes-minion.sh
  11. 7
      magnum/templates/kubernetes/fragments/make-cert-client.sh
  12. 7
      magnum/templates/kubernetes/fragments/make-cert.sh
  13. 2
      magnum/templates/swarm/README.md
  14. 5
      magnum/tests/contrib/post_test_hook.sh
  15. 2
      magnum/tests/functional/tempest_tests/config.py

5
devstack/README.rst

@ -9,9 +9,8 @@ http://docs.openstack.org/developer/magnum/dev/dev-quickstart.html
for more information on using devstack and magnum.
Running devstack with magnum for the first time may take a long time as it
needs to download the Fedora Atomic micro-OS qcow2 image (e.g.,
``fedora-21-atomic-5.qcow2``). If you already have this image you can copy it
to /opt/stack/devstack/files first to save time.
needs to download the Fedora Atomic qcow2 image (see
http://www.projectatomic.io/download/).
To install magnum into devstack, add the following settings to enable the
magnum plugin::

8
devstack/lib/magnum

@ -257,12 +257,12 @@ function init_magnum {
function magnum_register_image {
local magnum_image_property="--property os_distro="
local atomic="$(echo $MAGNUM_GUEST_IMAGE_URL | grep -o 'atomic' || true;)"
if [ ! -z $atomic ]; then
local atomic="$(echo $MAGNUM_GUEST_IMAGE_URL | grep -io 'atomic' || true;)"
if [ ! -z "$atomic" ]; then
magnum_image_property=$magnum_image_property"fedora-atomic"
fi
local ubuntu="$(echo $MAGNUM_GUEST_IMAGE_URL | grep -o "ubuntu" || ture;)"
if [ ! -z $ubuntu ]; then
local ubuntu="$(echo $MAGNUM_GUEST_IMAGE_URL | grep -io "ubuntu" || true;)"
if [ ! -z "$ubuntu" ]; then
magnum_image_property=$magnum_image_property"ubuntu"
fi

11
devstack/plugin.sh

@ -15,7 +15,16 @@ if is_service_enabled m-api m-cond; then
# add image to glance
if [[ "$ENABLED_SERVICES" =~ 'm-api' ]]; then
MAGNUM_GUEST_IMAGE_URL=${MAGNUM_GUEST_IMAGE_URL:-"https://fedorapeople.org/groups/magnum/fedora-21-atomic-5.qcow2"}
# TODO Add a "latest" link to fedora release process
ATOMIC_IMAGE_NAME=$( \
wget --spider --level 1 \
--recursive --accept-regex=".*qcow2" \
"https://alt.fedoraproject.org/pub/alt/atomic/stable/Cloud-Images/x86_64/Images/" 2>&1 | \
grep qcow2 | \
sed 's/.*Cloud-Images\/x86_64\/Images\///' | \
head -n 1)
echo "Atomic Image: $ATOMIC_IMAGE_NAME"
MAGNUM_GUEST_IMAGE_URL=${MAGNUM_GUEST_IMAGE_URL:-"https://download.fedoraproject.org/pub/alt/atomic/stable/Cloud-Images/x86_64/Images/$ATOMIC_IMAGE_NAME"}
IMAGE_URLS+=",${MAGNUM_GUEST_IMAGE_URL}"
fi

10
doc/source/dev/manual-devstack.rst

@ -113,17 +113,15 @@ Magnum has been tested with the Fedora Atomic micro-OS and CoreOS. Magnum will
likely work with other micro-OS platforms, but each requires individual
support in the heat template.
Store the Fedora Atomic micro-OS in glance. (The steps for updating Fedora
Atomic images are a bit detailed. Fortunately one of the core developers has
made Atomic images available at https://fedorapeople.org/groups/magnum)::
Store the Fedora Atomic micro-OS in glance. Download the qcow2 Atomic image
from https://getfedora.org/cloud/download/atomic.html and then upload it to
glance::
cd ~
wget https://fedorapeople.org/groups/magnum/fedora-21-atomic-5.qcow2
glance image-create --name fedora-21-atomic-5 \
--visibility public \
--disk-format qcow2 \
--os-distro fedora-atomic \
--container-format bare < fedora-21-atomic-5.qcow2
--container-format bare < fedora-atomic.qcow2
Create a domain and domain admin for trust::

6
doc/source/dev/quickstart.rst

@ -185,7 +185,7 @@ when installing devstack use::
| 7f5b6a15-f2fd-4552-aec5-952c6f6d4bc7 | cirros-0.3.4-x86_64-uec | ami | ami | 25165824 | active |
| bd3c0f92-669a-4390-a97d-b3e0a2043362 | cirros-0.3.4-x86_64-uec-kernel | aki | aki | 4979632 | active |
| 843ce0f7-ae51-4db3-8e74-bcb860d06c55 | cirros-0.3.4-x86_64-uec-ramdisk | ari | ari | 3740163 | active |
| 02c312e3-2d30-43fd-ab2d-1d25622c0eaa | fedora-21-atomic-5 | qcow2 | bare | 770179072 | active |
| 02c312e3-2d30-43fd-ab2d-1d25622c0eaa | fedora-atomic | qcow2 | bare | 770179072 | active |
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
To list the available commands and resources for magnum, use::
@ -217,7 +217,7 @@ The coe (Container Orchestration Engine) and keypair need to be specified
as well::
magnum baymodel-create --name k8sbaymodel \
--image-id fedora-21-atomic-5 \
--image-id fedora-atomic \
--keypair-id testkey \
--external-network-id public \
--dns-nameserver 8.8.8.8 \
@ -437,7 +437,7 @@ the absence of some Kubernetes-specific arguments and the use of 'swarm'
as the coe::
magnum baymodel-create --name swarmbaymodel \
--image-id fedora-21-atomic-5 \
--image-id fedora-atomic \
--keypair-id testkey \
--external-network-id public \
--dns-nameserver 8.8.8.8 \

4
doc/source/dev/tls.rst

@ -45,7 +45,7 @@ Create a baymodel, by default TLS is enabled in Magnum::
magnum baymodel-create --name secure-kubernetes \
--keypair-id default \
--external-network-id public \
--image-id fedora-21-atomic-5 \
--image-id fedora-atomic \
--flavor-id m1.small \
--docker-volume-size 1 \
--coe kubernetes \
@ -68,7 +68,7 @@ Create a baymodel, by default TLS is enabled in Magnum::
| docker_volume_size | 1 |
| external_network_id | public |
| cluster_distro | fedora-atomic |
| image_id | fedora-21-atomic-5 |
| image_id | fedora-atomic |
| registry_enabled | False |
| apiserver_port | None |
| name | secure-kubernetes |

4
doc/source/magnum-proxy.rst

@ -41,7 +41,7 @@ You can specify all three proxy parameters while creating baymodel of any
coe type. All of proxy parameters are optional.
magnum baymodel-create --name k8sbaymodel \
--image-id fedora-21-atomic-5 \
--image-id fedora-atomic \
--keypair-id testkey \
--external-network-id public \
--dns-nameserver 8.8.8.8 \
@ -51,7 +51,7 @@ coe type. All of proxy parameters are optional.
--https-proxy <https://abc-proxy.com:8080> \
--no-proxy <172.24.4.4,172.24.4.9,172.24.4.8>
magnum baymodel-create --name swarmbaymodel \
--image-id fedora-21-atomic-5 \
--image-id fedora-atomic \
--keypair-id testkey \
--external-network-id public \
--dns-nameserver 8.8.8.8 \

6
doc/source/troubleshooting-guide.rst

@ -140,12 +140,6 @@ works in your case)::
ping 8.8.8.8
**Note:** On the fedora-21-atomic-5 image, ping does not work because
of a known atomic bug. You can work around this problem by::
cp /usr/bin/ping .
sudo ./ping 8.8.8.8
If the ping fails, there is no route to the external internet.
Check the following:

2
functional_creds.conf.sample

@ -11,7 +11,7 @@ user = admin
tenant = admin
pass = password
[magnum]
image_id = fedora-21-atomic-5
image_id = fedora-atomic
nic_id = public
keypair_id = default
flavor_id = s1.magnum

2
magnum/templates/kubernetes/fragments/configure-kubernetes-minion.sh

@ -39,7 +39,7 @@ if [ "$NETWORK_DRIVER" == "flannel" ]; then
# Make sure etcd has a flannel configuration
. /etc/sysconfig/flanneld
until curl -sf "$FLANNEL_ETCD/v2/keys/coreos.com/network/config?quorum=false&recursive=false&sorted=false"
until curl -sf "$FLANNEL_ETCD/v2/keys${FLANNEL_ETCD_KEY}/config?quorum=false&recursive=false&sorted=false"
do
echo "Waiting for flannel configuration in etcd..."
sleep 5

7
magnum/templates/kubernetes/fragments/make-cert-client.sh

@ -37,7 +37,7 @@ CLIENT_CSR=$cert_dir/client.csr
CLIENT_KEY=$cert_dir/client.key
#Get a token by user credentials and trust
cat > auth.json << EOF
auth_json=$(cat << EOF
{
"auth": {
"identity": {
@ -59,14 +59,13 @@ cat > auth.json << EOF
}
}
EOF
)
#trust is introduced in Keystone v3 version
AUTH_URL=${AUTH_URL/v2.0/v3}
USER_TOKEN=`curl -s -i -X POST -H "Content-Type: application/json" -d @auth.json \
USER_TOKEN=`curl -s -i -X POST -H "Content-Type: application/json" -d "$auth_json" \
$AUTH_URL/auth/tokens | grep X-Subject-Token | awk '{print $2}'`
rm -rf auth.json
# Get CA certificate for this bay
curl -X GET \
-H "X-Auth-Token: $USER_TOKEN" \

7
magnum/templates/kubernetes/fragments/make-cert.sh

@ -44,7 +44,7 @@ SERVER_CSR=$cert_dir/server.csr
SERVER_KEY=$cert_dir/server.key
#Get a token by user credentials and trust
cat > auth.json << EOF
auth_json=$(cat << EOF
{
"auth": {
"identity": {
@ -66,14 +66,13 @@ cat > auth.json << EOF
}
}
EOF
)
#trust is introduced in Keystone v3 version
AUTH_URL=${AUTH_URL/v2.0/v3}
USER_TOKEN=`curl -s -i -X POST -H "Content-Type: application/json" -d @auth.json \
USER_TOKEN=`curl -s -i -X POST -H "Content-Type: application/json" -d "$auth_json" \
$AUTH_URL/auth/tokens | grep X-Subject-Token | awk '{print $2}'`
rm -rf auth.json
# Get CA certificate for this bay
curl -X GET \
-H "X-Auth-Token: $USER_TOKEN" \

2
magnum/templates/swarm/README.md

@ -39,7 +39,7 @@ your environment:
ssh_key_name: testkey
external_network: 028d70dd-67b8-4901-8bdd-0c62b06cce2d
dns_nameserver: 192.168.200.1
server_image: fedora-21-atomic-5
server_image: fedora-atomic
discovery_url: token://d8cdfe5128af6e1075b34aa06ff1cc2c
And then create the stack, referencing that environment file:

5
magnum/tests/contrib/post_test_hook.sh

@ -28,11 +28,10 @@ function create_test_data {
# a baymodel, bay and a pod
coe=$1
if [ $coe == 'mesos' ]; then
local image_name="ubuntu-14.04"
else
local image_name="fedora-21-atomic"
local image_name="atomic"
fi
# if we have the MAGNUM_IMAGE_NAME setting, use it instead
@ -41,7 +40,7 @@ function create_test_data {
image_name=${MAGNUM_IMAGE_NAME:-$image_name}
export NIC_ID=$(neutron net-show public | awk '/ id /{print $4}')
export IMAGE_ID=$(glance --os-image-api-version 1 image-list | grep $image_name | awk '{print $2}')
export IMAGE_ID=$(glance --os-image-api-version 1 image-list | grep -i $image_name | awk '{print $2}')
# pass the appropriate variables via a config file
CREDS_FILE=$MAGNUM_DIR/functional_creds.conf

2
magnum/tests/functional/tempest_tests/config.py

@ -29,7 +29,7 @@ magnum_group = cfg.OptGroup(name="magnum", title="Magnum Options")
MagnumGroup = [
cfg.StrOpt("image_id",
default="fedora-21-atomic-5",
default="fedora-atomic",
help="Image id to be used for baymodel."),
cfg.StrOpt("nic_id",

Loading…
Cancel
Save