Helm/SonarQube: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with " helm repo add sonarqube https://SonarSource.github.io/helm-chart-sonarqube helm repo update && helm repo list ==Config== <syntaxhighlight lang="properties"> export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/config" </syntaxhighlight> ==Install== {| |colspan="2"| <syntaxhighlight lang="yaml"> kubectl create namespace sonarqube helm show values sonarqube/sonarqube --version 10.6....")
 
Line 145: Line 145:
|-
|-
| valign="top" |
| valign="top" |
* [https://docs.openshift.com/container-platform/4.16/openshift_images/create-images.html#use-uid_create-images K8s » OpenShift » Arbitrary User Ids]
* [https://github.com/SonarSource/helm-chart-sonarqube/tree/master/examples/grafana SonarQube » Grafana]


| valign="top" |
| valign="top" |
Line 168: Line 168:


| valign="top" |
| valign="top" |
* [https://docs.openshift.com/container-platform/4.16/openshift_images/create-images.html#use-uid_create-images K8s » OpenShift » Arbitrary User Ids]
* [https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/ K8s » <code>kubectl rollout</code>]
* [https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/ K8s » <code>kubectl rollout</code>]



Revision as of 08:57, 30 July 2024

helm repo add sonarqube https://SonarSource.github.io/helm-chart-sonarqube
helm repo update && helm repo list

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

kubectl create namespace sonarqube
helm show values sonarqube/sonarqube --version 10.6.1+3163|less
cat <<YML | helm install -n sonarqube sonarqube sonarqube/sonarqube --version 10.6.1+3163 -f -
ingress:
  enabled: true
  hosts:
    - name: sonarqube.k8s.local
  annotations: 
    ingressClassName: nginx
OpenShift:
  enabled: false
postgresql:
  enabled: true
  postgresqlDatabase: "sonarqube"
  postgresqlUsername: "sonarqube"
  postgresqlPassword: "sadaqah!"
YML

  xdg-open http://sonarqube.k8s.local &>/dev/null &
gnome-open http://sonarqube.k8s.local &>/dev/null &
   x-www-browser http://sonarqube.k8s.local &>/dev/null &
sensible-browser http://sonarqube.k8s.local &>/dev/null &

Uninstall

helm uninstall -n sonarqube sonarqube
kubectl delete namespace sonarqube

Playground

helm install -n sonarqube    sonarqube sonarqube/sonarqube --version 10.5.1+2816
helm upgrade -n sonarqube -i sonarqube sonarqube/sonarqube --version 10.6.1+3163
helm show values sonarqube/sonarqube --version 10.5.1+2816|less

kubectl exec -n sonarqube -it svc/sonarqube-postgresql -c sonarqube-postgresql -- bash
kubectl exec -n sonarqube -it svc/sonarqube-sonarqube  -c sonarqube-sonarqube  -- bash
kubectl exec -n sonarqube -it svc/sonarqube-sonarqube  -c init-sysctl -- bash
kubectl exec -n sonarqube -it svc/sonarqube-sonarqube  -c init -- bash
kubectl exec -n sonarqube -it sonarqube-postgresql-0 -- bash
kubectl exec -n sonarqube -it sonarqube-sonarqube-0  -- bash

kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl delete all --all -n sonarqube
kubectl delete ing --all -n sonarqube
kubectl delete sts --all -n sonarqube
kubectl delete svc --all -n sonarqube
kubectl delete pvc --all -n sonarqube
kubectl delete pv  --all -n sonarqube

kubectl rollout -n sonarqube history sts sonarqube-sonarqube
kubectl rollout -n sonarqube restart sts sonarqube-sonarqube
kubectl rollout -n sonarqube status  sts sonarqube-sonarqube
kubectl exec -n sonarqube -it sonarqube-postgresql-0 -- psql -Usonarqube
kubectl logs -n sonarqube -f  sonarqube-postgresql-0
kubectl logs -n sonarqube -f  sonarqube-sonarqube-0

References