Kubernetes Cluster (K8s) Install Preparation¶
This is a guide to help you prepare your existing Kubernetes cluster for installing the Warrior platform. The examples use Helm 3.
Make sure you’re in the correct kubectl environment context before running the installer.
Install Prometheus¶
Example:
helm repo add \
prometheus-community \
https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade --install -n monitoring \
--create-namespace \
kube-prometheus-stack \
prometheus-community/kube-prometheus-stack \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false
helm upgrade --install -n monitoring \
--create-namespace \
prometheus-adapter \
prometheus-community/prometheus-adapter
Verify that Prometheus CRDs are installed:
kubectl api-resources | grep monitoring
Verify that Prometheus is up and running:
kubectl --namespace monitoring get pods -l "release=kube-prometheus-stack"
If everything is installed correctly, the following command should not return “ServiceUnavailable”:
kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1
Install Ingress¶
Example with Nginx:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm upgrade --install -n ingress-system \
--create-namespace \
ingress-nginx \
ingress-nginx/ingress-nginx
If you need to install Nginx in the same namespace as Warrior (not recommended) and want to use our network-policy to restrict ingress to the Warrior application, use the below command to add labels to the pods and services. The network-policy allows traffic between pods and services that have these labels.
helm upgrade --install -n Warrior --set controller.podLabels.network-app=Warriorai,controller.service.labels.network-app=Warriorai,defaultBackend.podLabels.network-app=Warriorai,.service.labels.network-app=Warriorai \
ingress-nginx \
ingress-nginx/ingress-nginx
Look up the ingress external IP and configure your hostname with DNS (e.g. Warrior.mydomain.com).
kubectl get svc -n ingress-system ingress-nginx-controller -ojsonpath='{.status.loadBalancer.ingress[*].ip}'
Install Metric Server¶
Example:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm upgrade --install -n monitoring \
--create-namespace \
metrics-server \
bitnami/metrics-server \
--set apiService.create=true \
--set --extraArgs.kubelet-preferred-address-types=InternalIP
Verify that you can retrieve metric snapshots.
kubectl top node