From 03f91acce5e9aa8c27098a7bbfa0db419b09abab Mon Sep 17 00:00:00 2001 From: leveryd Date: Thu, 23 Feb 2023 15:57:12 +0800 Subject: [PATCH] add: proxy and kibana service can be access via ingress https://github.com/leveryd-asm/asm/issues/8 --- templates/elk/kibana.yaml | 6 ++---- templates/xray/ingress.yaml | 16 ++++++++++++++++ templates/xray/xray-proxy.yaml | 1 - values.yaml | 8 +++++--- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 templates/xray/ingress.yaml diff --git a/templates/elk/kibana.yaml b/templates/elk/kibana.yaml index e5ef159..658c6bd 100644 --- a/templates/elk/kibana.yaml +++ b/templates/elk/kibana.yaml @@ -2,14 +2,12 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: kibana - annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - - host: {{.Values.console_domain}} + - host: kibana.{{.Values.console_domain}} http: paths: - - path: /kibana(/|$)(.*) # match all paths that begin with /argo/ + - path: / # match all paths that begin with /argo/ pathType: ImplementationSpecific backend: service: diff --git a/templates/xray/ingress.yaml b/templates/xray/ingress.yaml new file mode 100644 index 0000000..6b4596a --- /dev/null +++ b/templates/xray/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: proxy +spec: + rules: + - host: proxy.{{.Values.console_domain}} + http: + paths: + - path: / # match all paths that begin with /argo/ + pathType: ImplementationSpecific + backend: + service: + name: {{.Values.xray_proxy_service}} # name of the service + port: + number: {{.Values.xray_proxy_port}} diff --git a/templates/xray/xray-proxy.yaml b/templates/xray/xray-proxy.yaml index 0acfc29..9903574 100644 --- a/templates/xray/xray-proxy.yaml +++ b/templates/xray/xray-proxy.yaml @@ -65,4 +65,3 @@ spec: - protocol: TCP port: {{.Values.xray_proxy_port}} targetPort: 80 - type: NodePort diff --git a/values.yaml b/values.yaml index 3f382c6..e5736d6 100644 --- a/values.yaml +++ b/values.yaml @@ -106,11 +106,13 @@ elasticsearch: - name: init-script mountPath: /tmp/init.py subPath: init.py + rbac: + create: true kibana: elasticsearchHosts: "http://elasticsearch-master:9200" kibanaConfig: - kibana.yml: | - server.base="/kibana" + kibana.yml: | + server.basePath="/kibana" + server.host="0.0.0.0" server.rewriteBasePath=true -# healthCheckPath: "/kibana" \ No newline at end of file