Commit Graph

159 Commits

Author SHA1 Message Date
Michal Nasiadka 5c0c27807a Drop k8s_coreos_v1 driver
Change-Id: I64884677cf05c59c64988dfbee9bf22e97a3466b
2024-02-05 07:04:05 +00:00
ricolin eca79453c0 Fix Trust token scope for drivers
This fix driver token scope to make sure we use correct token
scope from Trust.

Change-Id: If5b31951959c7a141dc1cae5fefcabe4ebf438b3
2023-07-25 17:00:40 +08:00
Travis Holton e4e0843ed1 Remove stdout argument from coredns log
According to the documentation the first argument to log is either a
domain or a '.' (dot). The current setting of 'log stdout' appears to
blackhole query logs. The default output of log is stdout so the
argument would not be necessary.

Removing `stdout` allows coredns to send query logs to stdout.

Reference: https://coredns.io/plugins/log/

Change-Id: I7837015c37eb58ba43ff42cc8b647c717fa1c650
2022-10-26 16:31:03 +13:00
Trung Nguyen Van 0e964f8f7d Remove duplicated etcd_volume_size param in coreos template
Change-Id: I161b0af3ef7fbf3f81ece9a4a5689ec84d8b715d
2020-08-19 13:37:45 +07:00
Feilong Wang 001b9c6101 Fix label fixed_network_cidr
Now the label `fixed_network_cidr` is not handled correctly, no matter
if the label is set, the default value '10.0.0.0/24' is used for
fixed network anyway. This patch fixes it and renamed it as
`fixed_subnet_cidr` to make less confusion. The new behaviour will be:
1. If the label `fixed_subnet_cidr` is set but no fixed subnet passed
   in, then a new subnet will be created with the given CIDR.
2. If a fixed subnet is passed in by user, then label `fixed_subnet_cidr`
   will be override with the CIDR from the given subnet.

Task: 39847
Story: 2007712

Change-Id: Id05e36696bf85297a556fcd959ed897fe47b7354
2020-06-11 13:54:59 +12:00
Feilong Wang d342fc0ad9 Update default calico_ipv4pool
The current default Calico IPv4 CIDR 192.168.0.0/16  is too common and 
it has bring us some IP conflicts troubles on production. This patch is
proposing to replace it with a rare CIDR range.

Task: 39052
Story: 2007426

Change-Id: I13aa0c58bf168bc069edf1d5c0187f89011fffdb
2020-03-16 22:33:10 +00:00
Theodoros Tsioutsias 113fdc44b2 ng-12: Label nodegroup nodes
With this change each node will be labeled with the following:
* --node-labels=magnum.openstack.org/role=${NODEGROUP_ROLE}
* --node-labels=magnum.openstack.org/nodegroup=${NODEGROUP_NAME}

Change-Id: Ic410a059b19a1252cdf6eed786964c5c7b03d01c
2019-10-16 11:53:44 +00:00
Theodoros Tsioutsias 44631afbbf ng-10: Fix cluster template conditions
Removes the role heat param from all templates. Instead and only for
k8s templates adds the master_role and worker_role params. The new
worker_only condition should be true for all roles except for master.
Finally, adds the missing is_cluster_stack param to all templates.

Change-Id: Ie0799373fe492c2e0a0cad903ed6e8c93e6266b5
2019-10-16 11:53:44 +00:00
Peter Pouliot 7dc4c7d904 Fixing typos and spelling errors in driver template files
* Changing the reference to 'Atomic' in the k8s_coreos_v1 driver
  to 'Container Linux'
* Changing a misspelled 'mater' to 'master'
  in swarm_fedora_atomic_v1/templates/swarmmaster.yaml description
* Changing a misspelled 'mater' to 'master' in
  swarm_fedora_atomic_v1/templates/swarmmaster.yaml description

Change-Id: I69a31d2b91fed48f07f649fa876e208e268fb339
2019-10-10 22:18:58 -04:00
Spyros Trigazis 2f72fdfbf6 Pass ssh public key as string
* Fedora CoreOS need the key to be passed as
  a string.
* We can adopt in all drivers so that users in
  the same project can do cluster resize.

story: 2005201
task: 36934

Change-Id: I9a18ce4dcbd74f0dcd23274baed7c8c3d2029d50
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
2019-10-08 07:56:52 +00:00
Ricardo Rocha 23c85bf040 Drop deprecated APIs for kube v1.16 support
Kubernetes v1.16 is dropping support for beta extensions/apps APIs for
Deployment, DaemonSet and ReplicaSet - as described in:
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.15.md#deprecations-and-removals

Replace all occurrences with apps/v1.

Change-Id: Ib1d8b7672318538be7f0066832add29f7d066b92
Story: 2006459
Task: 36385
2019-10-01 17:49:23 +02:00
Theodoros Tsioutsias d4a52719f1 ng-7: Adapt parameter and output mappings
With this change parameter and output mappings can support multiple
stacks.

Change-Id: I45cf765977c7f5a92f28ae12c469b98435763163
2019-09-26 08:45:51 +00:00
Zuul 83569e8394 Merge "calico: drop calico_cni_tag" 2019-09-20 11:08:53 +00:00
Zuul 04fd0470ad Merge "k8s: stop introspecting instance name" 2019-08-08 19:50:58 +00:00
Mohammed Naser 2f2d05c826 k8s: stop introspecting instance name
We kept introspecting the name of the instance with the assumption
that the network always existed under .novalocal

This is not always the case, with certain variables changed inside
Neutron it is possible to control this, therefore, leading in failing
deploys.

With this change, we pass the instance name directly to the cluster
and therefore we always have the accurate name.

Task: 36160
Story: 2006371

Change-Id: I2ba32844b822ffc14da043e6ef7d071bb62a22ee
2019-08-07 21:24:06 +00:00
Mohammed Naser b5d50ddd89 k8s: refactor functions into KubernetesDriver
We currently have a lot of duplicate functions across our drivers
which use Kubernetes.  This takes them and brings them into a
common class called KubernetesDriver and cleans up the subclasses.

Change-Id: I6f880cb03ed43ec3bc9d3d9e5a7b87eaceda40e9
2019-06-24 16:33:06 -04:00
Mohammed Naser cd26be16c6 calico: drop calico_cni_tag
This variable was not being used anywhere so it was an extra
parameter that served no purpose.

Change-Id: I7ae84ab6683530d95a8bca51487558b381f9cef2
2019-06-18 16:36:22 -04:00
Spyros Trigazis (strigazi) 9b1bd5da54 Add cluster upgrade to the API
To enable the rolling upgrade ability of Kubernetes Cluster, this
patch is proposing a new API /upgrade to support upgrade the
base operating system of nodes and the version of Kubernetes, even
add-ons running on the k8s cluster:

POST <ClusterID>/actions/upgrade

And the post body will be:

{
    "cluster_template": 'dd9cc5ed-3a2b-11e9-9233-fa163e46bcc2',
    "max_batch_size": 1,
    "nodegroup": "production_group"
}

Co-Authored-By: Feilong Wang <flwang@catalyst.net.nz>

Task: 30168
Story: 2002210

Change-Id: Ia168877778aa0d473383eb06b1c8a16dc06b0576
2019-06-07 12:01:10 +12:00
Spyros Trigazis 8fb27da2fc Update coredns from upstream manifest and to 1.3.1
5fe683c057/kubernetes/coredns.yaml.sed

story: 2003993
task: 30493

Change-Id: I0b0b4f98c20748c37c2d2f498ced222a53b52214
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
2019-04-18 12:38:58 +02:00
huang.xiangdong 3cb6226ff0 Support multi DNS server
Using comma delimited ipv4 address list to specify multi dns server
"8.8.8.8,114.114.114.114".

Task: 29465
Story: 2004994

Change-Id: I031247b0cc2ae417f18b2a5b9b3832e78ed9dafd
2019-04-08 23:08:45 +00:00
Lingxian Kong c47fde0cbe Improve floating IP allocation
- Never allocate floating IP for etcd service.
- Introduce a new label `master_lb_floating_ip_enabled` which controls
  if Magnum allocates floating IP for the master load balancer. This
  label only takes effect when the `master_lb_enabled` is set. The
  default value is the same with `floating_ip_enabled`.
