Commit Graph

21 Commits

Author SHA1 Message Date
Bharat Kunwar 68e6c0e48d [fix] Detect virtio-scsi volumes correctly
When the Cinder volume is presented as a virtio-scsi volume, the
device_name detection fails. This change allows the device name to be
retrieved correctly for both virtio-pci and virtio-scsi cases.

Story: 2008618
Task: 41808
Change-Id: Ia6a848eae11bc38ff71ef4575247010a8ffaa47b
2021-08-10 06:57:30 +00:00
Zuul 1f6df6fb4c Merge "Remove shebang from scripts" 2020-06-26 16:02:18 +00:00
Feilong Wang b2e3f2346b Fix proxy issue for etcd and k8s
When the cloud is behind a proxy, podman needs to access the dockerhub
via proxy to pull the image, so the proxy settings need to be exported
to etcd systemd file as well. We're setting the heat-params as
environment file for k8s components already.

Besides, because CIDR of fixed subnet vary for different clusters,
so the subnet CIDR should be added into NO_PROXY list. Otherwise,
it will affect the communication between etcd members and also the
communication between k8s components.

Task: 39990
Story: 2007768

Change-Id: I4dba79e04abe38b9806e847348d3dd77ef96bee5
2020-06-17 09:54:11 +12:00
Bharat Kunwar 799563eb61 Remove shebang from scripts
Without this, heat container agents using  kubectl version
1.18.x (e.g. ussuri-dev) fail because they do not have the correct
KUBECONFIG in the environment.

Task: 39938
Story: 2007591

Change-Id: Ifc212478ae09c658adeb6ba4c8e8afc8943e3977
2020-06-16 20:53:07 +00:00
Bharat Kunwar d3984dd4c2 fcos: Upgrade etcd to v3.4.6, use quay.io/coreos/etcd
The tags on quay.io/coreos/etcd follow the same format as
https://github.com/etcd-io/etcd/releases compared to k8s.gcr.io which
modifies the canonical version tag by dropping the "v" prefix.

Story: 2007475
Task: 39184

Change-Id: If44eb55a68c13f8e1706242c099578ed1f264d62
2020-04-01 08:21:17 +00:00
Feilong Wang 735fadf53c Support TimeoutStartSec for etcd and heat agent systemd services
Now Magnum is using podman and systemd to manage the etcd service
and start heat-container-agent. In cases where the nodes pull images
from docker.io or another mirror registry with high latency, the etcd
or heat container agent service take long time to start, which is
causing timeout when bootstraping k8s cluster for fedora atomic/coreos
drivers. This patch fixes it by adding TimeoutStartSec for the systemd
services.

Task: 37452
Story: 2006459

Change-Id: I89855983f45544f202fc94ede396d1b0c44d286e
2019-11-21 21:16:05 +00:00
Spyros Trigazis aa6b3bbeba k8s_fedora: Add use_podman label
Choose whether system containers etcd, kubernetes and the heat-agent will be
installed with podman or atomic. This label is relevant for k8s_fedora drivers.

k8s_fedora_atomic_v1 defaults to use_podman=false, meaning atomic will be used
pulling containers from docker.io/openstackmagnum. use_podman=true is accepted
as well, which will pull containers by k8s.gcr.io.

k8s_fedora_coreos_v1 defaults and accepts only use_podman=true.

Fix upgrade for k8s_fedora_coreos_v1 and magnum-cordon systemd unit.

Task: 37242
Story: 2005201

Change-Id: I0d5e4e059cd4f0458746df7c09d2fd47c389c6a0
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
2019-10-23 10:43:52 +00:00
Spyros Trigazis 3674b3617a k8s_atomic: Run all syscontainer with podman
Using the atomic cli to install kubelet breaks mount
propagation of secrets, configmaps and so on. Using podman
in a systemd unit works.

Additionally, with this change all atomic commands are dropped,
containers are pulled from gcr.io (ofiicial kubernetes containers).

Finally, after this patch only by starting the heat-agent with
ignition, we can use fedora coreos as a drop-in replacement.

* Drop del of docker0
  This command to remove docker0 is carried from
  earlier versions of docker. This is not an issue
  anymore.

story: 2006459
task: 36871

Change-Id: I2ed8e02f5295e48d371ac9e1aff2ad5d30d0c2bd
Signed-off-by: Spyros Trigazis <spyridon.trigazi@cern.ch>
2019-10-08 09:14:36 +00:00
Zuul c1c5f2963d Merge "Revert "support http/https proxy for discovery url"" 2019-06-24 23:09:48 +00:00
Feilong Wang 05c27f2d73 [k8s][fedora atomic] Rolling upgrade support
Rolling ugprade is an important feature for a managed k8s service,
at this stage, two user cases will be covered:

1. Upgrade base operating system
2. Upgrade k8s version

Known limitation: When doing operating system upgrade, there is no
chance to call kubectl drain to evict pods on that node.

Task: 30185
Story: 2002210

Change-Id: Ibbed59bc135969174a20e5243ff8464908801a23
2019-06-07 14:48:08 +12:00
Jonathan Rosser 79699f23cd Revert "support http/https proxy for discovery url"
This reverts commit e8d0ee1b14.

This commit is reverted for two reasons:

* It is undesirable that the end user can inject proxy config into
  the magnum-conductor service via the cluster template.

* The proxy settings for the magnum-conductor service may not be
  the same as those which are required in the cluster template for
  the end user VM.

