Skip to content

Commit a611af4

Browse files
authored
Merge pull request #823 from MetaCell/feature/CH-225
CH-225 implement gatekeeper and ingress optimizations
2 parents 3780898 + fb227e5 commit a611af4

16 files changed

Lines changed: 524 additions & 275 deletions

File tree

applications/common/deploy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ harness:
55
auto: true
66
port: 8080
77
name: common
8+
proxy:
9+
gatekeeper:
10+
replicas: 1
811
deployment:
912
auto: true
1013
name: common

applications/samples/deploy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ harness:
1717
usenfs: false
1818
auto: true
1919
port: 8080
20+
proxy:
21+
gatekeeper:
22+
replicas: 1
2023
uri_role_mapping:
2124
- uri: /
2225
white-listed: true

applications/volumemanager/deploy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
harness:
22
name: volumemanager
33
subdomain: volumemanager
4+
proxy:
5+
gatekeeper:
6+
replicas: 1
47
service:
58
port: 8080
69
auto: true

deployment-configuration/helm/templates/auto-gatekeepers.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ metadata:
121121
labels:
122122
app: "{{ .subdomain }}-gk"
123123
spec:
124-
replicas: 1
124+
replicas: {{ .app.harness.proxy.gatekeeper.replicas | default .root.Values.proxy.gatekeeper.replicas | default 5 }}
125125
selector:
126126
matchLabels:
127127
app: "{{ .subdomain }}-gk"
@@ -135,7 +135,7 @@ spec:
135135
{{ include "deploy_utils.etcHosts" .root | indent 6 }}
136136
containers:
137137
- name: {{ .app.harness.service.name | quote }}
138-
image: "quay.io/gogatekeeper/gatekeeper:2.14.3"
138+
image: {{ .app.harness.proxy.gatekeeper.image | default .root.Values.proxy.gatekeeper.image | default "quay.io/gogatekeeper/gatekeeper:2.14.3" }}
139139
imagePullPolicy: IfNotPresent
140140
{{ if .root.Values.local }}
141141
securityContext:
@@ -163,12 +163,7 @@ spec:
163163
- name: https
164164
containerPort: 8443
165165
resources:
166-
requests:
167-
memory: "32Mi"
168-
cpu: "5m"
169-
limits:
170-
memory: "64Mi"
171-
cpu: "100m"
166+
{{ .app.harness.proxy.gatekeeper.resources | default .root.Values.proxy.gatekeeper.resources | toYaml | nindent 10 }}
172167
volumes:
173168
- name: "{{ .subdomain }}-gk-proxy-config"
174169
configMap:

deployment-configuration/helm/templates/ingress.yaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
11
{{- define "deploy_utils.ingress.http" }}
22
{{ $domain := .root.Values.domain }}
33
{{ $secured_gatekeepers := and .root.Values.secured_gatekeepers }}
4+
{{ $app := .app }}
45
http:
56
paths:
7+
{{- if and $app.harness.secured $secured_gatekeepers $app.harness.uri_role_mapping }}
8+
{{- range $mapping := $app.harness.uri_role_mapping }}
9+
{{- if and (hasKey $mapping "white-listed") (index $mapping "white-listed") }}
10+
{{- $uri := $mapping.uri }}
11+
{{- if eq $uri "/" }}
12+
- path: /()
13+
pathType: ImplementationSpecific
14+
backend:
15+
service:
16+
name: {{ $app.harness.service.name | quote }}
17+
port:
18+
number: {{ $app.harness.service.port | default 80 }}
19+
{{- else if hasSuffix "/*" $uri }}
20+
{{- $cleanPath := trimSuffix "/*" $uri }}
21+
{{- $pathWithoutSlash := trimPrefix "/" $cleanPath }}
22+
- path: {{ printf "/(%s/.*)" $pathWithoutSlash }}
23+
pathType: ImplementationSpecific
24+
backend:
25+
service:
26+
name: {{ $app.harness.service.name | quote }}
27+
port:
28+
number: {{ $app.harness.service.port | default 80 }}
29+
{{- else if not (contains "*" $uri) }}
30+
{{- $pathWithoutSlash := trimPrefix "/" $uri }}
31+
- path: {{ printf "/(%s)" $pathWithoutSlash }}
32+
pathType: ImplementationSpecific
33+
backend:
34+
service:
35+
name: {{ $app.harness.service.name | quote }}
36+
port:
37+
number: {{ $app.harness.service.port | default 80 }}
38+
{{- end }}
39+
{{- end }}
40+
{{- end }}
41+
{{- end }}
642
- path: /(.*)
743
pathType: ImplementationSpecific
844
backend:
945
service:
10-
name: {{ if (and .app.harness.secured $secured_gatekeepers) }}{{ printf "%s-gk" .subdomain }}{{ else }}{{ .app.harness.service.name | quote }}{{ end }}
46+
name: {{ if (and $app.harness.secured $secured_gatekeepers) }}{{ printf "%s-gk" .subdomain }}{{ else }}{{ $app.harness.service.name | quote }}{{ end }}
1147
port:
12-
number: {{- if (and .app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ .app.harness.service.port | default 80 }}{{- end }}
48+
number: {{- if (and $app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ $app.harness.service.port | default 80 }}{{- end }}
49+
1350
{{- end }}
1451
{{- define "deploy_utils.ingress.service" }}
1552
{{ $domain := .root.Values.domain }}
@@ -40,6 +77,9 @@ metadata:
4077
nginx.ingress.kubernetes.io/ssl-redirect: {{ (and $tls .Values.ingress.ssl_redirect) | quote }}
4178
nginx.ingress.kubernetes.io/proxy-body-size: '{{ .Values.proxy.payload.max }}m'
4279
nginx.ingress.kubernetes.io/proxy-buffer-size: '128k'
80+
nginx.ingress.kubernetes.io/proxy-buffering: "on"
81+
nginx.ingress.kubernetes.io/proxy-buffers-number: "8"
82+
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: "1024m"
4383
nginx.ingress.kubernetes.io/from-to-www-redirect: 'true'
4484
nginx.ingress.kubernetes.io/rewrite-target: /$1
4585
nginx.ingress.kubernetes.io/auth-keepalive-timeout: {{ .Values.proxy.timeout.keepalive | quote }}

deployment-configuration/helm/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@ proxy:
7676
payload:
7777
# -- Maximum size of payload in MB
7878
max: 250
79+
gatekeeper:
80+
# -- Default gatekeeper image
81+
image: "quay.io/gogatekeeper/gatekeeper:2.14.3"
82+
# -- Default number of gatekeeper replicas
83+
replicas: 1
84+
resources:
85+
requests:
86+
memory: "32Mi"
87+
limits:
88+
memory: "64Mi"

deployment-configuration/value-template.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,13 @@ harness:
139139
payload:
140140
# -- Maximum size of payload in MB
141141
max:
142+
gatekeeper:
143+
# -- Default gatekeeper image
144+
image: "quay.io/gogatekeeper/gatekeeper:2.14.3"
145+
# -- Default number of gatekeeper replicas
146+
replicas: 1
147+
resources:
148+
requests:
149+
memory: "32Mi"
150+
limits:
151+
memory: "64Mi"

docs/model/GatekeeperConf.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# GatekeeperConf
2+
3+
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**image** | **str** | | [optional]
10+
**replicas** | **int** | | [optional]
11+
12+
## Example
13+
14+
```python
15+
from cloudharness_model.models.gatekeeper_conf import GatekeeperConf
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of GatekeeperConf from a JSON string
20+
gatekeeper_conf_instance = GatekeeperConf.from_json(json)
21+
# print the JSON string representation of the object
22+
print(GatekeeperConf.to_json())
23+
24+
# convert the object into a dict
25+
gatekeeper_conf_dict = gatekeeper_conf_instance.to_dict()
26+
# create an instance of GatekeeperConf from a dict
27+
gatekeeper_conf_from_dict = GatekeeperConf.from_dict(gatekeeper_conf_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

docs/model/ProxyConf.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**forwarded_headers** | **bool** | | [optional]
1010
**payload** | [**ProxyPayloadConf**](ProxyPayloadConf.md) | | [optional]
1111
**timeout** | [**ProxyTimeoutConf**](ProxyTimeoutConf.md) | | [optional]
12+
**gatekeeper** | [**GatekeeperConf**](GatekeeperConf.md) | | [optional]
1213

1314
## Example
1415

libraries/models/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Class | Method | HTTP request | Description
8787
- [DockerfileConfig](docs/DockerfileConfig.md)
8888
- [E2ETestsConfig](docs/E2ETestsConfig.md)
8989
- [FileResourcesConfig](docs/FileResourcesConfig.md)
90+
- [GatekeeperConf](docs/GatekeeperConf.md)
9091
- [GitDependencyConfig](docs/GitDependencyConfig.md)
9192
- [HarnessMainConfig](docs/HarnessMainConfig.md)
9293
- [IngressConfig](docs/IngressConfig.md)

0 commit comments

Comments
 (0)