- The `floating_ip_enabled` property now only controls if Magnum
  should allocate the floating IPs for the master and worker nodes.

Change-Id: I0a232406deaf112b0cb9e445735d7b49206c676d
Story: #2005153
Task: #29868
2019-03-20 18:44:45 +13:00
Zuul 07e48a1ed5 Merge "Add server group for cluster worker nodes" 2019-02-27 12:32:47 +00:00
Feilong Wang 20d03919fb Return instance ID of worker node
Return the nova instance UUID of worker nodes in kubeminion
templates. We will be able to remove resources from the
ResourceGroups based on nova instance uuid.

Backstory:
In heat a ResourceGroup creates a stack of depth 2. ResourceGroups
support removal policies to declare which resources must be removed.
This can be done by passing the index of the resource or the stack_id
of the nested stack. If a stack update call receives a list of
indices (eg [0, 5, 3]) or nested stack uuid (eg [uuidA, uuidB]), it
will remove the corresponding nested stacks.

In magnum's heat templates, a nested stack logically represents a
nova compute instance which is a cluster node. Using composition in
heat, we can change the way a resources group references the nested
stacks. This proposes to use the nova instance uuid as
'OS::stack_id'.

With this change, an external consumer of the stack (the cluster
autoscaler or an actual user) can remove resources from the
ResourceGroup using the nova instance uuid or resource index. Without
this change, a user or system  (which typically knows the name,
server uuid or ip) would have to find in which nested stack a
kubernetes node belongs too.  Resulting multiple call to heat.

The end result of this patch can be verified like this:
nested_stack_id=$(openstack stack resource show <STACK_ID_OR_NAME> kube_minions -c physical_resource_id -f value)
openstack stack show "${nested_stack_id}"

Task: 29664
Story: 2005054

Change-Id: I6d776f62d640c72b3228460392b92df94fe56fe6
2019-02-27 10:46:41 +01:00
Feilong Wang 4f84c849f6 Add server group for cluster worker nodes
Now Magnums onlys has one server group for all master and worker nodes
per cluster, which is not very flexible for small cloud scale. For a
3+ master clusters, it's easily meeting the capacity when using hard
anti-affinity policy. This patch is proposing one server group for each
master and worker nodes group to have better flexibility.

story: 2004195

Change-Id: If11ba863a2aa538efe1e3e850084bdd33afd27d2
2019-02-27 09:09:20 +00:00
leledashenqi 26c28a03d2 Change docker image pulling policy from Always to IfNotPresent
Do not repeat pulling images when container recreate in magnum cluster.

Change-Id: Iaa618309375cf17d6511ae371a6a15a3345d4d6d
Story:2004644
Task:28595
2018-12-20 09:21:58 +08:00
Jim Bach 8f4643d85c Make providing a keypair optional
A user may not rely on nova-keypairs to access their cluster
such as a preconfigured SSSD.

story: 2004402
task: 28035

Change-Id: I77fbdc174d3dddfd312fb8dac20516314d4c182e
2018-11-21 16:17:46 +00:00
Zuul d9a43d87d0 Merge "Fixing CoreOS driver" 2018-09-04 11:08:33 +00:00
Rick Cano 419a228503 Fixing CoreOS driver
Decoding ca on nodes

Change-Id: I4a30a348c1c0a62cb1a7b429b05878f321db92ed
2018-08-22 12:58:27 -04:00
Farid Da Encarnacao d417395e0a Add etcd_volume_size parameter in coreos template
Without those fixes new cluster fails with message:
ERROR: The Parameter (etcd_volume_size) was not defined in template.

Task: 1722523
Story: 20337

Change-Id: Ie38c9e010b61fafeda51ae8dccba94b6ed743f1d
2018-07-19 15:53:55 +00:00
Lingxian Kong 2cc57c5386 Use Octavia for LoadBalancer type service
In the OpenStack deployment with Octavia service enabled, the octavia
service should be used not only for master nodes high availability, but
also for k8s LoadBalancer type service implementation as well.

