Skip to main content

Posts

Showing posts from May, 2019

Secure nginx with Let's Encrypt on Ubuntu 18.04

Analize code with Sonar Scanner - Linux Guru

Setting Up the SonarCode Scanner.SonarQube's code scanner is a package that you can install on different machine, it's not good idea to install it with sonarqube server, You can install it on testing setver or in your local machine. There are packages available for Windows, MacOS, and Linux which you can find at the SonarQube web site. In the previous article we have setup Sonarqube server on kubernetes. Click here to read the post. Create a directory for sonar scannermkdir /opt/sonarscanner cd /opt/sonarscanner Download the SonarQube scanner for Linux using wget. you can download as per your OS.wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip Unzip, Extract the scanner.unzip sonar-scanner-cli-3.2.0.1227-linux.zip After that, we have to modify a few settings to get the scanner working with our server install. Edit the configuration file and un-comment the line starting with sonar.host.url and add yours. vim sonar-sca…

Deploy Sonarqube on Kubernete GCP - Linuxguru

Sonarqube deployment on Kubernetes GCP. Sonarqube is an opensource software for code analysis and code inspection utility. You can detect bugs, security vunerabilities and code smells using sonarqube analysis. it's support 20+ programming languages. In this tutorial I will deploy sonarqube on Kubernetes. So let's start the deploying. Prerequisites Sonarqube will require database, I am using postgres, You can use other database also. Bash/PowerShell terminal with kubectl installed PostgreSQL database to store SonarQube’s data Kubernetes cluster 1. Create Postgress DB GCP Cloud SQL.Click here to create postgress db along with username and password. 2. Generate base64 encoded password. Create a Secret to store PostgreSQL password, Kubernetes has a built-in capability to store secrets. To create a secret you need to base64 encode a secret value.

* Put your postgress db password here for encode. echo -n 'yourpassword' | base64 It will give you encode password , Copy the pa…

Configure Static IP Nginx ingress Kubernetes - Linux Guru

You have a web server running on kubernetes and expose it on a domain name and you need the external ip of an application to be a static ip that does not change. Reserve a new static IP address for INGRESS.Reserve a static external IP address named my-website-ip by run following command from your machine.$ gcloud compute addresses create my-website-ip --global here now we have reserved the static ip for the ingress, lets create ingress controller for the application and attached the static ip. lets create ingress file and describe the service name and static IP. $ ingress.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: yourappname-ingress annotations: kubernetes.io/ingress.global-static-ip-name: "my-website-ip" spec: backend: serviceName: mywebsite-service servicePort: 80 Apply the ingress file and check your app, It should be access by static IP and you should point that IP to your domain name.

Deploy Prometheus with Docker

Prometheus is an open-source systems monitoring and alerting toolkit, You can monitor various resources using Prometheus. Prometheus has multiple modes for visualisation data: a built-in expression browse. Download the promethes for linux. We will download the prometheus setup for linux and unzip the setup. https://github.com/prometheus/prometheus/releases/download/v2.7.1/prometheus-2.7.1.linux-amd64.tar.gz Untar setup.$ tar -xzf prometheus-2.7.1.linux-amd64.tar.gz Go to the directory.$ cd prometheus-2.7.1.linux-amd64 Now you can costumize you promethus.yml file and add some target into it and save the file. Create docker file. $ vim Dockerfile FROM prom/prometheus ADD . /etc/prometheus/ save the file. Build the Dockerfile.$ docker build -t prometheus:myversion . Now run the Docker image.$ docker run prometheus:myversion Now you can check from browser with port 9090.