Skip to content

Commit b91275c

Browse files
committed
salt: install nginx-operator
1 parent 9ee086e commit b91275c

File tree

7 files changed

+540
-0
lines changed

7 files changed

+540
-0
lines changed

buildchain/buildchain/salt_tree.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ def task(self) -> types.TaskDict:
344344
file_dep=[METALK8S_OPERATOR_MANIFESTS],
345345
),
346346
Path("salt/metalk8s/addons/metalk8s-operator/deployed/init.sls"),
347+
Path("salt/metalk8s/addons/nginx-operator/deployed/clusterextension.sls"),
348+
Path("salt/metalk8s/addons/nginx-operator/deployed/init.sls"),
349+
Path("salt/metalk8s/addons/nginx-operator/deployed/namespace.sls"),
350+
Path("salt/metalk8s/addons/nginx-operator/deployed/rbac.sls"),
347351
Path("salt/metalk8s/addons/olm/catalog/deployed/cluster-catalog.sls"),
348352
Path("salt/metalk8s/addons/olm/catalog/deployed/init.sls"),
349353
Path("salt/metalk8s/addons/olm/deployed/chart.sls"),

salt/_modules/metalk8s_olm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ def check_condition_status(kind: str, name: str, condition: str, status: str):
1919

2020
def check_clustercatalog_serving(name: str):
2121
return check_condition_status("ClusterCatalog", name, "Serving", "True")
22+
23+
24+
def check_clusterextension_installed(name: str):
25+
return check_condition_status("ClusterExtension", name, "Installed", "True")
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!jinja | metalk8s_kubernetes
2+
3+
---
4+
apiVersion: olm.operatorframework.io/v1
5+
kind: ClusterExtension
6+
metadata:
7+
name: nginx-install
8+
spec:
9+
namespace: nginx-operator
10+
serviceAccount:
11+
name: nginx-operator-installer
12+
source:
13+
sourceType: Catalog
14+
catalog:
15+
packageName: nginx-operator
16+
version: "v4.12.0"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
include:
2+
- metalk8s.addons.olm.deployed
3+
- metalk8s.addons.olm.catalog.deployed
4+
- .namespace
5+
- .rbac
6+
- .clusterextension
7+
8+
Wait for the Nginx Operator Cluster Extension to be Installed:
9+
test.configurable_test_state:
10+
- changes: False
11+
- result: __slot__:salt:metalk8s_olm.check_clusterextension_installed("nginx-install")
12+
- comment: Wait for the Nginx Operator Cluster Extension to be Installed
13+
- retry:
14+
attempts: 30
15+
- require:
16+
- test: Wait for the Operator Controller Controller Manager Deployment to be Ready
17+
- test: Wait for Cluster Catalog to be Serving
18+
- sls: metalk8s.addons.nginx-operator.deployed.namespace
19+
- sls: metalk8s.addons.nginx-operator.deployed.rbac
20+
- sls: metalk8s.addons.nginx-operator.deployed.clusterextension
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!jinja | metalk8s_kubernetes
2+
3+
---
4+
apiVersion: v1
5+
kind: Namespace
6+
metadata:
7+
name: nginx-operator

0 commit comments

Comments
 (0)