Change-Id: Ib61f59507510253794a4780a91e49aa6682c8039
Closes-Bug: #1770133
2018-05-30 15:36:24 +12:00
Spyros Trigazis 30785acd3c Update kubernetes dashboard to v1.8.3
Add the RBAC enabled kubernetes-dashboard with
version v1.8.3.

Related-Bug: #1680900
Change-Id: I68a17d22dda9661c81f40bcc9db06f7456790958
2018-02-23 09:42:44 +13:00
Spyros Trigazis 1eb9bf16f5 kuberntes: Disable the scale_manager for scale down
Due to bug #1746510, the kubernetes scale manager needs to be
disabled to not break the scale down command completely. Note, that when
magnum scales down the cluster will pick the nodes to scale randomly.

Related-Bug: #1746510
Change-Id: I8c3505ec6d155323288217e0c8ea54adabdff1c3
2018-02-22 17:14:45 +00:00
Georgiy Kutsurua 0e95314964 Add missed space in k8s template file
Add missed space in k8s coreos v1 drive's file.

Change-Id: Ib1143ff495f58a443d526e6fad86a1257f6d8471
Closes-Bug: #1749956
Signed-off-by: Georgiy Kutsurua <g.kutsurua@gmail.com>
2018-02-16 17:35:21 +04:00
Feilong Wang be0609ce88 Support soft-anti-affinity policy for nodes
Currently, there is no guarantee to make sure all nodes of one cluster are
created on different compute hosts. So it would be nice if we can create
a server group and set it with anti-affinity policy to get a better HA
for cluster. This patch is proposing to create a server group for master
and minion nodes with soft-anti-affinity policy by default.

Closes-Bug: #1737802

Change-Id: Icc7a73ef55296a58bf00719ca4d1cdcc304fab86
2018-01-24 07:13:48 +13:00
Spyros Trigazis 65dfb2009f Add openstack_ca_file configuration option
In the drivers section of magnum.conf add openstack_ca_file.
This file is expected to be a CA Certificate OR CA bundle
which will be passed on every node and it will be installed
on the host's CA bundle.

Update devstack plugin to use the ssl bundle if tls-proxy is
enabled.

Install the CA for drivers:
k8s_coreos_v1
k8s_fedora_atomic_v1
k8s_fedora_ironic_v1
mesos_ubuntu_v1
swarm_fedora_atomic_v1
swarm_fedora_atomic_v2

Add doc in troubleshooting-guide.

Add release notes.

Closes-Bug: #1580704
Partially-Implements: blueprint heat-agent
Change-Id: Id48fbea187da667a5e7334694c3ec17c8e2504db
2018-01-17 14:58:56 +00:00
Kirsten G b07b6f34d5 Add verify_ca configuration parameter
Added configuration parameter, verify_ca, to magnum.conf with default
value of True. This parameter is passed to the heat templates to
indicate whether the cluster nodes validate the Certificate Authority
when making requests to the OpenStack APIs (Keystone, Magnum, Heat).
This configuration parameter can be set to False to disable CA
validation.

Co-Authored-By: Vijendar Komalla <vijendar.komalla@rackspace.com>

Change-Id: Iab02cb1338b811dac0c147378dbd0e63c83f0413
Partial-Bug: #1663757
2017-11-21 10:25:32 -08:00
ArchiFleKs b5531ddb21 Add /etc/environment to flannel/etcd/kubelet
Everything is containerized in rkt. If behind proxy, flannel, etcd
and kubelet will failed to rkt fetch images and cluster creation
will failed.

Closes-Bug: #1689618
Change-Id: Ia12deeb659483980d2a20e4cba5d449167b600d0
2017-10-14 09:22:10 +05:30
Mohammed Naser 5153d912b2
Clean-up server names in drivers
The instance type of servers at the moment can become quite long
due to the Heat autogenerated names.  This patch cleans up the names
so that they are shorter yet contain all the info needed to be able
to know where they belong to.

