fixing helm chart issues

This commit is contained in:
Arsham Teymouri
2021-08-12 15:50:11 +03:00
parent 705d57a3b6
commit c169650ed5
5 changed files with 116 additions and 44 deletions
+62
View File
@@ -0,0 +1,62 @@
{{- if .Values.ingress.core.enabled -}}
{{- $fullName := include "substrate-telemetry.fullname" . -}}
{{- $svcPort := .Values.service.core.port -}}
{{- if and .Values.ingress.core.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.core.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.core.annotations "kubernetes.io/ingress.class" .Values.ingress.core.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: telemetry-core
labels:
{{- include "substrate-telemetry.labels" . | nindent 4 }}
telemetry-component: core
{{- with .Values.ingress.core.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.core.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.core.className }}
{{- end }}
{{- if .Values.ingress.core.tls }}
tls:
{{- range .Values.ingress.core.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.core.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: telemetry-core
port:
number: {{ $svcPort }}
{{- else }}
serviceName: telemetry-core
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
+8 -6
View File
@@ -33,8 +33,8 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.image.frontend.repository }}:{{ .Values.image.frontend.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.frontend.pullPolicy }}
{{- if .Values.envVars.frontend }}
env:
{{- range $key, $val := .Values.envVars.frontend }}
@@ -48,18 +48,20 @@ spec:
protocol: TCP
livenessProbe:
httpGet:
path: /health
path: /
port: http
readinessProbe:
httpGet:
path: /health
path: /
port: http
volumeMounts:
- name: nginx
mountPath: "/etc/nginx/nginx.conf"
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
- name: env-config
mountPath: "/usr/share/nginx/html/env-config.js"
mountPath: /usr/share/nginx/html/env-config.js
subPath: env-config.js
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
+1 -1
View File
@@ -5,6 +5,6 @@ metadata:
data:
env-config.js: |
window.process_env = {
SUBSTRATE_TELEMETRY_URL: "ws://feed.telemetry.parity-stg.parity.io/feed",
SUBSTRATE_TELEMETRY_URL: "wss://feed.telemetry.parity-stg.parity.io/feed",
SUBSTRATE_TELEMETRY_SAMPLE: "",
}
+13 -9
View File
@@ -10,21 +10,13 @@ data:
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
server {
root /usr/share/nginx/html;
index index.html;
listen 80;
listen [::]:80;
server_name _;
}
events {
worker_connections 8000;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/mime.types;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
@@ -34,4 +26,16 @@ data:
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
#server_tokens off;
server {
root /usr/share/nginx/html;
index index.html;
listen 8000;
server_name _;
location = /favicon.ico {
return 204;
}
}
}