Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MANOPD-86292 Remove flannel and haproxy-ingress-controller plugins #393

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 8 additions & 130 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ This section provides information about the inventory, features, and steps for i
- [Plugins](#plugins)
- [Predefined Plugins](#predefined-plugins)
- [calico](#calico)
- [flannel](#flannel)
- [nginx-ingress-controller](#nginx-ingress-controller)
- [haproxy-ingress-controller](#haproxy-ingress-controller)
- [kubernetes-dashboard](#kubernetes-dashboard)
- [local-path-provisioner](#local-path-provisioner)
- [Plugins Features](#plugins-features)
Expand Down Expand Up @@ -468,7 +466,7 @@ services:

#### Plugins Deployment with Node Taints

The plugins also require the tolerations section in case of node taints. The Calico and Flannel pods already have tolerations to be assigned to all the cluster nodes. But for other plugins, it should be set in cluster.yaml. For more information, see [Tolerations](#tolerations).
The plugins also require the tolerations section in case of node taints. The Calico pods already have tolerations to be assigned to all the cluster nodes. But for other plugins, it should be set in cluster.yaml. For more information, see [Tolerations](#tolerations).

If you create your own plugins, the tolerations settings should be taken into account.

Expand Down Expand Up @@ -3347,7 +3345,7 @@ There are three parts of PSS configuration.
* default profile is described in the `defaults` section and `enforce` defines the policy standard that enforces the pods
* `exemptions` describes exemptions from default rules

The PSS enabling requires special labels for plugin namespaces such as `nginx-ingress-controller`, `haproxy-ingress-controller`, `kubernetes-dashboard`, and `local-path-provisioner`. For instance:
The PSS enabling requires special labels for plugin namespaces such as `nginx-ingress-controller`, `kubernetes-dashboard`, and `local-path-provisioner`. For instance:

```yaml
apiVersion: v1
Expand Down Expand Up @@ -3462,10 +3460,8 @@ When you want to install a plugin, the installer includes pre-configured plug-in

* Network plugins
* [calico](#calico)
* [flannel](#flannel)
* Ingress Controllers
* [nginx-ingress-controller](#nginx-ingress-controller)
* [haproxy-ingress-controller](#haproxy-ingress-controller)
* [kubernetes-dashboard](#kubernetes-dashboard)
* [local-path-provisioner](#local-path-provisioner)

Expand Down Expand Up @@ -3651,44 +3647,6 @@ plugins:

For more information about the supported Calico environment variables, refer to the official Calico documentation at [https://docs.projectcalico.org/reference/node/configuration](https://docs.projectcalico.org/reference/node/configuration).

##### flannel

Before proceeding, refer to the [Official Documentation of the Kubernetes Cluster Network](https://kubernetes.io/docs/concepts/cluster-administration/networking/).

**Warning**: This plugin is experimental. It is not recommended to use it in production.

Flannel plugin is not installed by default. However, it is possible to explicitly enable or disable the installation of this plugin through the `install` plugin parameter.

The following is an example to enable the plugin:

```yaml
plugins:
flannel:
install: true
```

If you explicitly enable Flannel plugin and do not enable Calico plugin, then only Flannel plugin is installed, and Calico plugin is not installed by default.

After applying the plugin configurations, the plugin installation procedure waits for the following pods to be in the `Running` state:
* coredns
* kube-flannel-ds-amd64

If the pods do not have time to start at a specific timeout, then the plugin configuration is incorrect. In this case, the installation is aborted.

By default, no additional settings are required for the plugin. However, you can change the default settings. To do this, in the `plugins` section of the config file, specify the `flannel` plugin section and list all the necessary parameters and their values ​​in it.
For example:

```yaml
plugins:
flannel:
install: true
image: quay.io/coreos/flannel:v0.11.0-amd64
```

An example is also available in [Full Inventory Example](../examples/cluster.yaml/full-cluster.yaml).

The plugin configuration supports the `image` parameter. The `image` parameter specifies the string for the Flannel image. The default value is `quay.io/coreos/flannel:v0.11.0-amd64`.

##### nginx-ingress-controller

Before proceeding, refer to the [Official Documentation of the Kubernetes Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) and visit [official Nginx Ingress Controller repository](https://github.com/nginxinc/kubernetes-ingress).
Expand Down Expand Up @@ -3789,50 +3747,6 @@ For example:
###### monitoring
By default 10254 port is opened and provides Prometheus metrics.

##### haproxy-ingress-controller

Before proceeding, refer to the [Official Documentation of the Kubernetes Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) and visit [official HAProxy Ingress Controller repository](https://github.com/haproxytech/kubernetes-ingress).

**Warning**: This plugin is experimental. It is not recommended to use it in production.

HAProxy Ingress Controller plugin is not installed by default. However, you can explicitly enable or disable the installation of this plugin through the `install` plugin parameter.

The following is an example to enable the plugin:

```yaml
plugins:
haproxy-ingress-controller:
install: true
```

If you explicitly enable HAProxy Ingress Controller plugin, but do not enable NGINX Ingress Controller plugin, then only HAProxy plugin is installed, and NGINX plugin is not installed by default.

After applying the plugin configurations, the plugin installation procedure waits for `haproxy-ingress` pod to be in the `Running` state.

If the pods do not have time to start at a specific timeout, then the plugin configuration is incorrect. In this case, the installation is aborted.

By default, no additional settings are required for the plugin. However, you can change the default settings. To do this, in the `plugins` section of the config file, specify the `haproxy-ingress-controller` plugin section and list all the necessary parameters and their values ​​in it.
For example:

```yaml
plugins:
flannel:
install: true
controller:
image: haproxytech/kubernetes-ingress:1.2.7
backend:
image: k8s.gcr.io/defaultbackend:1.0
```

An example is also available in [Full Inventory Example](../examples/cluster.yaml/full-cluster.yaml).

The plugin configuration supports the following parameters:

|Name|Type|Default Value|Value Rules|Description|
|---|---|---|---|---|
|controller.image|string|`haproxytech/kubernetes-ingress:1.2.7`| |HAProxy Ingress Controller image|
|backend.image|string|`k8s.gcr.io/defaultbackend:1.0`| |Default Backend image for HAProxy Ingress Controller|

##### kubernetes-dashboard

Before proceeding, refer to the [Official Documentation of the Kubernetes Dashboard UI](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) and visit [official Kubernetes Dashboard repository](https://github.com/kubernetes/dashboard).
Expand Down Expand Up @@ -4064,10 +3978,9 @@ Plugins are installed in a strict sequential order. The installation sequence is
|Plugin|Priority|
|---|---|
|calico|`0`|
|flannel|`0`|
|nginx-ingress-controller|`1`|
|haproxy-ingress-controller|`1`|
|kubernetes-dashboard|`2`|
|local-path-provisioner|`2`|

You can change the priorities of preinstalled plugins, as well as set your own priority for the custom plugins.
The following is an example of how to prioritize a plugin:
Expand Down Expand Up @@ -4101,12 +4014,6 @@ The following table contains details about existing nodeSelector configuration o
<td><code>kubernetes.io/os: linux</code></td>
<td>nodeSelector applicable only for calico <b>typha</b> <br> and calico <b>kube-controllers</b> containers, <br> but not for ordinary calico containers, <br> which should be deployed on all nodes</td>
</tr>
<tr>
<td>flannel</td>
<td>-</td>
<td>-</td>
<td>It is not possible to configure nodeSelector for flannel <br> since flannel containers should run on all nodes</td>
</tr>
<tr>
<td>nginx-ingress-controller</td>
<td><code>controller.nodeSelector</code></td>
Expand All @@ -4115,17 +4022,6 @@ The following table contains details about existing nodeSelector configuration o
</td>
<td></td>
</tr>
<tr>
<td>haproxy-ingress-controller</td>
<td><ul>
<li><code>controller.nodeSelector</code></li>
<li><code>backend.nodeSelector</code></li>
</ul></td>
<td>
<code>kubernetes.io/os: linux</code><br>
</td>
<td></td>
</tr>
<tr>
<td>kubernetes-dashboard</td>
<td><ul>
Expand Down Expand Up @@ -4177,30 +4073,12 @@ The following table contains details about existing tolerations configuration op
</td>
<td>tolerations are not configurable for network plugins</td>
</tr>
<tr>
<td>flannel</td>
<td>-</td>
<td>
<code>- effect: NoSchedule</code><br>
<code> operator: Exists</code>
</td>
<td>tolerations are not configurable for network plugins</td>
</tr>
<tr>
<td>nginx-ingress-controller</td>
<td><ul><li><code>controller.tolerations</code></li></ul></td>
<td>none</td>
<td></td>
</tr>
<tr>
<td>haproxy-ingress-controller</td>
<td><ul>
<li><code>controller.tolerations</code></li>
<li><code>backend.tolerations</code></li>
</ul></td>
<td>node</td>
<td></td>
</tr>
<tr>
<td>kubernetes-dashboard</td>
<td><ul>
Expand Down Expand Up @@ -4502,15 +4380,15 @@ For example:

```yaml
plugins:
haproxy-ingress-controller:
nginx-ingress-controller:
installation:
procedures:
- python:
module: /var/data/plugins/ingress_controller.py
method: override_priviledged_ports
module: plugins/builtin.py
method: apply_yaml
arguments:
service: haproxy-ingress
namespace: haproxy-controller
plugin_name: nginx-ingress-controller
original_yaml_path: plugins/yaml/nginx-ingress-controller-{{ plugins.nginx-ingress-controller.version }}-original.yaml
```

##### thirdparty
Expand Down
19 changes: 0 additions & 19 deletions examples/cluster.yaml/full-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,6 @@ plugins:
flexvol:
image: calico/pod2daemon-flexvol:v3.10.1

flannel:
install: false
installation:
priority: 0
image: quay.io/coreos/flannel:v0.11.0-amd64

nginx-ingress-controller:
install: true
installation:
Expand All @@ -403,19 +397,6 @@ plugins:
nodeSelector:
kubernetes.io/os: linux

haproxy-ingress-controller:
install: false
installation:
priority: 1
controller:
image: haproxytech/kubernetes-ingress:1.2.7
nodeSelector:
kubernetes.io/os: linux
backend:
image: k8s.gcr.io/defaultbackend:1.0
nodeSelector:
kubernetes.io/os: linux

kubernetes-dashboard:
install: true
installation:
Expand Down
1 change: 0 additions & 1 deletion kubemarine.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ a = Analysis(['./kubemarine/__main__.py'],
'kubemarine.plugins.builtin',
'kubemarine.plugins.calico',
'kubemarine.plugins.nginx_ingress',
'kubemarine.plugins.haproxy_ingress',
'kubemarine.plugins.kubernetes_dashboard',
'kubemarine.core.schema'
],
Expand Down
3 changes: 1 addition & 2 deletions kubemarine/admission.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@

baseline_plugins = {"kubernetes-dashboard": "kubernetes-dashboard"}
privileged_plugins = {"nginx-ingress-controller": "ingress-nginx",
"local-path-provisioner": "local-path-storage",
"haproxy-ingress-controller": "haproxy-controller"}
"local-path-provisioner": "local-path-storage"}

loaded_oob_policies = {}

Expand Down
1 change: 0 additions & 1 deletion kubemarine/core/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"kubemarine.kubernetes.enrich_inventory",
"kubemarine.admission.enrich_inventory",
"kubemarine.kubernetes_accounts.enrich_inventory",
"kubemarine.plugins.calico.enrich_inventory",
"kubemarine.plugins.nginx_ingress.cert_renew_enrichment",
"kubemarine.plugins.nginx_ingress.enrich_inventory",
"kubemarine.core.defaults.calculate_nodegroups",
Expand Down
17 changes: 0 additions & 17 deletions kubemarine/plugins/calico.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@
from kubemarine.plugins.manifest import Processor, EnrichmentFunction, Manifest


def enrich_inventory(inventory, cluster):

# By default, we use calico, but have to find it out
# First of all we have to check is Calicon set to be installed or not
# By default installation parameter is unset, means user did not make any decision
if inventory["plugins"]["calico"].get("install") is None:
# Is user defined Flannel plugin and set it to install?
flannel_required = inventory["plugins"].get("flannel", {}).get("install", False)
# Is user defined Canal plugin and set it to install?
canal_required = inventory["plugins"].get("canal", {}).get("install", False)
# If Flannel and Canal is unset or not required to install, then install Calico
if not flannel_required and not canal_required:
inventory["plugins"]["calico"]["install"] = True

return inventory


# DEPRECATED
def apply_calico_yaml(cluster: KubernetesCluster, calico_original_yaml: str, calico_yaml: str):
"""
Expand Down
28 changes: 0 additions & 28 deletions kubemarine/plugins/haproxy_ingress.py

This file was deleted.

37 changes: 1 addition & 36 deletions kubemarine/resources/configurations/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ plugins:

calico:
version: '{{ globals.compatibility_map.software["calico"][services.kubeadm.kubernetesVersion|minorversion].version }}'
install: true
installation:
priority: 0
procedures:
Expand Down Expand Up @@ -527,17 +528,6 @@ plugins:
flexvol:
image: 'calico/pod2daemon-flexvol:{{ plugins.calico.version }}'

flannel:
installation:
priority: 0
procedures:
- template: templates/plugins/flannel.yaml.j2
- expect:
pods:
- coredns
- kube-flannel-ds-amd64
image: quay.io/coreos/flannel:v0.11.0-amd64

nginx-ingress-controller:
version: '{{ globals.compatibility_map.software["nginx-ingress-controller"][services.kubeadm.kubernetesVersion|minorversion].version }}'
install: true
Expand Down Expand Up @@ -583,31 +573,6 @@ plugins:
containerPort: 8443
protocol: TCP

# TODO: support hostPort for haproxy-ingress
haproxy-ingress-controller:
install: false
installation:
priority: 1
procedures:
- template: templates/plugins/haproxy-ingress-controller.yaml.j2
- expect:
pods:
- haproxy-ingress
- python:
module: plugins/haproxy_ingress.py
method: override_priviledged_ports
arguments:
service: haproxy-ingress
namespace: haproxy-controller
controller:
image: haproxytech/kubernetes-ingress:1.2.7
nodeSelector:
kubernetes.io/os: linux
backend:
image: k8s.gcr.io/defaultbackend:1.0
nodeSelector:
kubernetes.io/os: linux

kubernetes-dashboard:
version: '{{ globals.compatibility_map.software["kubernetes-dashboard"][services.kubeadm.kubernetesVersion|minorversion].version }}'
install: false
Expand Down
Loading