80 Commits

Author SHA1 Message Date
Zuul
be4f324784 Merge "Add toleration to Nginx IC daemonset and job" 2021-10-04 12:21:03 +00:00
Bernardo Decco
9b2e8e25db Removing py36 gates from zuul for nginx-ingress-controller-armada-app
Removing redundant py36 Zuul jobs since we now have py39 Zuul jobs in
place with the debian nodeset

Story: 2006796
Task: 43491
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I1e1297e029741736cc355c472acc842270fccc97
2021-09-30 10:22:56 -03:00
Rafael Camargos
996cc3344a Add toleration to Nginx IC daemonset and job
A toleration needs to be added to all resources that create pods since
the node-role.kubernetes.io/master taint will be restored to all master
nodes. This ensures that the pods will run on the master node.

Tested in an AIO-SX by enabling the taint and:

- Deleting pods
- Performing an application update
- Removing and reinstalling the application
- Deleting the ValidatingWebhookConfiguration and reapplying the app

In every case mentioned the resources would come up again.

Story: 2009232
Task: 43343
Change-Id: Ide2ce4ac66f01da412822f6fc7d658da80de4f32
Signed-off-by: Rafael Camargos <RafaelLucas.Camargos@windriver.com>
2021-09-29 22:26:35 -03:00
Charles Short
c8b39d4538 Fix unit tests
Due to a recent change in fm-api's directory structure, unit tests would
fail since the virtualenv would not be able to find fm-api/setup.py.
Adjust the tox.ini to point to the correct directory. Tested locally
by running tox.ini.

Depends-On: https://review.opendev.org/c/starlingx/fault/+/806046

Story: 2009101
Task: 43091

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I2b3260d086fb84595de38d5d71be3a44f22d6fb3
2021-09-28 14:21:38 -04:00
Rafael Camargos
aff9091977 Recreate Nginx IC Admission Webhook during B&R
During backup it is required deleting the Nginx Ingress Controller
admission webhook configuration so that it doesn't block pods creation
during restore phase when the application is not fully up and running.

This is already being done automatically, but the webhook is not being
recreated.

The proposed solution is to use the lifecycle operator to set the nginx
ingress controller override and reapply the application, and with that
recreate the validating webhook after the backup and after the restore.

Note that if the validating webhook is not present before, it won't be
recreated. Also note that the override flag may be already populated
before, so this does a backup of it before setting a new value.

Tested on an AIO-SX by and backing up and restoring the system
(with and without the validating webhook).

Closes-Bug: 1943835
Depends-on: https://review.opendev.org/c/starlingx/config/+/810434
Change-Id: If477b41a2fc94d8aa4e8d820b42aeb5644312f78
Signed-off-by: Rafael Camargos <RafaelLucas.Camargos@windriver.com>
2021-09-23 13:58:03 -03:00
Zuul
a79525a12c Merge "Add pylint py3 portability checks for nginx repo" 2021-09-20 21:08:55 +00:00
Bernardo Decco
d95ae24f04 Add pylint py3 portability checks for nginx repo
A lot of work has gone into making sure that StarlingX is python3
compatible. To ensure future compatibility, enable the python3
portability checks. Disable the checks that are raising errors.
Another set of commits will address the offending code.

Add following suppress warnings in pylint.rc:
- W1618: no-absolute-import

Story: 2006796
Task: 43226
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I38b67515849b692e0b27cba217f2ef2eedc43940
2021-09-15 16:31:06 +00:00
Charles Short
1b47ceb2b6 Add python3.9 gate
Added python3.9 gate, tested by running tox locally and running
the zuul gate.

Story: 2009101
Task: 43162

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I4946d9b7b1657fc2e5b3657763ac0501d361892d
2021-09-09 17:19:23 +00:00
Charles Short
6eb29324ea Fix pylint gate
The pylint gate fails because the nodeset is not set,
set it to "ubuntu-xenial" since it runs on python2.7.

Story: 2009101
Task: 43164

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I79d97afa17866dd589176a5d6cbaaac49827bda9
2021-09-01 15:21:24 -04:00
Isac Souza
feaa276469 Migrate nginx overrides from old to new chart
Adds a lifecycle hook to migrate the user overrides
from the old chart name (nginx-ingress) into the new
one (ingress-nginx). The chart name was changed upstream
as part of a major refactor.

The lifecycle hook will listen to the pre apply event and
query the database for the overrides of the newest inactive
app (i.e. the previous version).
If it finds overrides and the version being installed do
not have overrides, the old ones will be migrated to the
new chart name.

Tested by performing an application-update from a version
before the chart name change to a version built with this hook.
Also tested a fresh install and upgrading from r4 to
master for SX and DX.

Closes-Bug: 1927003
Signed-off-by: Isac Souza <IsacSacchi.Souza@windriver.com>
Change-Id: Id328dd3bff79290d249d25e0875214c463cf76c1
2021-05-13 09:09:50 -03:00
Ghada Khalil
934fbfa82f Revert "Migrate nginx overrides from old to new chart"
This reverts commit 9189e5bc0ac06d44f0bda8ab70ba151b05349dca.

