Skip to content

Latest commit

 

History

History
193 lines (124 loc) · 4.03 KB

deploy_to_k8s.md

File metadata and controls

193 lines (124 loc) · 4.03 KB

How to install to Kubernetes

Prerequisites

  1. Docker for Desktop with ready Kubernetes
  2. Helm 3

Getting Started

Add repositories for Helm

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo add carlosjgp https://carlosjgp.github.io/open-charts/
helm repo add dapr https://daprio.azurecr.io/helm/v1/repo
helm repo update

Install Helm's charts

Open PowerShell at .\.helm

  1. Install MS SqlServer

    helm install sqlserver stable/mssql-linux --version 0.11.2 -f .\sqlserver.dev.yaml
  2. Install NGINX Ingress Controller

    helm install nginx ingress-nginx/ingress-nginx
  3. Install Seq

    helm install seq stable/seq --version 2.2.0 -f .\seq.dev.yaml
  4. Install Zipkin

    helm install zipkin carlosjgp/zipkin --version 0.2.0 -f .\zipkin.dev.yaml

Install Dapr and its components

  1. Install Redis

    helm install redis bitnami/redis -f .\redis.dev.yaml
  2. Install Dapr on Kubernetes

    helm install dapr dapr/dapr
  3. Install Dapr's components

    kubectl apply -f .\components
    

Deploy our services via Tye

  1. Tye deploy

    tye deploy ..\tye-k8s.yaml --interactive
  2. Notes: We'll be asked to input the following

    • Enter the connection string to use for service 'sqlserver':

      Data Source=sqlserver,1433;User Id=sa;Password=P@ssword;MultipleActiveResultSets=True

    • Enter the URI to use for service 'zipkin':

      http://zipkin-collector:9411/api/v2/spans

    • Enter the URI to use for service 'seq':

      http://seq:5341

  3. Add hosts

    127.0.0.1	seq.simplestore.local
    127.0.0.1	zipkin.simplestore.local
    
    127.0.0.1	product.simplestore.local
    127.0.0.1	graphql.simplestore.local
    

Deploy chart

Install Prometheus & Grafana

  1. Install Prometheus

    helm install dapr-prom stable/prometheus
  2. Install Grafana

    helm install grafana stable/grafana -f .\grafana.dev.yaml

Update hosts file

127.0.0.1	chart.simplestore.local

Configure data-source for Grafana

  1. Get password for admin account of Grafana

    $password = kubectl get secret grafana -o jsonpath="{.data.admin-password}"; [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($password))

    Grafana admin password

  2. Open browser at http://chart.simplestore.local with the following credential

    • Username: admin
    • Password: [get-from-previous-step]

    PLGTbcH6qOH0J99ls22V9rG6lNVAnxmbuO5Lf07O

  3. Click Configuration Settings -> Data Sources

    Add DataSource

  4. Configure for Prometheus DataSource

    Configure Prometheus Datasource

  5. Import dashboard

    Import Dashboard

How to use

  1. View Logging at http://seq.simplestore.local

  2. View Tracing at http://zipkin.simplestore.local

  3. View Charts at http://chart.simplestore.local

  4. Open http://graphql.simplestore.local; then use some examples in here

  5. To access sqlserver

    • Forward port 1433
      kubectl port-forward service/sqlserver 1433:1433
    • Use the following information to access
      • Server Name: 127.0.0.1,1433
      • Login: sa
      • Password: P@ssword

Cleanup

tye undeploy ..\tye-k8s.yaml

helm uninstall sqlserver redis seq zipkin nginx dapr dapr-prom grafana

kubectl delete -f .\components