Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved nginx config to Helm Chart rather than nginx.conf in the image #12

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions onos-gui/files/certs/onos-gui.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIEJzCCAw+gAwIBAgIUSsEbOxcejWXxuZlGYOQX6HZux1IwDQYJKoZIhvcNAQEL
BQAwcjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlNZW5sb1Bh
cmsxDDAKBgNVBAoMA09ORjEUMBIGA1UECwwLRW5naW5lZXJpbmcxHjAcBgNVBAMM
FWNhLm9wZW5uZXR3b3JraW5nLm9yZzAeFw0xOTA3MjExMzU3MzJaFw0yOTA3MTgx
MzU3MzJaMGUxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJTWVu
bG9QYXJrMQwwCgYDVQQKDANPTkYxFDASBgNVBAsMC0VuZ2luZWVyaW5nMREwDwYD
VQQDDAhvbm9zLWd1aTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK8D
gVeotXoZ0oFvBLAkA+OXLGRpy/NK1Jn+4Z58l4t99IF1FsRLYX7649zZxZ4s/+gR
qS2Il5qc9mmbUZIVWU6LNsabG29KISLPJdR+7/bgv4wkmnRa1flel5OJoA/wEqQW
LfTfIJatu5tK3J4Bzvj6fW4vRydy/87o+3fCua3x8m/ETqALbu1vJ2Vv2/Yul27a
4kzusJb0iu78tfn+NPUe/Z2ZmRj5kOa5oX4YvYLFYq7BemrDu18mcxPwum7qNjJ9
E4NjGTUKhs5HMl7E+CeapaRhJRWhyoNyzdpFA/TFCXDvQdSTX0wN7DZQgGZBpxEX
aFTG0c0BZ7yMurYqDO0CAwEAAaOBwTCBvjCBjgYDVR0jBIGGMIGDoXakdDByMQsw
CQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFyazEMMAoG
A1UECgwDT05GMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEeMBwGA1UEAwwVY2Eub3Bl
bm5ldHdvcmtpbmcub3JnggkA3vfX0jfasUkwCQYDVR0TBAIwADALBgNVHQ8EBAMC
BPAwEwYDVR0RBAwwCoIIb25vcy1ndWkwDQYJKoZIhvcNAQELBQADggEBAFa/ug+x
Mrq3g0p3sHTNR82FjjQKPHW4E0h5kGALvQqtwNOyClls9Ik4wYIZNKyHDXOcWP4I
NOgBho8WHh39bixjz0dka96H88u3WptqBKAySk1UGaSmqHVNxGSTtCpwV17QMh0f
+KsnbxVulcQZeOTbgpFoAuCB9S+u4N5F8j40FkjUbIj3rLN76eidinUMYHfeaZ+K
uP8kU+EwPvh70RuX3fOSPUPNdMV1VjtAnPrvQPuqi3K/9FPEtr+YCuXSTk0+Qpcn
25wdQKAz7ppglbfWYjowtGWU8POx+wuXHyFTvrRrCy+JYnM8DUlPKP1/oDKneoy0
3h4nV209NiJ4c/A=
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions onos-gui/files/certs/onos-gui.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvA4FXqLV6GdKB
bwSwJAPjlyxkacvzStSZ/uGefJeLffSBdRbES2F++uPc2cWeLP/oEaktiJeanPZp
m1GSFVlOizbGmxtvSiEizyXUfu/24L+MJJp0WtX5XpeTiaAP8BKkFi303yCWrbub
StyeAc74+n1uL0cncv/O6Pt3wrmt8fJvxE6gC27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8/YkzBjBZ/pUy7C1O+xahWsCeLCwwgTy0TQOQH8MoSOqXN
qWJ3Sb89WfG8PCy3X0ntCNYzrLVWYrwgZgQ5ErMbW5tIvgjVMoIIW0RsMvk5HKQg
6zBsgQkhWmMPUlq5Dv0g3jg+ZSSRLtMXjiE4kl6LTQKBgB9DTdNba8HXgavWOAjm
M37pa+1CqsohKEyHNBPBJUUyvK6XxzsooX6x9X2PvwsJJ+MaMTv6vnH+SVm6ZJ8u
K6iBd3bjQx0G7QXhGT75MSFSOeiMHtbFwh++C7O7s+A3XT8yUwnyG9STH6YhCoDf
jFvx0Laxe0FBnNj4lIzaDFhf
-----END PRIVATE KEY-----
5 changes: 5 additions & 0 deletions onos-gui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ data:
{{ $valueWithDefault := default "" $value -}}
{{ tpl $valueWithDefault $ | indent 4 }}
{{- end -}}
{{- range $key, $value := .Values.Nginx.templates }}
{{ $key }}: |-
{{ $valueWithDefault := default "" $value -}}
{{ tpl $valueWithDefault $ | indent 4 }}
{{- end -}}
6 changes: 6 additions & 0 deletions onos-gui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ spec:
tcpSocket:
port: web
initialDelaySeconds: 30
volumeMounts:
- name: config
mountPath: /etc/nginx/conf.d
- name: secret
mountPath: /usr/share/certs
readOnly: true
- name: onos-envoy
image: "{{ .Values.Envoy.image.repository }}:{{ .Values.Envoy.image.tag }}"
imagePullPolicy: {{ .Values.Envoy.image.pullPolicy }}
Expand Down
2 changes: 1 addition & 1 deletion onos-gui/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
heritage: "{{ .Release.Service }}"
data:
{{ $root := . }}
{{ range $path, $bytes := .Files.Glob "files/certs/tls.*" }}
{{ range $path, $bytes := .Files.Glob "files/certs/*.*" }}
{{ base $path }}: '{{ $root.Files.Get $path | b64enc }}'
{{ end }}
type: Opaque
34 changes: 33 additions & 1 deletion onos-gui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ service:
enabled: true
## Service name is user-configurable for maximum service discovery flexibility.
name: onos-gui
type: ClusterIP
type: LoadBalancer

ingress:
enabled: true
Expand Down Expand Up @@ -51,9 +51,11 @@ onosservices:
topo:
grpc: 5150
proxy: 8080
streamTimeout: 3600
config:
grpc: 5150
proxy: 8081
streamTimeout: 3600
# control:
# grpc: 5150
# proxy: 8082
Expand Down Expand Up @@ -228,3 +230,33 @@ Envoy:
validation_context:
trusted_ca: { filename: "/etc/envoy-proxy/certs/tls.cacrt" }
{{- end }}

Nginx:
templates:
server-block.conf: |-
server {
listen 80;
ssl_certificate /usr/share/certs/onos-gui.crt;
ssl_certificate_key /usr/share/certs/onos-gui.key;
location / {
root /usr/share/nginx/html;
}
location ~ \.(html|js|ico|map|css|png|woff|woff2)$ {
root /usr/share/nginx/html;
}
location /rs/nav/uiextensions {
root /usr/share/nginx/html;
}
{{- range $key, $value := .Values.onosservices }}
location /onos-{{ $key }}/ {
proxy_pass http://localhost:{{ $value.proxy }}/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout {{ $value.streamTimeout }};
proxy_send_timeout {{ $value.streamTimeout }};
proxy_read_timeout {{ $value.streamTimeout }};
send_timeout {{ $value.streamTimeout }};
}
{{ end }}
}