-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grafana and req logging configuration to work behind istio ingress ga…
…teway (#650) request logging and grafana configuration to work behind istio ingress gateway
- Loading branch information
1 parent
724f95b
commit cefaf44
Showing
13 changed files
with
197 additions
and
7 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
51 changes: 51 additions & 0 deletions
51
examples/centralised-logging/full-setup-existing-kubeflow.sh
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,51 @@ | ||
# Assumes existing cluster with kubeflow's istio gateway | ||
# Will put services behind kubeflow istio gateway | ||
|
||
./kubeflow/knative-setup-existing-istio.sh | ||
|
||
sleep 5 | ||
|
||
kubectl -n kube-system create sa tiller | ||
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller | ||
helm init --service-account tiller | ||
|
||
kubectl rollout status -n kube-system deployment/tiller-deploy | ||
|
||
helm install --name seldon-core ../../helm-charts/seldon-core-operator/ --namespace seldon-system --set istio.gateway="kubeflow-gateway.kubeflow.svc.cluster.local" --set istio.enabled="true" | ||
|
||
kubectl rollout status -n seldon-system statefulset/seldon-operator-controller-manager | ||
|
||
sleep 5 | ||
|
||
helm install --name seldon-single-model ../../helm-charts/seldon-single-model/ --set engine.env.LOG_MESSAGES_EXTERNALLY="true" --set model.annotations."seldon\.io/istio-gateway"="kubeflow-gateway.kubeflow.svc.cluster.local" | ||
|
||
kubectl label nodes $(kubectl get nodes -o jsonpath='{.items[0].metadata.name}') role=locust --overwrite | ||
helm install --name seldon-core-loadtesting ../../helm-charts/seldon-core-loadtesting/ --set locust.host=http://seldon-single-model-seldon-single-model:8000 --set oauth.enabled=false --set oauth.key=oauth-key --set oauth.secret=oauth-secret --set locust.hatchRate=1 --set locust.clients=1 --set loadtest.sendFeedback=0 --set locust.minWait=0 --set locust.maxWait=0 --set replicaCount=1 | ||
|
||
helm install --name seldon-core-analytics ../../helm-charts/seldon-core-analytics/ -f ./kubeflow/seldon-analytics-kubeflow.yaml | ||
|
||
helm install --name elasticsearch elasticsearch --version 7.1.1 --namespace=logs --set service.type=ClusterIP --set antiAffinity="soft" --repo https://helm.elastic.co | ||
kubectl rollout status statefulset/elasticsearch-master -n logs | ||
|
||
helm install fluentd-elasticsearch --name fluentd --namespace=logs -f fluentd-values.yaml --repo https://kiwigrid.github.io | ||
helm install kibana --version 7.1.1 --name=kibana --namespace=logs --set service.type=ClusterIP -f ./kubeflow/kibana-values.yaml --repo https://helm.elastic.co | ||
|
||
kubectl apply -f ./kubeflow/virtualservice-kibana.yaml | ||
kubectl apply -f ./kubeflow/virtualservice-elasticsearch.yaml | ||
|
||
kubectl rollout status deployment/kibana-kibana -n logs | ||
|
||
kubectl apply -f ./request-logging/seldon-request-logger.yaml | ||
kubectl label namespace default knative-eventing-injection=enabled | ||
sleep 3 | ||
kubectl -n default get broker default | ||
kubectl apply -f ./request-logging/trigger.yaml | ||
|
||
ISTIO_INGRESS=$(kubectl get svc -n istio-system istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
|
||
echo 'kubeflow dashboard at:' | ||
echo "$ISTIO_INGRESS" | ||
echo 'grafana running at:' | ||
echo "$ISTIO_INGRESS/grafana/" | ||
echo 'kibana running at:' | ||
echo "$ISTIO_INGRESS/kibana/" |
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,19 @@ | ||
# Setup on existing kubeflow | ||
|
||
## Installation | ||
|
||
The request logging setup includes knative, which includes istio. If you've an existing kubeflow, you can instead use the kubeflow istio. | ||
|
||
For kubeflow cluster setup and installation see - we recommend installing with istio into an existing cluster: | ||
|
||
https://www.kubeflow.org/docs/started/getting-started-k8s/ | ||
|
||
To setup seldon and supporting services on top of kubeflow, using its istio, run ./full-setup-existing-kubeflow.sh from the centralised-logging dir. | ||
|
||
## Accessing services | ||
|
||
The final output of the full-setup-existing-kubeflow.sh script includes URLs to access services such as kibana and grafana. | ||
|
||
The path to seldon services can be found by inspecting the prefix section of `kubectl get vs -n default seldon-single-model-seldon-single-model-http -o yaml` | ||
|
||
You can curl a service directly within the cluster - there is an example in the [request logging README](../request-logging/README.md). |
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,3 @@ | ||
extraEnvs: | ||
- name: SERVER_BASEPATH | ||
value: "/kibana" |
18 changes: 18 additions & 0 deletions
18
examples/centralised-logging/kubeflow/knative-setup-existing-istio.sh
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,18 @@ | ||
#this assumes installing to cloud and istio already installed e.g. with kubeflow | ||
|
||
kubectl apply --selector knative.dev/crd-install=true \ | ||
--filename https://github.com/knative/serving/releases/download/v0.6.0/serving.yaml \ | ||
--filename https://github.com/knative/eventing/releases/download/v0.6.0/release.yaml \ | ||
--filename https://raw.githubusercontent.com/knative/serving/v0.6.0/third_party/config/build/clusterrole.yaml | ||
|
||
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.6.0/serving.yaml --selector networking.knative.dev/certificate-provider!=cert-manager \ | ||
--filename https://github.com/knative/build/releases/download/v0.6.0/build.yaml \ | ||
--filename https://github.com/knative/eventing/releases/download/v0.6.0/release.yaml \ | ||
--filename https://raw.githubusercontent.com/knative/serving/v0.6.0/third_party/config/build/clusterrole.yaml | ||
|
||
kubectl label namespace default istio-injection=enabled | ||
|
||
kubectl apply -f https://github.com/knative/eventing/releases/download/v0.6.0/eventing.yaml | ||
kubectl apply -f https://github.com/knative/eventing/releases/download/v0.6.0/in-memory-channel.yaml | ||
#kafka if you have a kafka cluster setup already | ||
#kubectl apply -f https://github.com/knative/eventing/releases/download/v0.6.0/kafka.yaml |
13 changes: 13 additions & 0 deletions
13
examples/centralised-logging/kubeflow/seldon-analytics-kubeflow.yaml
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,13 @@ | ||
grafana_prom_service_type: ClusterIP | ||
grafana_prom_admin_password: admin | ||
grafana_anonymous_auth: true | ||
grafana: | ||
virtualservice: | ||
enabled: true | ||
#trailing dash important and should be used when accessing | ||
prefix: "/grafana/" | ||
gateways: | ||
- kubeflow-gateway.kubeflow.svc.cluster.local | ||
extraEnv: | ||
#replace with KF gateway URI | ||
GF_SERVER_ROOT_URL: "%(protocol)s://%(domain)s/grafana" |
21 changes: 21 additions & 0 deletions
21
examples/centralised-logging/kubeflow/virtualservice-elasticsearch.yaml
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,21 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: elasticsearch | ||
namespace: logs | ||
spec: | ||
gateways: | ||
- kubeflow-gateway.kubeflow.svc.cluster.local | ||
hosts: | ||
- '*' | ||
http: | ||
- match: | ||
- uri: | ||
prefix: /elasticsearch/ | ||
rewrite: | ||
uri: / | ||
route: | ||
- destination: | ||
host: elasticsearch-master | ||
port: | ||
number: 9200 |
21 changes: 21 additions & 0 deletions
21
examples/centralised-logging/kubeflow/virtualservice-kibana.yaml
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,21 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: kibana | ||
namespace: logs | ||
spec: | ||
gateways: | ||
- kubeflow-gateway.kubeflow.svc.cluster.local | ||
hosts: | ||
- '*' | ||
http: | ||
- match: | ||
- uri: | ||
prefix: /kibana/ | ||
rewrite: | ||
uri: / | ||
route: | ||
- destination: | ||
host: kibana-kibana | ||
port: | ||
number: 5601 |
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
24 changes: 24 additions & 0 deletions
24
helm-charts/seldon-core-analytics/templates/grafana-prom-virtualservice.yaml
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,24 @@ | ||
{{- if .Values.grafana.virtualservice.enabled }} | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: grafana-prom | ||
spec: | ||
hosts: | ||
- "*" | ||
{{- with .Values.grafana.virtualservice.gateways }} | ||
gateways: | ||
{{ toYaml . | indent 2 }} | ||
{{- end }} | ||
http: | ||
- match: | ||
- uri: | ||
prefix: {{ .Values.grafana.virtualservice.prefix }} | ||
rewrite: | ||
uri: / | ||
route: | ||
- destination: | ||
port: | ||
number: 80 | ||
host: grafana-prom | ||
{{- end }} |
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