<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dzung Nguyentat on Medium]]></title>
        <description><![CDATA[Stories by Dzung Nguyentat on Medium]]></description>
        <link>https://medium.com/@dungnt081191?source=rss-be4de577ea95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-hgXaZbNJZsl5BPF</url>
            <title>Stories by Dzung Nguyentat on Medium</title>
            <link>https://medium.com/@dungnt081191?source=rss-be4de577ea95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:04:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dungnt081191/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[[GitlabCI/PartII] Gitlab CI/CD with Kubernetes from Develop env to Production env]]></title>
            <link>https://medium.com/@dungnt081191/gitlabci-partii-gitlab-ci-cd-with-kubernetes-from-develop-env-to-production-env-b2e072aa84f5?source=rss-be4de577ea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2e072aa84f5</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[gitlab-runner]]></category>
            <dc:creator><![CDATA[Dzung Nguyentat]]></dc:creator>
            <pubDate>Sat, 09 Mar 2019 08:16:46 GMT</pubDate>
            <atom:updated>2019-03-23T05:44:16.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part II: Integrate tools with GitlabCI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m0OqrisBwZ2HPpHytHVGA.png" /></figure><blockquote>Like my tittle , this instruction is Full CI/CD process using Gitlab CI tool and I will show the way to integrate with each other tool using in this topic. Have a good work.</blockquote><h3>Tool have to integrate with Gitlab in this instruction:</h3><ol><li>SonarQube server( can run via Docker / install from source )</li><li>SonarQube scanner ( in Gitlab pipeline)</li><li>Gitlab runner ( can run via Docker/ install from source )</li><li>Google Cloud Platform ( enable GCR/GKE )</li><li>Slack for Gitlab build notification</li></ol><p>In this topic, the working flow describe detail about Gitlab CI/CD pipeline trigger Gitlab Runner run the Job and how Runner run.</p><h3>Overview process:</h3><ol><li>Developer push the code change to Gitlab Repo</li><li>Gitlab CI run jobs with detail step below:</li></ol><ul><li>Compile code</li><li>Unit test</li><li>Code analysis</li><li>Package code</li><li>Build an Image included latest code</li><li>Push image to Gitlab Container Registry/Google Container Registry (GCR)</li><li>Deploy on develop environment using docker image from Gitlab Container Registry</li><li>Deploy on production environment using docker image from GCR ( in the same image )</li><li>Push notification about build result to Chat tool ( in this case using Slack)</li></ul><h3>Let’s begin !</h3><p>Here is Source Code Structure for this concept to make you easier to understand :(<strong>Bold</strong> is Folder )</p><p>├── <strong>docker</strong><br>│ ├── Dockerfile<br>│ ├── <strong>nginx</strong><br>│ │ ├── nginx-vhost.conf<br>│ │ └── <a href="http://www.conf/">www.conf</a><br>│ └── <strong>supervisord</strong><br>│ ├── start.sh<br>│ └── supervisord.conf<br>├── <strong>public</strong><br>├── sonar-project.properties</p><h3>1 — Integrate SonarQube server</h3><p>The integration is from Sonar Scanner to Sonar Server.</p><p>To integrate with each other, we need a file : <strong>sonar-project.properties</strong> with form below:</p><p>sonar.projectKey=WhateverNameYouWant<br>sonar.projectVersion=1.0<br>sonar.login=admin<br>sonar.password=admin<br>sonar.exclusions=vendor/**/*, node_modules/**/8, coverage/**/*<br>sonar.language=php<br>sonar.sources=.<br>sonar.sourceEncoding=UTF-8<br>sonar.importSources=true<br>sonar.coverity.enable=false<br>sonar.gitlab.project_id=git@gitlab.local:your/own/project.git</p><p>After have <strong>sonar-project.properties </strong>file, remember to keep it in SourceCode directory in Gitlab repo — can double check in SourceCode structure above.</p><h3>2 — SonarQube scanner</h3><blockquote>We will use SonarQube scanner only in Gitlab Pipeline , so now please ignored this.</blockquote><h3><strong>3— Integrate Gitlab Runner</strong></h3><p>step2+3: Register runner integrate with Gitlab Local server using gitlab URL + gitlab registration token above , for quick register — we can use this command below</p><p>gitlab-runner register -n \<br> — url <a href="http://gitlab.local/">http://gitlab.local/</a> \<br> — registration-token UWoaboBsgRxjf_ckqCU7 \<br> — executor docker \<br> — description “Runner for test laravel 58.10” \<br> — docker-image “docker:latest” \<br> — docker-volumes /var/run/docker.sock:/var/run/docker.sock</p><p>Describe command:</p><ul><li>URL &amp; registration-token: get from Gitlab Server&gt; go to Project &gt;Setting &gt; CI/CD &gt; Runner as picture below</li><li>Executor: in this case , we use Docker as executor of Gitlab Runner. Wanna know more detail about Gitlab Runner . Please refer to <a href="https://docs.gitlab.com/runner/executors/"><strong>thisLink</strong></a> or <strong>thisLink(</strong><em>by my own — publish soon</em><strong>)</strong> to know more about it.</li><li>Description: Should note about IP or someword to make we know which runner in use in the list when show by <strong>gitlab-runner list</strong> command.</li><li>docker-image: define the default image in use when running gitlab-runner</li><li>docker-volumes: advance config with sharing docker.sock from host to gitlab-runner to let Runner using Docker service from host machine.</li><li>And some configure in below , please keep moving !</li></ul><p><em>then update some information in gitlab runner configure file — but wait ! , how do we know where do system keep gitlab runner configure file ?. use this command to check it out :</em></p><p><em>command: </em><strong>gitlab-runner list</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFFW3kdhyx-OhXnQKY4j2Q.png" /><figcaption>With Gitlab Runner , we can register more than one Runner — in this list , we can see 4 different Runners.</figcaption></figure><p><em>then we can get the configure dir at : </em><strong><em>/etc/gitlab-runner/config.toml</em></strong></p><p><em>add lines in [runner] &amp; [runners.docker] block like below:</em></p><p>output_limit = 32096<br> [runners.docker]<br> privileged = true<br> volumes = [“/var/run/docker.sock:/var/run/docker.sock”, “/cache”, “/root/.docker/config.json:/root/.docker/config.json”]<br> extra_hosts = [“gitlab.local:192.168.0.103”]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sga4X2wq22HHW-TGVDfpAw.png" /></figure><p>Describe :</p><ul><li>concurrent : the process runner can do, if 1 : only 1 job in Gitlab pipeline can run , another job is pending ( waiting job in process finish )</li><li>output_limit: is the log capacity in one job of gitlabCI , by default = 4Mb, we should increase to avoid the GitlabCI job fail by run out of memory.</li><li>volumes: by default , Runner with Docker executor volume 2 values if docker.sock &amp; cache , we can volume one more file is <strong>config.json like picture above</strong> — the file keep credential key to login into docker registry when need to authorize with to push/pull docker images from Docker private registry/Gitlab container registry.</li><li>extra_hosts: we need this value to make Gitlab Runner can connect to Gitlab Server when Gitlab Server using hostname. In this case , gitlab server configure the external_url = <a href="http://gitlab.local./"><strong>http://gitlab.local.</strong></a> Double check in <strong>Part I : gitlab configure file</strong> <strong>section.</strong></li></ul><p><em>then , we can back to Gitlab.local server , now in Runner tab , new registered Runner appear below</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2Grtb2kH9vgeMCXVpAftw.png" /><figcaption>Runner for test local develop with GREEN color has been registered successfully.</figcaption></figure><h3><strong>4— Integrate Google Cloud Platform</strong></h3><p>Precondition:</p><ul><li>3.1: We need to have access to Google Cloud Platform project which connected to billing account.</li><li>3.2: We must enable Google APIs for Google Compute Engine &amp; Google Container Builder</li></ul><p>After have 2 precondition above , go ahead to get this magic — The integration from Local server to Google Cloud Platform!!!</p><p>To do this magic — we have to do 4 step:</p><ul><li><strong>step1:</strong> Create Google Service Account</li><li><strong>step2:</strong> Create Google Cluster in your Google Cloud project</li><li><strong>step3:</strong> Install Google Cloud SDK &amp; kubeadm, kubelet, kubectl tools</li><li><strong>step4:</strong> Add the Kubernetes cluster we created above to Gitlab project in Gitlab server</li></ul><p>Here we go !</p><h3>Step1: Create Google Service Account</h3><p>We need to create Google Service Account with 3 roles as below:</p><ul><li>Viewer</li><li>Cloud Builder Editor</li><li>Storage Admin</li></ul><p>How can we do that — where can i find this configure to create Google Service Account ? :</p><ul><li>Go to your IAM in your project : <a href="https://console.cloud.google.com/iam-admin/serviceaccounts">Google Cloud IAM function &gt; Service Accounts</a></li><li>Create a Service Account with 3 roles above &amp; use your own name , follow like pictures below and “DONE”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*udzKnfiWDWYA0dTMqU3QqA.png" /><figcaption>choose <strong>IAM &amp; admin</strong> on the Left side bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*BHDBKwdL_XiqugjDtz0Yqw.png" /><figcaption>choose <strong>IAM</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*JZ_IA2Wt5Nf5szsu14nyIQ.png" /><figcaption>click CREATE SERVICE ACCOUNT above</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ef8c05d_rYApvlHHlYtb2g.png" /><figcaption>set your own server name , next and let’s choose 3 roles mentioned above.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BuDMQRAU7i83N9ooNnxpsA.png" /><figcaption>Viewer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1FeGMDtDs9M1zbvWT8lYQ.png" /><figcaption>Cloud Build Editor</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRLQ_WcKhC6ZNGaIGYH5WA.png" /><figcaption>Storage Admin</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSiPA-1wdZeex43jXtk79A.png" /><figcaption>verify before continue.</figcaption></figure><p>And Choose “Furnish a new private key ” with JSON format, JSON key has been automatically download to your machine. <strong>Keep it and we will use it later .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*2TTudXiW3x-Gig0Q4Exvuw.png" /><figcaption>choose JSON format</figcaption></figure><h3>Step 2 : Create Google Kubernetes Cluster in your Google Cloud project</h3><p>Now move to your Google Cloud project , choose Google Kubernetes Engine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*q-kDVO8kuOwhsDkwrm_hBQ.png" /><figcaption>choose <strong>Cluster</strong></figcaption></figure><p>Maybe we have to wait a few minutes for Google prepare &amp; enable Kubernetes Engine API &amp; Click <strong>Create Cluster </strong>button like picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vstuRDbEVy3GiyTNkwrfQ.png" /><figcaption>waiting a few minutes and Click <strong>Create Cluster</strong> button</figcaption></figure><p>Set some value of your Cluster:</p><ul><li>Name</li><li>Number of Node ( the number of Slave Node )</li><li>Machine type ( can use default config or set whatever you want )</li><li><em>Note</em> : go to the bottom of the page , choose <strong>Advance option</strong> &amp; Tick to <strong>Enable legacy authorization</strong> option</li></ul><p>&gt;&gt; Click <strong>Create</strong> button and Waiting Google creating your own Kubernetes Cluster.<strong> Just wait , one more step needed :</strong></p><p>After your own Cluster is UP , click and save your credentials ( user/password/Cluster CA Certificate ) — we will need it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*BivZFQycoGakCZ3bqpvf6A.png" /><figcaption>click Show Credentials to view</figcaption></figure><p>Bingo — you finish step2. Keep moving to step3 !</p><h3>Step3: Install Google Cloud SDK &amp; kubeadm, kubelet, kubectl tools</h3><p>Why Google Cloud SDK ?.</p><p>In this case , we use Google Cloud SDK &amp; kubectl tool to run command from local machine to Google Kubernetes Cluster.</p><blockquote>That’s mean we <strong>do not need </strong>to go directly to Google Kubernetes Cluster and access Master node via Google Cloud Shell — That’s great ,right?. Google Cloud Shell is too slow to use and we need run some commands from local so……… Why don’t throw that shit and we can use pretty much kubectl command from local. Awesome !</blockquote><ul><li>Use google official document to install Google SDK : <a href="https://cloud.google.com/sdk/install"><strong>ThisLink</strong></a>.</li><li>And install kubectl by command : <strong>gcloud components install kubectl</strong></li></ul><p>Comeback to your Google Cluster and get some values :</p><ul><li>ClusterName : in this case is “<strong>standard-cluster-1</strong>”</li><li>ClusterURL: is Endpoint IP in cluster information below with https://</li><li>User: step above we already got this , all in picture below</li><li>Password: step above we already got this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*JscTCNTKuQMGDcEsIzU13w.png" /><figcaption>Click “Show Credentials” to view user/password</figcaption></figure><p>Let’s do some quick test from local to make sure integration process is success:</p><ul><li>kubectl config set-cluster {ClusterName} — server=”{ClusterURL}” — insecure-skip-tls-verify=true</li><li>kubectl config set-credentials cluster-admin — username=”{User}” — password=”{Password}”</li><li>kubectl config set-context default — cluster={ClusterName} — user=cluster-admin</li><li>kubectl config use-context default</li><li>kubectl get secrets</li><li>kubectl describe secrets</li></ul><p>Describe command:</p><ul><li>1st command : provide Cluster name and URL for google cloud SDK to connect to Kubernetes Cluster</li><li>2nd command : provide user/password to authorize with Kubernetes Cluster</li><li>3rd command: Set Cluster name into set-context — we can know as the profile we create to use to connect to Kubernetes Cluster. We can use command :<strong>kubectl config view </strong>to show kube config setting.</li><li>4th command: Set to use default context</li><li>5th command: Get the list of secret token</li><li>6th command : Get the token from terminal</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*29axirwTczFbZ25fY5Rs2A.png" /></figure><p>Done — Good working , Please keep moving to step4.</p><h3><strong>step4:</strong> Add the Kubernetes cluster we created above to Gitlab project in Gitlab server.</h3><p>Here we go</p><ul><li>Access Gitlab server from browser &gt; Project &gt; Operations &gt;Kubernetes</li><li>Click “Add Kubernetes Cluster”</li><li>Click “Add an exist Kubernetes Cluster”</li><li>Fill the informations with values you got in above step.</li></ul><p>And Finally , Save the config and go to install Application required for your Kubernetes Cluster:</p><p>1 — Helm Tiller</p><p>2 — Ingress</p><p>3 — Gitlab-Runner</p><p>4 — Prometheus</p><h3>5 — Slack for Gitlab build notification</h3><p>In every pipeline build, we need to know immediate the result of Gitlab pipeline after run. In this case, We use Slack to get notification from Gitlab.</p><p>If you don’t know about Slack at all, please go to this <a href="https://slack.com/features"><strong>link</strong></a> to install/know about Slack.</p><p>Create an account, Create your own Channel.</p><blockquote>!!! Congratulations ! — You all has been done the integration !!!</blockquote><blockquote>Now please moving Part III to create your own Gitlab CI pipeline .</blockquote><blockquote>Thank you so much — Have a good day !</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2e072aa84f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[GitlabCI/PartI] Gitlab CI/CD with Kubernetes from Develop env to Production env]]></title>
            <link>https://medium.com/@dungnt081191/gitlab-ci-cd-with-kubernetes-from-develop-environment-local-server-to-production-environment-57174ff593e9?source=rss-be4de577ea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/57174ff593e9</guid>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[gitlab-runner]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Dzung Nguyentat]]></dc:creator>
            <pubDate>Mon, 04 Mar 2019 16:09:53 GMT</pubDate>
            <atom:updated>2019-03-15T03:46:21.112Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part I : Install perquisite tools</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzzaX26HakT1LtCYe2tSTA.jpeg" /></figure><blockquote>Like my tittle , this instruction is Full CI/CD process using Gitlab CI tool and I will show the way to integrate with each other tool using in this topic. Have a good work.</blockquote><h3>Tool using in this instruction:</h3><ol><li>Gitlab CI local server ( can run via Docker/install from source )</li><li>Virtual Box to simulate a develop environment ( in this topic using Ubuntu 16.04, you can use whatever you want)</li><li>SonarQube server( can run via Docker / install from source )</li><li>SonarQube scanner ( in Gitlab pipeline)</li><li>Gitlab runner ( can run via Docker/ install from source )</li><li>Google Cloud Platform ( enable GCR/GKE )</li></ol><p>In this topic, I will show you the working flow describe detail about Gitlab CI/CD pipeline trigger Gitlab Runner run the Job and how Runner run.</p><h3>Overview process:</h3><ol><li>Developer push the code change to Gitlab Repository.</li><li>Gitlab CI run jobs with detail step below:</li></ol><ul><li>Compile code</li><li>Unit test</li><li>Code analysis</li><li>Package code</li><li>Build an Image included latest code</li><li>Push image to Gitlab Container Registry/Google Container Registry (GCR)</li><li>Deploy on develop environment using docker image from Gitlab Container Registry</li><li>Deploy on production environment using docker image from GCR ( in the same image )</li><li>Push notification about build result to Chat tool ( in this case using Slack)</li></ul><h3>Let’s begin !</h3><h3>1 — Set up Gitlab CI local server</h3><p>Let’s do this with the easiest way : Use Docker service , Run this command below :</p><p>docker run — detach — name gitlab \<br> — hostname gitlab.local \<br> — publish 80:80 \<br> — publish 30022:22 \<br> — publish 5005:5005 \<br> — env GITLAB_OMNIBUS_CONFIG=”external_url ‘http://gitlab.local&#39;; gitlab_rails[‘gitlab_shell_ssh_port’]=30022;” \<br> — volume /path/whatever/you/want/to/mount/config:/etc/gitlab \<br> — volume /path/whatever/you/want/to/mount/logs:/var/log/gitlab \<br> — volume /path/whatever/you/want/to/mount/data:/var/opt/gitlab \<br> gitlab/gitlab-ce:latest</p><p>Describe command: Above command run with some options like :</p><ul><li>name : Run a gitlabce container with name is : gitlab.</li><li>hostname: publish a hostname for container with : gitlab.local , we can modify by any name.</li><li>publish: we use some ports like 80,22 and an extra option is 5005 for Gitlab container registry we set up later. If you do not publish this 5005 port, maybe Setting later.</li><li>volume : to keep gitlab data in local machine for backup, setting in <strong>Part II.</strong></li></ul><p>Check Gitlab container status : Up &amp; Healthy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6C4O6BQEHVoTNm75ZAHpQ.png" /><figcaption>command : docker ps</figcaption></figure><p>If you don’t have Docker service yet , check this <strong>link</strong>to get the official install instruction from Docker.</p><p>In this instruction , I use Gitlab server’s hostname : <strong>gitlab.local</strong>. We can access Gitlab server local via “http://localhost” immediately or “http://gitlab.local” after:</p><p>1 — update hosts file at directory <strong>“/etc/hosts”</strong></p><p>2 — update <strong>gitlab.rb </strong>setting file in <strong>“/path/whatever/you/want/to/mount/config”</strong></p><p>Here is<strong>/etc/hosts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*h6ALZgZMzHKKggdT0cAxuw.png" /><figcaption>command : vim /etc/hosts</figcaption></figure><p>Here is <strong>gitlab.rb</strong>in <strong>“/path/whatever/you/want/to/mount/config”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*VN9G4rzB7bk1WVThYP1JAg.png" /><figcaption>command: vim gitlab.rb</figcaption></figure><p>Update with line below :</p><p>#using gitlab hostname , we can use IP:port if needed<br><strong>external_url ‘http://gitlab.local&#39;</strong><br>#custom artifacts size maximum — need when project have large artifact<br><strong>gitlab_rails[‘artifacts_maximum_upload_size_MB’] = 1024</strong><br>#able to use gitlab Container Registry , this function hidden by default <br>#if wanna use gitlab container registry , we have to enable some config below<br><strong>registry_external_url ‘http://gitlab.local:5005&#39;<br>registry_nginx[‘enable’] = true<br>registry_nginx[‘listen_port’] = 5005</strong></p><p>Done ! — now check it out from browser ! — Create your own password for user default is <strong>root.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O_xDmRkruLeZDXncXhpVyg.png" /><figcaption>bingo, Gitlab Local server by Docker is UP !</figcaption></figure><h3><strong>2 — Virtual Box — Ubuntu 16.04</strong></h3><p>It’s easy to create a VM by your self, I just highlight some things we should have :</p><ul><li>Set static IP for VM, in this case — we use :</li></ul><p>IP : <strong>192.168.58.4</strong></p><p>SubnetMask: <strong>255.255.255.0</strong></p><blockquote><em>We should use static IP for VM because if not, it will change in everytime we start VM &gt;&gt; make the integration between tools broken after setting up.</em></blockquote><p>To use static IP in Ubuntu VM : modify<strong>/etc/network/interfaces </strong>using your favourite editor tool like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*GdqbAxkjJvRGRH-bwmCb-Q.png" /><figcaption>command : <strong>vim /etc/network/interfaces </strong>and add lines like picture with your own IP</figcaption></figure><ul><li>set unique hostname of VM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*VxNEeHC_KdwrVqkPeE0RNQ.png" /><figcaption>command: <strong>vim /etc/hostname </strong>and update from “localhost” to “whatever name you want”</figcaption></figure><ul><li>Network : 2 adapter — 1st is Nat , 2nd is Host-only</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*iTg_fGuGR6qjEOa1u6rWRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*hhQaIhFovR_BEYBy2FAXtA.png" /></figure><ul><li>Docker/Gitlab runner has been installed on this VM ( Because we’re simulate this is the Develop environment server in this concept )</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CVRFSnHhUqhshEEpCa6GPg.png" /><figcaption>after installed Docker/ Gitlab Runner , verify status of both services. about detail configure Gitlab Runner , please check in bottom of topic</figcaption></figure><h3><strong>3 — SonarQube server</strong></h3><p>We’re still using the easiest way to use Sonarqube server : via Docker !!!</p><p>using command from <a href="https://hub.docker.com/_/sonarqube">Sonar official</a> on Docker Hub to start Sonarqube server on local machine:</p><p>docker run -d --name sonarqube -p 9000:9000 sonarqube</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fc_-oJwK3s2YdIHTQj_GRw.png" /><figcaption>command : <strong>docker ps </strong>to check status of sonarqube service</figcaption></figure><p>After Sonarqube container is UP, we can access Sonarqube server via browser with “<strong>localhost:9000</strong>” and using default <strong>user/password : admin/admin</strong> to sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IgP7VHeVHuJmuXNCjJJuw.png" /></figure><h4>4 — SonarQube scanner ( We use it in Gitlab CI pipeline, and we ignored it now)</h4><h3>5 — Gitlab Runner ( can run via Docker/ Install from source )</h3><p>Gitlab Runner can install in every machine, in this instruction we install Gitlab Runner in develop environment ( VM ).</p><p>First step , go to Gitlab CI &gt;&gt; select Project &gt;&gt; select Setting &gt;&gt; select CI/CD &gt;&gt; select <strong>Runner</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAZsqFGx2eMohFisQ9Nang.png" /></figure><p>Now , Focus on block <strong>Set up a specific Runner manually </strong>and follow 4 step</p><p>step1 : install Gitlab Runner on Develop Environment — in this case it’s VM machine : IP <strong>192.168.58.4 </strong>(repeat : we can install Gitlab in every machine we have, of course it need in the same IP range of each other)</p><p>Use official install instruction from Docker at <a href="https://docs.gitlab.com/runner/install/linux-manually.html">here</a> to install Gitlab Runner, verify gitlab runner running status by command : <strong>gitlab-runner status</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXAAP8UR44qtPM4Jw2IoyQ.png" /></figure><p>from now , Gitlab Runner already to register to integrate with Gitlab server , please move to Part II : integrate tools with Gitlab CI to register Runner for this project.</p><h3>6 — Google Cloud Platform ( enable GCR/GKE )</h3><p><em>Step1: </em>Create google Could Platform account with this <a href="https://cloud.google.com/"><strong>link</strong></a></p><p>And Create the first Google Cluster in Google Kubernetes Engine <strong>( remember it’s not Google Compute Engine )</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYURhfokIZtrqHHXg80ggA.png" /></figure><p><em>then we will need some credentials information to integrate with Gitlab local server . Have many way to connect to GKE cluster from local , in this topic , we will use google SDK and kubelet, kubeadm, kubectl tools to connect GKE cluster from local.</em></p><p><em>Step2: Please move to PartII to integrate from local server to Google Cloud ( Google Kubernetes Cluster ) using Google SDK &amp; kubeadm,kubectl, kubelet tools.</em></p><blockquote><em>Nice work !</em></blockquote><blockquote><em>From Now , We are completed install tools for Gitlab CI/CD . Please move to </em><a href="https://medium.com/@dungnt081191/gitlabci-partii-gitlab-ci-cd-with-kubernetes-from-develop-env-to-production-env-b2e072aa84f5"><strong><em>Part II</em></strong></a><em> to implement GitlabCI/CD.</em></blockquote><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57174ff593e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>