-
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.
Merge branch 'improvement/ARTESCA-10641-cis-nginx-hardening' into q/1…
…28.0
- Loading branch information
Showing
11 changed files
with
176 additions
and
28 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
11 changes: 11 additions & 0 deletions
11
salt/metalk8s/addons/nginx-ingress-control-plane/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,11 @@ | ||
#!jinja|yaml | ||
|
||
# Defaults for configuration of Ingress Controller | ||
apiVersion: addons.metalk8s.scality.com/v1alpha2 | ||
kind: IngressControllerConfig | ||
spec: | ||
config: | ||
allow-snippet-annotations: 'true' | ||
hide-headers: 'Server,X-Powered-By' | ||
ssl-ciphers: 'EECDH+AESGCM:EDH+AESGCM' | ||
ssl-protocols: 'TLSv1.2 TLSv1.3' |
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
27 changes: 27 additions & 0 deletions
27
salt/metalk8s/addons/nginx-ingress-control-plane/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,27 @@ | ||
{%- set ingress_control_plane_controller_defaults = salt.slsutil.renderer( | ||
'salt://metalk8s/addons/nginx-ingress-control-plane/config/ingress-controller.yaml.j2', saltenv=saltenv | ||
) | ||
%} | ||
|
||
{%- set ingress_control_plane_controller = salt.metalk8s_service_configuration.get_service_conf( | ||
'metalk8s-ingress', 'metalk8s-ingress-control-plane-controller-config', ingress_control_plane_controller_defaults | ||
) | ||
%} | ||
|
||
Create Control Plane Ingress Controller configuration Config Map: | ||
metalk8s_kubernetes.object_present: | ||
- manifest: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: ingress-nginx-control-plane-controller | ||
namespace: metalk8s-ingress | ||
labels: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: ingress-nginx-control-plane | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: ingress-nginx | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
data: | ||
{{ ingress_control_plane_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-control-plane/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: | ||
- metalk8s.addons.nginx-ingress.deployed.namespace | ||
|
||
{%- set namespace = 'metalk8s-ingress' %} | ||
{%- set name = 'metalk8s-ingress-control-plane-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 ({{ namespace }}/{{ name }}): | ||
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 Control Plane 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
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