Chapter 22 nine analysis takes you through helm3 sonarqube

This series:


Chapter 1: Nine analysis takes you easy to finish the installation of helm3

The second chapter: Nine analysis takes you to the public warehouse of helm3

The third chapter: Nine analysis takes you through the explosion of helm3 private warehouse easily

The fourth chapter: Nine analysis takes you easy

The fifth chapter: Nine analysis takes you easy to finish helm3 release

The sixth chapter: Nine analysis takes you through helm3 gitlab easily

The seventh chapter: Nine analysis takes you through helm3 nginx ingress

The eighth chapter: Nine analysis takes you through helm3 gitlab nfs easily

The ninth chapter: Nine analysis takes you through helm3 nexus

The tenth chapter: Nine analysis takes you through helm3 heapster

Chapter 11: Nine analysis takes you through helm3 kubernetes dashboard

Chapter 12: Nine analysis takes you through helm3 harbor

Chapter 13: Nine analysis takes you through helm3 prometheus easily

Chapter 14: Nine analysis takes you through helm3 grafana

Chapter 15: Nine analysis takes you easy to finish

Chapter 16: Nine analysis takes you through helm3 efk - elastic search

Chapter 17: Nine analysis takes you through helm3 efk - kibana

Chapter 18: Nine analysis takes you through helm3 efk - Fluent

Chapter 19: Nine analysis takes you easy to install helm3 istio

Chapter 20: Nine analysis takes you through helm3 mysql easily

Chapter 21: Nine analysis takes you easy to finish helm3 zookeeper

Chapter 22: Nine analysis takes you through helm3 sonarqube

Catalog


1 Preface

If you encounter problems in the operation process, you can add my wechat consultation.

In this paper, helm3 v3.0.0; k8s v1.16.3 are used. Helm warehouse information is as follows:

2 download sonarqube

helm search sonarqube:

helm search repo sonarqube

Download and unzip:

helm fetch google/sonarqube

tar -zxvf sonarqube-3.2.7.tgz

3 Create namespace

kubectl create ns sonarqube

4 modify configuration

Edit the sonarqube/values.yaml file.

Modify the ingress section as follows:

Modify the database:

5 install sonarqube

The first sonarqube is the namespace, the second is the helm release name, and the third is the sonarqube extraction Directory:

helm install -n sonarqube sonarqube sonarqube

5.1 modify deployment apiVersion

If the installation process reports an error as follows:

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"

Execute the following statement to finish the explosion easily:

grep -irl 'extensions/v1beta1' sonarqube/ | xargs sed -i 's#extensions/v1beta1#apps/v1#g'

5.2 add selector

If the following error is reported during re installation:

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec

Edit the file sonarqube/charts/postgresql/templates/deployment.yaml:

Edit the file sonarqube/charts/mysql/templates/deployment.yaml:

5.3 modify address apiversion

If the following error is reported during re installation:

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "apps/v1"

Modify the file sonarqube/templates/ingress.yaml:

The installation was successful as follows:

However, a successful installation does not mean a successful operation. You need to configure the storage.

6 install nfs server

How to install the nfs server, please refer to me< Easy completion of nfs installation >Don't worry. It's easy to explode. It's easy for you to finish blasting in minutes.

mkdir -p /data/nfs/sonarqube/8g

chmod 777 -R sonarqube

echo "/data/nfs/sonarqube 10.110.0.0/16(rw,sync,no_root_squash)" >> /etc/exports

systemctl restart nfs

7 create pv

Create the pv-sonarqube-8g.yaml file:

apiVersion: v1

kind: PersistentVolume

metadata:

    name: pv-sonarqube-8g

spec:

    capacity:

        storage: 8Gi

    volumeMode: Filesystem

    accessModes:

    -  ReadWriteOnce

    persistentVolumeReclaimPolicy: Retain

    nfs:

        server: 10.110.101.106

        path: /data/nfs/sonarqube/8g

8 create secret

8.1 create a self signed certificate

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./tls.key -out ./tls.crt -subj "/CN=jiuxi.sonarqube.org"

8.2 generate secret based on certificate

kubectl -n sonarqube create secret tls sonarqube-tls --key ./tls.key --cert ./tls.crt

9 validation of sonarqube

Open the browser, and input https://jiuxi.sonarqube.org (edit / etc/hosts, add custom domain name resolution, note that IP is the IP of the host where nginx ingress controller pod is located, remember).

Click "Login in", the default username and password of sonarqube is: admin/admin

Since then, the helm3 sonarqube installation is easy to complete.

Tags: Linux Kubernetes GitLab Nginx MySQL

Posted on Thu, 16 Jan 2020 13:34:51 -0500 by reli4nt