Change-Id: I5bcbe73f08844242d049b8408221da40d22cd3dc
2017-08-13 14:03:55 -04:00
Ricardo Rocha 79039bb419 Allow docker_volume_size on cluster create
Add docker_volume_size as an option during cluster create. If not given,
the default is taken from the cluster template.

Add docker_volume_size in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1697648
Implements: blueprint flatten-attributes
Change-Id: Ic6d77e6fdf5b068fa5319b238f4fd98b4d499be4
2017-06-23 11:31:27 +00:00
Kevin Lefevre b23700ceb8 [k8s_coreos] use host-gw as flannel default driver
host-gw offer better performances out of the box. Allowed address pair
are automatically configured by Magnum.

Change-Id: I5fd18b8d6b76f6a5f73b13bc4cfd19e52c33791c
2017-05-24 09:14:21 +02:00
Kevin Lefevre ee1ac9a8e0 [k8s_coreos] update kubelet args
Update Kubelet deprecated variables and hostname

Change-Id: I9a8429fbd6cd18dcb0d0613474dce749149c63db
2017-05-24 09:14:21 +02:00
Kevin Lefevre 1260590b4e [k8s_coreos] enable CoreDNS addon
Enable option to specify a custom cluster domain name.
Enable Kubelet integration with DNS.

Change-Id: I76f837c950ab9111d5a43fa522829d5034cd5ee8
2017-05-24 09:14:06 +02:00
Kevin Lefevre c14f7d7c56 [k8s_coreos] update to etcdv3 and kube 1.6
Change-Id: I6314ca1483c85bfe8b4577449d4c2ed553be87d9
2017-05-18 16:15:33 +02:00
Jenkins 68f0a6c6d2 Merge "[k8s_coreos] Avoid regenerating certs on reboot" 2017-05-14 21:12:25 +00:00
Jenkins 0dee921e6e Merge "Enable custom keystone endpoint_type in templates" 2017-05-10 16:40:04 +00:00
ArchiFleKs 2b8e9859cd [k8s_coreos] Avoid regenerating certs on reboot
Change-Id: I2f37891e24abcf2c7f9022722663171aa9277fcc
Closes-Bug: #1687903
2017-05-03 19:16:22 +02:00
Kevin Lefevre 4c241a683f Enable custom keystone endpoint_type in templates
Allow to specify a custom AUTH_URL for the templates in case instances
cannot reach internalURL which is the case in mose deployment.

A new variable in trust section: trustee_keystone_interface which
default to public is introduced.

Change-Id: I2a908c0752387e4ff4ad2b0fdf0c1025a73ce806
Closes-Bug: #1643197
2017-05-01 18:15:58 +02:00
yatin 033c9a5775 [k8s_coreos] Add kubernetes dashboard
kubernetes dashboard [1] has lot of features and is actively
managed.
With this patch kubernetes dashboard is added and enabled in
k8s coreos cluster by default.

The kubernetes dashboard is enabled by default. To disable it, set the
label 'kube_dashboard_enabled' to False

Reference:
[1] https://github.com/kubernetes/dashboard

Implements: blueprint add-kube-dashboard
Change-Id: I9b001ec3c232aea2395df7d83c6ac991cbf5dea3
2017-05-01 14:16:53 +00:00
ArchiFleKs ecfe6ac183 Fix CoreOS multi master with LB cluster creation
Cluster that uses ETCD like swarm and K8s failed with LB and TLS enable
because ETCD LB protocol is HTTP but SSL termination in on the ETCD
node. ETCD LB protocol should be the same as K8s with TLS enable

Partial-Bug: #1679724

Change-Id: Ie8c8a7e4609c0e2e63095d4c18af84cc653654e1
2017-04-11 11:10:58 +02:00
ArchiFleKs ff18982505 Fix CoreOS cluster creation and heat notify
Also fix the label issue introduced with
https://review.openstack.org/#/c/426291/

Closes-Bug: #1679663

Change-Id: Ic1ca4ebef96a796f22acb06722f209477b7db934
2017-04-11 11:09:27 +02:00