Reason for revert: Causes an ansible failure on fresh system install

Change-Id: I4f1263c2cf0957d3bb5e324b9ac7fdd8d5beda69
2021-05-11 01:24:00 +00:00
Isac Souza
9189e5bc0a Migrate nginx overrides from old to new chart
Adds a lifecycle hook to migrate the user overrides
from the old chart name (nginx-ingress) into the new
one (ingress-nginx). The chart name was changed upstream
as part of a major refactor.

The lifecycle hook will listen to the pre apply event and
query the database for the overrides of the newest inactive
app (i.e. the previous version).
If it finds overrides and the version being installed do
not have overrides, the old ones will be migrated to the
new chart name.

Tested by performing an application-update from a version
before the chart name change to a version built with this hook.
Also tested upgrading from r4 to master for SX and DX.

Closes-Bug: 1927003
Signed-off-by: Isac Souza <IsacSacchi.Souza@windriver.com>
Change-Id: I53083555868eac48143f4e744df73aa28ab03f85
2021-05-07 14:22:53 -03:00
Isac Souza
87dcbb336b Add boilerplate config for Zuul and unit tests
Adds the required configuration to run Zuul on
reviews, including flake8, pylint, bandit and
unit tests.

Tested by running tox locally.

Partial-Bug: 1927003
Signed-off-by: Isac Souza <IsacSacchi.Souza@windriver.com>
Change-Id: I7906dbadc00693736dedc2f5ea88ed24f74345f7
2021-05-06 16:59:30 -03:00
Mihnea Saracin
633d0a9a76 Add B&R lifecycle hooks to the nginx-ingress-controller
The recent upversion of the nginx app
(https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326)
enabled the nginx admissionWebhook and this introduced an
issue in the restore procedure.

The proposed solution is to use the lifecycle operator to delete
the nginx admissionWebhook before the backup.
If we do this, the backup of the etcd database
will not have the nginx webhook and the restore will succeed.

Note that the solution implies a
deletion of a resource in the nginx app.
Because of this, there are some
procedural changes to the backup and restore
that the user must do:

- After backup completes the following steps must be done:

1. $ system helm-override-update nginx-ingress-controller ingress-nginx
kube-system --set controller.admissionWebhooks.enabled=true
2. reapply the nginx app to restore the admissionWebhook:
   $ system application-apply nginx-ingress-controller

- After the whole restore procedure (i.e after all the nodes are
restored and unlocked, apps are in applied state
and 'system restore-complete' was executed)
the user must do the same steps as above to restore the nginx webhook:

 1. $ system helm-override-update nginx-ingress-controller ingress-nginx
kube-system --set controller.admissionWebhooks.enabled=true
 2. $ system application-apply nginx-ingress-controller

Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334
Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a
Depends-On: I648e940f8104307e111213afd511f8fca19e39ab
Closes-Bug: 1923185
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
vf/centos8
2021-04-09 15:52:26 +00:00
Iago Regiani
ad6d28ae36 Updated nginx-ingress controller to 0.41.2
This update includes removing the deprecated helm repo and previous
patches. This version is the last one that supports helm v2, and
implements nginx admission controller on port 5443 - avoiding conflict
with lighttpd.

Tested new version with cert-manager and Nodeinfo, making sure that new
routes were created when the application was manually updated, including
Openstack endpoints. Also tested with Platform Upgrade in Simplex and
Duplex deployments.

Story: 2008542
Task: 41636
Closes-Bug: #1902534
Signed-off-by: Regiani Iago <Lago.RodriguezRegiani@windriver.com>
Change-Id: I439ae16f0eb44b25c109d2a275121a60ae62c449
vr/stx.5.0
2021-03-22 14:21:40 -04:00
Iago Regiani
8f6568f9ae Revert "Updated nginx-ingress controller to 0.41.2"
This reverts commit 437db6f68af305a1667a5ac5ec722d96a1c44c9c.

Reason for revert: This new version implements an admission controller that uses port 8443, conflicting with lighttpd. Reverting in order to change this port

Change-Id: I0a2c4d6ca5dddac30a0508b844dc40ab96d2a0ad
2021-03-22 12:32:11 +00:00
Iago Regiani
437db6f68a Updated nginx-ingress controller to 0.41.2
This update includes removing the deprecated helm repo and previous
patches. This version is the last one that supports helm v2.

Tested new version with cert-manager and Nodeinfo, making sure that new
routes were created when the application was manually updated, including
Openstack endpoints. Also tested with Platform Upgrade in Simplex and
Duplex deployments.

Story: 2008542
Task: 41636
Closes-Bug: #1902534
Signed-off-by: Regiani Iago <Lago.RodriguezRegiani@windriver.com>
Change-Id: I9e022ae58d75f179fce66829117d475e435c169c
2021-03-17 12:28:58 -04:00
Suvro Ghosh
963100d9dd Adding metadata to prevent some operations
Critical apps like this are prevented from being deleted or
removed.

Story: 2007960
Task: 42038
Depends-On: I93821965184d95a00fddd3398a1c214e3d730efa
Signed-off-by: Suvro Ghosh <suvrojeet.ghosh@windriver.com>
Change-Id: If6cd2967e3912d2aaf5e155f868b9417ed199457
2021-03-11 12:30:16 -05:00
Suvro Ghosh
4cd19d274f Revert "Introduce metadata for app behavior control"
This reverts commit 1c1302ff54238727d72e8b8f3a6ca9ae95bc2fb2.

Reason for revert: Needed additional playbook change before preventing deletion


Story: 2007960
Task: 41765
Signed-off-by: Suvro Ghosh <suvrojeet.ghosh@windriver.com>
Change-Id: Id06cd976292a7d7047fb523e83331f0fa7ae9e8d
2021-03-09 16:45:10 +00:00
Suvro Ghosh
1c1302ff54 Introduce metadata for app behavior control
This metadata will forbid this app from deletion.

Story: 2007960
Task: 41765
Signed-off-by: Suvro Ghosh <suvrojeet.ghosh@windriver.com>
Change-Id: I68ec80ba8cfffec4aac86560571036f31d9eb593
2021-02-05 00:45:00 +00:00
Don Penney
0c05d422e2 Add auto-version for remaining stx/nginx-ingress-controller-armada-app packages
Update remaining StarlingX packages with hardcoded TIS_PATCH_VER to
use PKG_GITREVCOUNT where possible, with offsets as needed to ensure
the version is incremented above the hardcoded version.

Story: 2008455
Task: 41454
Signed-off-by: Don Penney <don.penney@windriver.com>
Change-Id: I48adf5627e6259b93efa6dfb98f51600104fccd9
2020-12-17 13:24:15 -05:00
Jim Gauld
f786b4bf8a Add support for Helm v3
This adds support for Helm v3.
- 'helm init' and initialization is no longer required
- 'chartmuseum' is used as a drop-in replacement for 'helm serv'
- all Charts require the tag: apiVersion: v1 (or v2)

This updates nginx-ingress chart to specify apiVersion.

Change-Id: Ic8d4454913fc4c65d1e17adb971f08200631f4d0
Story: 2007000
Task: 39713
Depends-On: https://review.opendev.org/719962
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
v4.0.0.rc0
2020-05-12 14:40:08 -04:00
Sabeel Ansari
c3b37cebac Increase timeout for app to start pods
During backup & restore it was noted that Armada apply would timeout
even though the nginx-ingress-controller did come up to Running state.
Increasing the timeout to 1800 to give more time before Armada times
out.

Closes-Bug: 1875664

Change-Id: I886f37feb559cfb5391dd0dd51f606a2bf207ac6
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-05-04 20:26:39 -04:00
Sabeel Ansari
c11e57693d Update manifest file hostNetwork indentation
hostNetwork indentation was incorrect in original commit. Fixing here.

Story: 2007360
Task: 39221

Change-Id: Ibe28855fd988534633f23d1fe691adfb554a0696
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-04-23 09:13:05 -04:00
Sabeel Ansari
e3e4b92758 Fix layered build
The nginx-ingress-controller app was missing a build requirement
check for the 'helm' package, which was causing the layered build to
fail. This commit adds the dependency check.

Closes-Bug: 1873603

Change-Id: If6792f5d4348d4f257fcf93a4d32760cb110bd97
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-04-20 10:32:09 -04:00
Sabeel Ansari
d1d2cd3326 Initial commit of nginx-ingress-controller app
This commit introduces nginx as a separate armada app as part of
support for cert-manager (to handle incoming cert challenges). In
future, the scope of nginx-ingress-controller is expected to be
broader. Spec for this feature is available here:
https://opendev.org/starlingx/specs/src/branch/master/doc/source/specs/stx-4.0/approved/security-2007360-cert-manager.rst

Story: 2007360
Task: 39221

Change-Id: I42e4dc47d2b65da807edf0ea8b7af93457e027b8
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-04-17 11:04:29 -04:00
Sabeel Ansari
ffaf052fe2 Installation via ISO is failing due to these.
Revert "Initial commit of stx-nginx-ingress-controller app"

This reverts commit 04406c0f114bb2bd5d505f8890ad236921882897.

Change-Id: I8b39125d8947c6984e3fdffb60ef9b0d8b42042c
2020-04-15 14:35:18 +00:00
Sabeel Ansari
04406c0f11 Initial commit of stx-nginx-ingress-controller app
Story: 2007360
Task: 39221

Change-Id: I764c0225b433182aee2da341244f6309184bb431
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-04-14 14:11:57 -04:00
Sabeel Ansari
ab26daf914 nginx-ingress-controller repo setup for armada app
Story: 2007360
Task: 39221

Change-Id: If07f4caa6a01875e61c102ce692e0097d736b34f
Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
2020-03-31 15:34:19 -04:00
OpenDev Project Creator
7d46af2312 Added .gitreview 2020-03-30 19:36:37 +00:00