-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add customisation support for workloadplane ingress
- Loading branch information
1 parent
05ad3db
commit 5bb41f4
Showing
10 changed files
with
143 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
salt/metalk8s/addons/nginx-ingress/config/ingress-controller.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!jinja|yaml | ||
|
||
# Defaults for configuration of Ingress Controller | ||
apiVersion: addons.metalk8s.scality.com/v1alpha2 | ||
kind: IngressControllerConfig | ||
spec: | ||
config: | ||
allow-snippet-annotations: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
salt/metalk8s/addons/nginx-ingress/deployed/config-map.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- set ingress_controller_defaults = salt.slsutil.renderer( | ||
'salt://metalk8s/addons/nginx-ingress/config/ingress-controller.yaml.j2', saltenv=saltenv | ||
) | ||
%} | ||
|
||
{%- set ingress_controller = salt.metalk8s_service_configuration.get_service_conf( | ||
'metalk8s-ingress', 'metalk8s-ingress-controller-config', ingress_controller_defaults | ||
) | ||
%} | ||
|
||
Create Ingress Controller configuration Config Map: | ||
metalk8s_kubernetes.object_present: | ||
- manifest: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: ingress-nginx-controller | ||
namespace: metalk8s-ingress | ||
labels: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: ingress-nginx | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: ingress-nginx | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
data: | ||
{{ ingress_controller.spec.config | yaml(False) | indent(10) }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
salt/metalk8s/addons/nginx-ingress/deployed/service-configuration.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
include: | ||
- .namespace | ||
|
||
{%- set namespace = 'metalk8s-ingress' %} | ||
{%- set name = 'metalk8s-ingress-controller-config' %} | ||
|
||
{%- set ingress_service_config = salt.metalk8s_kubernetes.get_object( | ||
kind='ConfigMap', | ||
apiVersion='v1', | ||
namespace=namespace, | ||
name=name | ||
) | ||
%} | ||
|
||
{%- if ingress_service_config is none %} | ||
|
||
Create Ingress ServiceConfiguration (metalk8s-ingress/metalk8s-ingress-controller-config): | ||
metalk8s_kubernetes.object_present: | ||
- manifest: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ name }} | ||
namespace: {{ namespace }} | ||
data: | ||
config.yaml: |- | ||
apiVersion: addons.metalk8s.scality.com/v1alpha2 | ||
kind: IngressControllerConfig | ||
spec: {} | ||
|
||
|
||
{%- else %} | ||
|
||
Ingress ServiceConfiguration already exists: | ||
test.succeed_without_changes: [] | ||
|
||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters