Skip to content

cloud-prog-team3/local-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Local Deploy

Install Kind cluster

kind create cluster --config res/kind-config.yaml

Add Helm repos

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add metallb https://metallb.github.io/metallb
helm repo update

Install CNI

Get Cilium CLI:

CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
curl -L --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-${GOOS}-${GOARCH}.tar.gz.sha256sum
sudo tar -C /usr/local/bin -xzvf cilium-${GOOS}-${GOARCH}.tar.gz
rm cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}

Install Cilium:

cilium install --version 1.17.2 --wait

Install Prometheus, AlertMananger, Grafana

helm upgrade --install prometheus prometheus-community/kube-prometheus-stack \
  --namespace monitoring --create-namespace \
  --set grafana.adminUser='admin' \
  --set grafana.adminPassword='password' \
  --set grafana.service.type=LoadBalancer \
  --set prometheus.service.type=LoadBalancer \
  --set alertmanager.service.type=LoadBalancer \
  --set prometheus.service.port=80 \
  --set prometheus.service.targetPort=9090 \
  --set alertmanager.service.port=80 \
  --set alertmanager.service.targetPort=9093 \
  --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
  --set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false

All services should be up and running:

kubectl get svc -n monitoring

Install Nginx Ingress

helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace \
  --set controller.metrics.enabled=true \
  --set controller.metrics.serviceMonitor.enabled=true \
  --set-string controller.metrics.serviceMonitor.additionalLabels.release="prometheus" \
  --set-string controller.podAnnotations."prometheus\.io/scrape"="true" \
  --set-string controller.podAnnotations."prometheus\.io/port"="10254"

Install Load Balancer

helm upgrade --install metallb metallb/metallb \
  --namespace metallb-system --create-namespace

Apply the config:

./set_ip_addr.sh
kubectl apply -f res/metallb.yaml

Check if Nginx external IP has been assigne:

kubectl get svc -n ingress-nginx

In case it has not you can try manually assigning it:

kubectl patch svc ingress-nginx-controller -n ingress-nginx -p '{"spec": {"loadBalancerIP": "<an_ip_in_the_range>"}}'

As soon as you access first time the ingress (e.g. curl http://<nginx_ip>/) you should see some metrics exposed in the Prometheus UI.

Install Crownlabs

KubeVirt

As first requirement, KubeVirt is required for the instance-operator

# Pick an upstream version of KubeVirt to install
export KUBEVIRT_VERSION=v1.2.0
# Deploy the KubeVirt operator
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml
# Create the KubeVirt CR (instance deployment request) which triggers the actual installation
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml
# wait until all KubeVirt components are up
kubectl -n kubevirt wait --timeout=5m kv kubevirt --for condition=Available

Install Operators

From the Crownlabs directory, move in the operators folder, and use the following commands to deploy all the resoruces and start the controllers:

cd operators
make install-local
make run-instance-local

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages