Upgrade to Fedora 25

Atomic image contains:
kubernetes-1.5.2-2.fc25.x86_64
docker-1.12.6-5.git037a2f5.fc25.x86_64
flannel-0.5.5-8.fc25.x86_64
etcd-3.0.15-1.fc25.x86_64

The ironic image contains exactly the same packages.

* For this upgrade the upstream image is used, which is
  uploaded here [1].
* Minor changes for flannel and docker-storage-setup
  were needed.
* The image will be built in the CI and uploaded to
  tarballs.openstack.org as soon as possible.
* Ironic image [2].

Notes:
* docker-storage-setup config changes were needed because in
  the previous images it was disabled and it was started by us.
* We can have selinux enables in containers since the images
  have kernel 4.9.x.

[1] https://fedorapeople.org/groups/magnum/fedora-atomic-25-latest.qcow2
[2] https://fedorapeople.org/groups/magnum/fedora-25-kubernetes-ironic.tar.gz

Change-Id: Iac6e30c530821a49a5c3978e335e0b1d56a576e0
This commit is contained in:
Spyros Trigazis 2017-01-04 17:32:16 +01:00
parent 64a5dea2a6
commit d2532a3af2
14 changed files with 53 additions and 28 deletions

View File

@ -1,9 +1,17 @@
# This file contains docker storage drivers configuration for fedora
# atomic hosts. Currently, devicemapper and overlay are supported.
# Remove any existing docker-storage configuration. In case of an
# existing configuration, docker-storage-setup will fail.
clear_docker_storage_configuration () {
# * Remove any existing docker-storage configuration. In case of an
# existing configuration, docker-storage-setup will fail.
# * Remove docker storage graph
clear_docker_storage () {
# stop docker
systemctl stop docker
# clear storage graph
rm -rf /var/lib/docker/*
# remove current LVs
docker-storage-setup --reset
if [ -f /etc/sysconfig/docker-storage ]; then
sed -i "/^DOCKER_STORAGE_OPTIONS=/ s/=.*/=/" /etc/sysconfig/docker-storage
fi
@ -11,9 +19,7 @@ clear_docker_storage_configuration () {
# Configure docker storage with xfs as backing filesystem.
configure_overlay () {
clear_docker_storage_configuration
rm -rf /var/lib/docker/*
clear_docker_storage
if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
mkfs.xfs -f ${device_path}
@ -23,20 +29,29 @@ configure_overlay () {
echo "STORAGE_DRIVER=overlay" > /etc/sysconfig/docker-storage-setup
# SELinux must be enabled and in enforcing mode on the physical
# machine, but must be disabled in the container when performing
# container separation
sed -i "/^OPTIONS=/ s/--selinux-enabled/--selinux-enabled=false/" /etc/sysconfig/docker
docker-storage-setup
local lvname=$(lvdisplay | grep "LV\ Path" | awk '{print $3}')
local pvname=$(pvdisplay | grep "PV\ Name" | awk '{print $3}')
lvextend -r $lvname $pvname
}
# Configure docker storage with devicemapper using direct LVM
configure_devicemapper () {
clear_docker_storage_configuration
clear_docker_storage
echo "GROWROOT=True" > /etc/sysconfig/docker-storage-setup
echo "ROOT_SIZE=5GB" >> /etc/sysconfig/docker-storage-setup
if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
pvcreate -f ${device_path}
vgcreate docker ${device_path}
echo "VG=docker" > /etc/sysconfig/docker-storage-setup
echo "VG=docker" >> /etc/sysconfig/docker-storage-setup
else
echo "DATA_SIZE=95%FREE" >> /etc/sysconfig/docker-storage-setup
fi
docker-storage-setup
}

View File

@ -73,13 +73,13 @@ sed -i '
if [ "$NETWORK_DRIVER" = "flannel" ]; then
sed -i '
/^FLANNEL_ETCD=/ s|=.*|="'"$PROTOCOL"'://'"$ETCD_SERVER_IP"':2379"|
/^FLANNEL_ETCD_ENDPOINTS=/ s|=.*|="'"$PROTOCOL"'://'"$ETCD_SERVER_IP"':2379"|
' $FLANNELD_CONFIG
# Make sure etcd has a flannel configuration
. $FLANNELD_CONFIG
until curl -sf $ETCD_CURL_OPTIONS \
"$FLANNEL_ETCD/v2/keys${FLANNEL_ETCD_KEY}/config?quorum=false&recursive=false&sorted=false"
"$FLANNEL_ETCD_ENDPOINTS/v2/keys${FLANNEL_ETCD_PREFIX}/config?quorum=false&recursive=false&sorted=false"
do
echo "Waiting for flannel configuration in etcd..."
sleep 5

View File

@ -41,14 +41,14 @@ if ! [ -f "$FLANNEL_JSON" ]; then
exit 1
fi
if ! [ "$FLANNEL_ETCD" ] && [ "$FLANNEL_ETCD_KEY" ]; then
if [ -z "$FLANNEL_ETCD_ENDPOINTS" ] || [ -z "$FLANNEL_ETCD_PREFIX" ]; then
echo "ERROR: missing required configuration" >&2
exit 1
fi
echo "creating flanneld config in etcd"
while ! curl -sf -L $ETCD_CURL_OPTIONS \
$FLANNEL_ETCD/v2/keys${FLANNEL_ETCD_KEY}/config \
$FLANNEL_ETCD_ENDPOINTS/v2/keys${FLANNEL_ETCD_PREFIX}/config \
-X PUT --data-urlencode value@${FLANNEL_JSON}; do
echo "waiting for etcd"
sleep 1

View File

@ -12,7 +12,7 @@ FLANNEL_JSON=/etc/sysconfig/flannel-network.json
FLANNELD_CONFIG=/etc/sysconfig/flanneld
sed -i '
/^FLANNEL_ETCD=/ s/=.*/="http:\/\/127.0.0.1:2379"/
/^FLANNEL_ETCD_ENDPOINTS=/ s/=.*/="http:\/\/127.0.0.1:2379"/
' /etc/sysconfig/flanneld
# Generate a flannel configuration that we will

View File

@ -1,5 +1,9 @@
#!/bin/sh
set -x
systemctl stop docker
echo "starting services"
systemctl daemon-reload
for service in $NODE_SERVICES; do

View File

@ -266,7 +266,7 @@ parameters:
kube_version:
type: string
description: version of kubernetes used for kubernetes cluster
default: v1.2.0
default: v1.5.2
insecure_registry_url:
type: string

View File

@ -14,4 +14,4 @@
version = '1.0.0'
driver = 'k8s_fedora_atomic_v1'
container_version = '1.9.1'
container_version = '1.12.6'

View File

@ -269,7 +269,7 @@ parameters:
kube_version:
type: string
description: version of kubernetes used for kubernetes cluster
default: v1.2.0
default: v1.5.2
insecure_registry_url:
type: string

View File

@ -14,4 +14,4 @@
version = '1.0.0'
driver = 'k8s_fedora_ironic_v1'
container_version = '1.9.1'
container_version = '1.12.6'

View File

@ -333,7 +333,7 @@ resources:
str_replace:
template: {get_file: ../../common/templates/swarm/fragments/enable-services.sh}
params:
"$NODE_SERVICES": "etcd docker.socket swarm-manager"
"$NODE_SERVICES": "etcd docker.socket docker swarm-manager"
cfn_signal:
type: "OS::Heat::SoftwareConfig"

View File

@ -296,7 +296,7 @@ resources:
str_replace:
template: {get_file: ../../common/templates/swarm/fragments/enable-services.sh}
params:
"$NODE_SERVICES": "docker.socket swarm-agent"
"$NODE_SERVICES": "docker.socket docker swarm-agent"
cfn_signal:
type: "OS::Heat::SoftwareConfig"

View File

@ -14,4 +14,4 @@
version = '1.0.0'
driver = 'swarm_fedora_atomic_v1'
container_version = '1.9.1'
container_version = '1.12.6'

View File

@ -42,6 +42,8 @@ function remote_exec {
mkdir -p $LOG_PATH
cat /proc/cpuinfo > /opt/stack/logs/cpuinfo.log
if [[ "$COE" == "kubernetes" ]]; then
SSH_USER=fedora
remote_exec $SSH_USER "sudo systemctl --full list-units --no-pager" systemctl_list_units.log
@ -81,6 +83,7 @@ elif [[ "$COE" == "swarm" ]]; then
remote_exec $SSH_USER "sudo journalctl -u cloud-final --no-pager" cloud-final.log
remote_exec $SSH_USER "sudo journalctl -u cloud-init-local --no-pager" cloud-init-local.log
remote_exec $SSH_USER "sudo journalctl -u cloud-init --no-pager" cloud-init.log
remote_exec $SSH_USER "sudo cat /var/log/cloud-init-output.log" cloud-init-output.log
remote_exec $SSH_USER "sudo journalctl -u etcd --no-pager" etcd.log
remote_exec $SSH_USER "sudo journalctl -u swarm-manager --no-pager" swarm-manager.log
remote_exec $SSH_USER "sudo journalctl -u swarm-agent --no-pager" swarm-agent.log
@ -89,6 +92,9 @@ elif [[ "$COE" == "swarm" ]]; then
remote_exec $SSH_USER "sudo systemctl show docker-storage-setup --no-pager" docker-storage-setup.service.show.log
remote_exec $SSH_USER "sudo cat /etc/sysconfig/docker-storage-setup 2>/dev/null" docker-storage-setup.sysconfig.env.log
remote_exec $SSH_USER "sudo journalctl -u docker --no-pager" docker.log
remote_exec $SSH_USER "sudo journalctl -u docker-containerd --no-pager" docker-containerd.log
remote_exec $SSH_USER "sudo systemctl status docker.socket -l" docker.socket.status.log
remote_exec $SSH_USER "sudo systemctl show docker.socket --no-pager" docker.socket.show.log
remote_exec $SSH_USER "sudo systemctl status docker -l" docker.service.status.log
remote_exec $SSH_USER "sudo systemctl show docker --no-pager" docker.service.show.log
remote_exec $SSH_USER "sudo cat /etc/sysconfig/docker" docker.sysconfig.env.log

View File

@ -38,8 +38,8 @@ if [ "$coe" = "mesos" ]; then
elif [ "$coe" = "k8s-coreos" ]; then
echo "MAGNUM_GUEST_IMAGE_URL=http://beta.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2" >> $BASE/new/devstack/localrc
elif [ "${coe}${special}" = "k8s-ironic" ]; then
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL='https://fedorapeople.org/groups/magnum/fedora-24-kubernetes-ironic.tar.gz'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_IMAGE_NAME='fedora-24-kubernetes-ironic'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL='https://fedorapeople.org/groups/magnum/fedora-25-kubernetes-ironic.tar.gz'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_IMAGE_NAME='fedora-25-kubernetes-ironic'"
export DEVSTACK_GATE_VIRT_DRIVER="ironic"
# NOTE(yuanying): Current implementation requires only 1 subnet under network
@ -75,8 +75,8 @@ elif [ "${coe}${special}" = "k8s-ironic" ]; then
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_VM_SPECS_DISK=10"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_VM_EPHEMERAL_DISK=5"
else
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL='http://tarballs.openstack.org/magnum/images/fedora-atomic-24-dib.qcow2'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_IMAGE_NAME='fedora-atomic-24-dib'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL='https://fedorapeople.org/groups/magnum/fedora-atomic-25-latest.qcow2'"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_IMAGE_NAME='fedora-atomic-25-latest'"
fi
# Enable magnum plugin in the last step