diff --git a/kubernetes/full-create-and-install.sh b/kubernetes/full-create-and-install.sh index a2ab13a..27f11cc 100755 --- a/kubernetes/full-create-and-install.sh +++ b/kubernetes/full-create-and-install.sh @@ -27,8 +27,7 @@ export CLUSTER_NAME="${PROJECT_ID}-cluster" export NODE_POOL_NAME_AEROSPIKE="aerospike-pool" export NODE_POOL_NAME_AVS="avs-pool" export ZONE="us-central1-c" -export HELM_CHART="/home/joem/src/helm-charts/aerospike-vector-search" -export FEATURES_CONF="./features.conf" +export FEATURES_CONF="./features.conf" export AEROSPIKE_CR="./manifests/ssd_storage_cluster_cr.yaml" # Print environment variables to ensure they are set correctly @@ -131,6 +130,29 @@ echo "Setting secrets for AVS cluster..." kubectl --namespace avs create secret generic aerospike-secret --from-file=features.conf="$FEATURES_CONF" kubectl --namespace avs create secret generic auth-secret --from-literal=password='admin123' +################################################### +# Optional add Istio +################################################### +echo "Deploying Istio" +helm repo add istio https://istio-release.storage.googleapis.com/charts +helm repo update + +helm install istio-base istio/base --namespace istio-system --set defaultRevision=default --create-namespace --wait +helm install istiod istio/istiod --namespace istio-system --create-namespace --wait +helm install istio-ingress istio/gateway \ + --values ./manifests/istio/istio-ingressgateway-values.yaml \ + --namespace istio-ingress \ + --create-namespace \ + --wait + +kubectl apply -f manifests/istio/gateway.yaml +kubectl apply -f manifests/istio/avs-virtual-service.yaml + +################################################### +# End Istio +################################################### + + helm repo add aerospike-helm https://artifact.aerospike.io/artifactory/api/helm/aerospike-helm helm repo update helm install avs-gke --values "manifests/avs-gke-values.yaml" --namespace avs aerospike-helm/aerospike-vector-search --wait @@ -144,7 +166,11 @@ helm repo update helm install monitoring-stack prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace echo "Applying additional monitoring manifests..." -kubectl apply -f manifests/monitoring +kubectl apply -f manifests/monitoring/aerospike-exporter-service.yaml +kubectl apply -f manifests/monitoring/aerospike-servicemonitor.yaml +kubectl apply -f manifests/monitoring/avs-servicemonitor.yaml + + echo "Setup complete." echo "To include your Grafana dashboards, use 'import-dashboards.sh '" @@ -153,5 +179,5 @@ echo "To view Grafana dashboards from your machine use 'kubectl port-forward -n echo "To expose Grafana ports publicly, use 'kubectl apply -f helpers/EXPOSE-GRAFANA.yaml'" echo "To find the exposed port, use 'kubectl get svc -n monitoring'" -echo "To run the quote search sample app on your new cluster, use:" -echo "helm install semantic-search-app aerospike/quote-semantic-search --namespace avs --values manifests/semantic-search-values.yaml --wait" +echo "To run the quote search sample app on your new cluster, for istio use:" +echo "helm install semantic-search-app aerospike/quote-semantic-search --namespace avs --values manifests/quote-search/semantic-search-values.yaml --wait" diff --git a/kubernetes/manifests/virtual-service-vector-search.yaml b/kubernetes/manifests/istio/avs-virtual-service.yaml similarity index 73% rename from kubernetes/manifests/virtual-service-vector-search.yaml rename to kubernetes/manifests/istio/avs-virtual-service.yaml index 40fd335..8a51b53 100644 --- a/kubernetes/manifests/virtual-service-vector-search.yaml +++ b/kubernetes/manifests/istio/avs-virtual-service.yaml @@ -2,7 +2,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: avs-vs - namespace: aerospike + namespace: avs spec: hosts: - "*" @@ -17,7 +17,7 @@ spec: - destination: port: number: 8080 - host: quote-search-quote-semantic-search.aerospike.svc.cluster.local + host: sematic-search-app-quote-semantic-search.avs.svc.cluster.local - match: - uri: prefix: / @@ -26,4 +26,7 @@ spec: - destination: port: number: 5000 - host: avs-gke-aerospike-vector-search.aerospike.svc.cluster.local + host: avs-gke-aerospike-vector-search.avs.svc.cluster.local + +--- + diff --git a/kubernetes/manifests/gateway.yaml b/kubernetes/manifests/istio/gateway.yaml similarity index 94% rename from kubernetes/manifests/gateway.yaml rename to kubernetes/manifests/istio/gateway.yaml index d8903eb..3ce53f7 100644 --- a/kubernetes/manifests/gateway.yaml +++ b/kubernetes/manifests/istio/gateway.yaml @@ -2,7 +2,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: avs-gw - namespace: aerospike + namespace: avs spec: selector: istio: ingress diff --git a/kubernetes/manifests/istio-ingressgateway-values.yaml b/kubernetes/manifests/istio/istio-ingressgateway-values.yaml similarity index 100% rename from kubernetes/manifests/istio-ingressgateway-values.yaml rename to kubernetes/manifests/istio/istio-ingressgateway-values.yaml diff --git a/kubernetes/manifests/quote-search/sematic-search-values-istio.yaml b/kubernetes/manifests/quote-search/sematic-search-values-istio.yaml new file mode 100644 index 0000000..1751e8b --- /dev/null +++ b/kubernetes/manifests/quote-search/sematic-search-values-istio.yaml @@ -0,0 +1,6 @@ +quoteSearchConfig: + avsHost: "istio-ingress.istio-ingress.svc.cluster.local" + avsIsLoadbalancer: "True" + avsNamespace: "test" + avsIndexName: "istio-witticisms" + diff --git a/kubernetes/manifests/quote-search-gke-values.yaml b/kubernetes/manifests/quote-search/sematic-search-values.yaml similarity index 80% rename from kubernetes/manifests/quote-search-gke-values.yaml rename to kubernetes/manifests/quote-search/sematic-search-values.yaml index 594ca71..d239f0b 100644 --- a/kubernetes/manifests/quote-search-gke-values.yaml +++ b/kubernetes/manifests/quote-search/sematic-search-values.yaml @@ -1,5 +1,5 @@ quoteSearchConfig: avsHost: "avs-gke-aerospike-vector-search-lb.svc.cluster.local" avsIsLoadbalancer: "True" - avsNamespace: "avs-meta" + avsNamespace: "test" diff --git a/kubernetes/manifests/servicemonitor.yaml b/kubernetes/manifests/servicemonitor.yaml deleted file mode 100644 index 3b98e4f..0000000 --- a/kubernetes/manifests/servicemonitor.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: avs-service-monitor - namespace: aerospike -spec: - selector: - matchLabels: - app.kubernetes.io/name: aerospike-vector-search - endpoints: - - port: "manage-5040" - interval: 10s - path: "/manage/rest/v1/prometheus" diff --git a/quote-semantic-search/quote-search/config.py b/quote-semantic-search/quote-search/config.py index 7f5d8c4..7b4f378 100644 --- a/quote-semantic-search/quote-search/config.py +++ b/quote-semantic-search/quote-search/config.py @@ -3,11 +3,9 @@ def get_bool_env(name, default): env = os.environ.get(name) - if env is None: return default - - env = env.lower() + env = env.lower() if env in ["true", "1"]: return True