Systemd, docker and podman all include native mechanisms for setting
environment variables for proecesses, and this should be used by the
cloud operator / deployment tooling to configure the required proxy
settings for the magnum-conductor service.

In particular this patch makes it impossible for the cloud operator
to specify their own http_proxy via the environment, the user supplied
cluster template setting will always be used.

Change-Id: I33da19ad6764bedcf15f2a08381063e2471f8991
2019-05-21 10:30:49 +01:00
Jonathan Rosser 2595fda3e3 Ensure http proxy environment is available during 'atomic install' for k8s
The scripts run by cloud-init for the master and minion nodes currently
write proxy environment variables into /bin/bashrc when they are defined.

These variables will only be introduced into the running environment
when a new bash shell is started. The /bin/sh used by the fragment
scripts will ignore /etc/bashrc, so the new shells invoked per fragment
will not have the http proxy variables present. This means that the
master/minion node deployment fails when behind an http proxy.

This patch adds explicit exports for HTTP_PROXY and HTTPS_PROXY when those
variables are defined, and not empty.

Task: 29863
Change-Id: Id05c90d5bf99d720ae6002b38d3291e364e1e0c4
2019-03-07 22:16:38 +00:00
Guang Yee ffc61816c8 support http/https proxy for discovery url
HTTP(S) proxy can be specified when creating the template.

https://docs.openstack.org/magnum/latest/admin/magnum-proxy.html

However, it is not being utilized when talking to a public etcd discovery
service, which result in failed cluster creation. We need to be able to
use HTTP(S) proxy when services are running behind a firewall.

Change-Id: I13d86b0dc7c232a51149107f0412219388d8c2cd
story: 2004664
2019-01-02 13:17:10 -08:00
Lingxian Kong cae7fa21b6 [k8s] Cluster creation speedup
- Start workers as soon as the master VM is created, rather than
  waiting all the services ready.
- Move all the SoftwareDeployment outside of kubemaster stack.
- Tweak the scripts in SoftwareDeployment so that they can be combined
  into a single script.

Story: 2004573
Task: 28347
Change-Id: Ie48861253615c8f60b34a2c1e9ad6b91d3ae685e
Co-Authored-By: Lingxian Kong <anlin.kong@gmail.com>
2018-12-15 11:59:57 +00:00
Spyros Trigazis a1fb448c3a k8s_fedora: Explicitly set etcd authentication
Set client and peer auth to true and add
trusted_ca configuration to enable authentication
via certs for both clients and other etcd members.

Change-Id: I1d0fbd6f89dc2e95e016299c5ce0c68eb4fe8e1a
Closes-Bug: #1759813
2018-03-29 11:36:26 +00:00
Spyros Trigazis d95ba4d1ff Run etcd and flanneld in a system container
In Fedora Atomic 27 etcd and flanneld are removed from the base image.
Install them as a system containers.

* update docker-storage configuration
* add etcd and flannel tags as labels

Change-Id: I2103c7c3d50f4b68ddc11abff72bc9e3f22839f3
Closes-Bug: #1735381
2018-02-22 12:30:27 +00:00
Mathieu Velten 4a39ad699b Move all kubernetes files in /etc/kubernetes
Kubernetes uses cetificates, kubeconfig and the kubernetes openstack
cloud provider configuration from /srv/kubernetes and /etc/sysconfig.

The upstream kubernetes system containers used with atomic hosts
mounts /etc/kubernetes, we can unify the location of all kubernetes
configuration and also be able to use the upstream containers
unmodified.

Implements: blueprint run-kube-as-container

Change-Id: I9b2da390745836d9a66b7c8fc995a35cb74993e9
2017-07-26 10:51:27 +02:00
Ricardo Rocha 2875c97bff k8s-fedora: Add etcd_volume_size label
Allow setting the size of a volume for etcd storage.

Default is 0 which matches the current behavior - no persistency.

Related-Bug: #1697655

Change-Id: I8a30df63684133a902ae209ba6c124da2a567d3f
2017-07-05 11:54:31 +00:00
yatin e904a8af5c [k8s_fedora_atomic] Enable TLS in Etcd cluster
With this patch following are done:-
- Configure Etcd with TLS support

Configure Following to commuicate with TLS enabled Etcd:-
- Flannel

Etcd also listens at http://127.0.0.1:2379, so on master nodes
etcdctl and kube apiserver can communicate without using
certificates.

if TLS_DISABLED="True" then TLS is not enabled for etcd.

Change-Id: I2147b67c4e346a4415e1f76c19ac68e94cb0a0fa
Partially-Implements: blueprint secure-etcd-cluster-coe
2016-12-09 02:57:07 +00:00
Dirk Mueller 80fc5a2d42 Add bashate checks to pep8 step
Similarly to pep8 checks, this allows enforcing a consistent
style of the shell scripts accross modfications. For now
only the indentation is enforced to reduce code churn.

Closes-Bug: 1648099
Change-Id: Ie66cbe1aea4bd01a8bba8833ef6cbd2cff6a7c6a
2016-12-07 15:25:41 +01:00
Spyros Trigazis 2c635692ae Split k8s atomic vm and ironic drivers
The 2 k8s atomic drivers we currently support are added to the
same driver. This breaks ironic support with the stevedore
work I'm currently doing.

With stevedore, we can choose only one driver based on the
server_type, os and coe. We won't be able to pick a driver and
then choose an implementation bases on server_type.

Partially-Implements: blueprint magnum-baremetal-full-support
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
Change-Id: Ic1b8103551f48f85baa2ed9ff32d5b70b1fab84e
2016-09-09 18:10:08 +02:00