<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="http://ammarun.my.id/feed.xml" rel="self" type="application/atom+xml" /><link href="http://ammarun.my.id/" rel="alternate" type="text/html" /><updated>2023-12-13T16:34:09+07:00</updated><id>http://ammarun.my.id/feed.xml</id><title type="html">My Personal Ngoprek Problems &amp;gt;_</title><subtitle>My name is Ammar and this is my personal blog, documenting my journey on the quest to become the best person I can be.</subtitle><author><name>&gt;_</name></author><entry><title type="html">[k8s] OKD Virtualization Automate VMs with Tekton Pipelines - part 3</title><link href="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part3/" rel="alternate" type="text/html" title="[k8s] OKD Virtualization Automate VMs with Tekton Pipelines - part 3" /><published>2023-12-13T00:00:00+07:00</published><updated>2023-12-13T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part3</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part3/">&lt;h2 id=&quot;okd-virtualization-and-tekton-pipelines&quot;&gt;OKD Virtualization and Tekton Pipelines&lt;/h2&gt;
&lt;p&gt;Let’s continue demonstrating the automation of virtual machines with Tekton pipelines. I’ll provide step-by-step instructions in a video so you can follow the details of each step easily.&lt;/p&gt;

&lt;h2 id=&quot;ubuntu-vms&quot;&gt;Ubuntu VMs&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=mQNSNQnk5BQ&quot; title=&quot;Automate Ubuntu VM with Tekton Pipeline&quot;&gt;&lt;img src=&quot;https://img.youtube.com/vi/mQNSNQnk5BQ/0.jpg&quot; alt=&quot;Automate Ubuntu VM with Tekton Pipeline&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;windows-vms&quot;&gt;Windows VMs&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=IyhbxN2p474&quot; title=&quot;Automate Windows VM with Tekton Pipeline&quot;&gt;&lt;img src=&quot;https://img.youtube.com/vi/IyhbxN2p474/0.jpg&quot; alt=&quot;Automate Windows VM with Tekton Pipeline&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.okd.io/4.13/virt/about-virt.html&quot;&gt;OKD Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="kubernetes" /><category term="openshift" /><category term="okd" /><category term="Jekyll" /><category term="update" /><summary type="html">OKD Virtualization and Tekton Pipelines Let’s continue demonstrating the automation of virtual machines with Tekton pipelines. I’ll provide step-by-step instructions in a video so you can follow the details of each step easily.</summary></entry><entry><title type="html">[k8s] OKD Virtualization Automate VMs with Tekton Pipelines - part 2</title><link href="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part2/" rel="alternate" type="text/html" title="[k8s] OKD Virtualization Automate VMs with Tekton Pipelines - part 2" /><published>2023-12-11T00:00:00+07:00</published><updated>2023-12-11T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part2</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part2/">&lt;h3 id=&quot;okd-virtualization-and-tekton-pipelines&quot;&gt;OKD Virtualization and Tekton Pipelines&lt;/h3&gt;
&lt;p&gt;Let’s continue discussing OKD Virtualization. Now, I’ll show you how we can automate the setup and customization of VMs in OKD Virtualization using Tekton Pipelines.&lt;/p&gt;

&lt;h3 id=&quot;tekton-pipeline&quot;&gt;Tekton Pipeline&lt;/h3&gt;
&lt;p&gt;Tekton is an open-source cloud-native Continuous Integration and Continuous Delivery/Deployment (CI/CD) solution. It simplifies deployments across various platforms by abstracting the underlying implementation details.&lt;/p&gt;

&lt;p&gt;Tekton introduces several standard Custom Resource Definitions (CRDs) for defining CI/CD pipelines that can be used across different Kubernetes distributions.&lt;/p&gt;

&lt;h3 id=&quot;how-tekton-works&quot;&gt;How Tekton Works?&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd11.png&quot; alt=&quot;image11&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Task: It defines a set of build steps, such as compiling code, running tests, and building and deploying images.&lt;/li&gt;
  &lt;li&gt;Pipeline: It defines the set of tasks that make up a pipeline.&lt;/li&gt;
  &lt;li&gt;PipelineResource: It defines an object that serves as an input (e.g., a Git repository) or an output (e.g., a Docker image) of the pipeline.&lt;/li&gt;
  &lt;li&gt;PipelineRun: It instantiates a Pipeline for execution with specific inputs, outputs, and execution parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;kubevirt-tekton-tasks&quot;&gt;Kubevirt Tekton tasks&lt;/h3&gt;
&lt;p&gt;KubeVirt Tekton tasks offer specific Tekton tasks designed for OpenShift Virtualization. These tasks primarily focus on:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Creating, updating, and managing KubeVirt resources (such as VMs, DataVolumes, DataSources, and Templates).&lt;/li&gt;
  &lt;li&gt;Performing operations on disk images using libguestfs tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;List of Kubevirt Tekton tasks:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Create Virtual Machines
    &lt;ul&gt;
      &lt;li&gt;create-vm-from-manifest - create VM from yaml manifest&lt;/li&gt;
      &lt;li&gt;create-vm-from-template - create VM from template&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Utilize Templates
    &lt;ul&gt;
      &lt;li&gt;copy-template - copy template&lt;/li&gt;
      &lt;li&gt;modify-vm-template - update template metadata&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Create DataVolumes/DataSources
    &lt;ul&gt;
      &lt;li&gt;create-datavolume-from-manifest (4.11) - create dataVolume&lt;/li&gt;
      &lt;li&gt;modify-data-object (&amp;gt;= 4.12) - create/delete dataVolume/dataSource&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Generate SSH Keys
    &lt;ul&gt;
      &lt;li&gt;generate-ssh-keys - generate SSH keys and store them in cluster&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Execute Commands in Virtual Machines
    &lt;ul&gt;
      &lt;li&gt;execute-in-vm: execute commands over SSH&lt;/li&gt;
      &lt;li&gt;cleanup-vm: execute commands and/or stop/delete VMs&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Manipulate PVCs with libguestfs tools
    &lt;ul&gt;
      &lt;li&gt;disk-virt-customize: execute virt-customize commands in PVCs&lt;/li&gt;
      &lt;li&gt;disk-virt-sysprep: execute virt-sysprep commands in PVCs&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Wait for Virtual Machine Instance Status
    &lt;ul&gt;
      &lt;li&gt;wait-for-vmi-status - wait for VM status&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/kubevirt/kubevirt-tekton-tasks&quot;&gt;https://github.com/kubevirt/kubevirt-tekton-tasks&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;setup-tekton-tasks-operator&quot;&gt;Setup Tekton Tasks Operator&lt;/h3&gt;

&lt;p&gt;install tekton operator&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ export TEKTON_VERSION=v0.65.1
$ oc apply -f  &quot;https://github.com/tektoncd/operator/releases/download
/${TEKTON_VERSION}/openshift-release.yaml&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;enable tekton task from okd hco&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ oc patch hco kubevirt-hyperconverged -n kubevirt-hyperconverged --type=merge -p '{&quot;spec&quot;:{&quot;featureGates&quot;:{&quot;deployTektonTaskResources&quot;:true}}}'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;create-tekton-pipelines&quot;&gt;Create Tekton Pipelines&lt;/h3&gt;
&lt;p&gt;source: &lt;a href=&quot;https://github.com/ammarun11/kubevirt-tekton-pipelines&quot;&gt;https://github.com/ammarun11/kubevirt-tekton-pipelines&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ll create pipelines for Ubuntu VMs and Windows VMs
Go to terminal or oc/kubectl client,&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
oc create ns openinfra2023
oc project openinfra2023

# Ubuntu VM piplines
oc create -f https://raw.githubusercontent.com/ammarun11/kubevirt-tekton-pipelines/main/examples/pipelines/okd/server-deployer-flask/server-deployer-flask-ubuntu.yaml

# Windows VM pipelines
## Need Create ConfigMap unattend &amp;amp; sysprep for automate deployment for windows image

oc create -f https://raw.githubusercontent.com/ammarun11/kubevirt-tekton-pipelines/main/examples/pipelines/okd/windows10/windows10-customize-sysprep.yaml
oc create -f https://raw.githubusercontent.com/ammarun11/kubevirt-tekton-pipelines/main/examples/pipelines/okd/windows10/windows10-template-autounattend.yaml

# Windows VM Template
oc create -f https://raw.githubusercontent.com/ammarun11/kubevirt-tekton-pipelines/main/examples/pipelines/okd/windows10/windows10-template.yaml
# Windows VM Customize
oc create -f https://raw.githubusercontent.com/ammarun11/kubevirt-tekton-pipelines/main/examples/pipelines/okd/windows10/windows10-customize.yaml

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;results&quot;&gt;Results,&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd12.png&quot; alt=&quot;image12&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd13.png&quot; alt=&quot;image13&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For creating VMs will be on next part,&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part3/&quot;&gt;Next Part 3&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.okd.io/4.13/virt/about-virt.html&quot;&gt;OKD Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="kubernetes" /><category term="openshift" /><category term="okd" /><category term="Jekyll" /><category term="update" /><summary type="html">OKD Virtualization and Tekton Pipelines Let’s continue discussing OKD Virtualization. Now, I’ll show you how we can automate the setup and customization of VMs in OKD Virtualization using Tekton Pipelines.</summary></entry><entry><title type="html">[k8s] Setup OKD Virtualization and launch VMs - part 1</title><link href="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part1/" rel="alternate" type="text/html" title="[k8s] Setup OKD Virtualization and launch VMs - part 1" /><published>2023-12-07T00:00:00+07:00</published><updated>2023-12-07T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part1</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part1/">&lt;h3 id=&quot;okd&quot;&gt;OKD&lt;/h3&gt;
&lt;p&gt;let’s talk about OKD in a simple way. Think of it as a cool platform for building and running apps in containers. Whether you’re dealing with just a handful of machines or a massive data center, OKD has your back. It’s built on top of Kubernetes, the powerhouse behind stuff like streaming, ecommerce, holding, gaming, and online banking.&lt;/p&gt;

&lt;p&gt;The best part? You can use it with Red Hat’s open technologies to take your apps beyond one cloud – use ‘em on your own servers or in different cloud setups. Flexibility at its finest!”&lt;/p&gt;

&lt;p&gt;here is for the layer&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd1.png&quot; alt=&quot;image1&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;okd-virtualization&quot;&gt;OKD Virtualization&lt;/h3&gt;

&lt;p&gt;Now we break down OKD Virtualization. It’s like an extra feature or add-on for OKD that lets you handle both virtual machines (VMs) and containers together.&lt;/p&gt;

&lt;p&gt;With OKD Virtualization, you get new tools in your OKD cluster, thanks to Kubernetes magic. Here’s what you can do:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Create and take care of Linux and Windows virtual machines.&lt;/li&gt;
  &lt;li&gt;Run pod and VM tasks side by side in your cluster.&lt;/li&gt;
  &lt;li&gt;Connect to your VMs using different tools and consoles.&lt;/li&gt;
  &lt;li&gt;Bring in existing VMs or make copies of them.&lt;/li&gt;
  &lt;li&gt;Handle stuff like network controllers and storage disks for your VMs.&lt;/li&gt;
  &lt;li&gt;Move your VMs around between nodes easily.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Plus, there’s a slick web console to help you manage all these virtual goodies right alongside your OKD containers. It plays nicely with Red Hat OpenShift Data Foundation features too!”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alright, let’s next talk about engine behind it. The hyperconverged-cluster-operator (Kubevirt), or HCO for short, is like a control center for various other operators in Kubernetes, such as kubevirt, cdi, and networking. It’s kind of like an operator for operators – a one-stop-shop for deploying and configuring them.&lt;/p&gt;

&lt;p&gt;HCO doesn’t replace or mess with OLM (Operator Lifecycle Manager). Instead, it helps you create operator Custom Resources (CRs) as you see fit.&lt;/p&gt;

&lt;p&gt;So, let’s dive into how you can use HCO through a Custom Resource Definition (CRD) method. It’s a straightforward way to make the most of this feature. Let’s roll!”&lt;/p&gt;

&lt;p&gt;Here for the OKD Virtulization Architecture&lt;/p&gt;

&lt;p&gt;kubevirt
&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/image-1.png&quot; alt=&quot;Alt text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/image-2.png&quot; alt=&quot;Alt text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;HCO
&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/image.png&quot; alt=&quot;Alt text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Requirements,&lt;/p&gt;

&lt;p&gt;A few requirements need to be met before you can begin:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You’ll need an OKD cluster or something like OpenShift, you can follow this guide to deploy okd simple way &lt;a href=&quot;https://ammarun.my.id/ngoprek/server/cloud/openshift/container/Setup-Openshift-Codeready&quot;&gt;Code Ready Openshift/OKD&lt;/a&gt; or other deployment guide &lt;a href=&quot;https://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/deploy-openshift-cluster/&quot;&gt;Deploy Openshift&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Don’t forget to have the kubectl/oc client utility ready to roll.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;deploy-kubevirt-hyperconverged-cluster-operator-from-the-operatorhub&quot;&gt;Deploy KubeVirt HyperConverged Cluster Operator from the OperatorHub&lt;/h2&gt;

&lt;p&gt;Go to OperatorHub &amp;gt; Search KubeVirt &amp;gt; and select Kubevirt hyco cluster operator&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd2.png&quot; alt=&quot;image2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd3.png&quot; alt=&quot;image3&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Create CR to trigger HCO&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd4.png&quot; alt=&quot;image4&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After few minutes..&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd5.png&quot; alt=&quot;image5&quot; /&gt;&lt;/p&gt;

&lt;p&gt;ok now we create vm with okd virtualization&lt;/p&gt;

&lt;p&gt;first create namespace for our workspace vms and go to catalog 
oh look we’ve catalog VMs with datasource(datavolume) ready it, so now we can run vms more easy ~&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;DataSource/DataVolume objects are custom resources that are provided by the Containerized Data Importer (CDI) project. Data volumes orchestrate import, clone, and upload operations that are associated with an underlying persistent volume claim (PVC). Data volumes are integrated with OKD/OpenShift Virtualization, and they prevent a virtual machine from being started before the PVC has been prepared.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;oc create ns ammarun

# switch project/namespace

oc projects ammarun
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Go to dashboard 
Select Fedora catalog &amp;gt; then fill the things here&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd6.png&quot; alt=&quot;image6&quot; /&gt;&lt;/p&gt;

&lt;p&gt;you can customize spesification of vms, storage etc&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd7.png&quot; alt=&quot;image7&quot; /&gt;&lt;/p&gt;

&lt;p&gt;after reviewing, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CreateVirtualmachine&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On the storage side&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd8.png&quot; alt=&quot;image8&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And here our nice VM is ready to goo ~&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd9.png&quot; alt=&quot;image9&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/okd10.png&quot; alt=&quot;image10&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://ammarun.my.id/ngoprek/server/cloud/kubernetes/openshift/okd/OKD-virtualization-part2/&quot;&gt;Next Part 2&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.okd.io/4.13/virt/about-virt.html&quot;&gt;OKD Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="kubernetes" /><category term="openshift" /><category term="okd" /><category term="Jekyll" /><category term="update" /><summary type="html">OKD let’s talk about OKD in a simple way. Think of it as a cool platform for building and running apps in containers. Whether you’re dealing with just a handful of machines or a massive data center, OKD has your back. It’s built on top of Kubernetes, the powerhouse behind stuff like streaming, ecommerce, holding, gaming, and online banking.</summary></entry><entry><title type="html">[Ceph] Setup Microceph RadosGW</title><link href="http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/RadosGW-microceph-setup/" rel="alternate" type="text/html" title="[Ceph] Setup Microceph RadosGW" /><published>2023-07-25T00:00:00+07:00</published><updated>2023-07-25T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/RadosGW-microceph-setup</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/RadosGW-microceph-setup/">&lt;h2 id=&quot;brief&quot;&gt;Brief&lt;/h2&gt;
&lt;p&gt;All native protocols on Microceph (RBD, CephFS and RGW) are supported, 
Once you have your Ceph Object Storage service up and running, you may administer the service with user management, access controls, quotas and usage tracking among other features.&lt;/p&gt;

&lt;h2 id=&quot;enable-radosgw-microceph&quot;&gt;Enable RadosGW Microceph&lt;/h2&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;microceph enable rgw

microceph status
---output
MicroCeph deployment summary:
- am-ceph1 (10.20.14.68)
  Services: mds, mgr, mon, rgw, osd
  Disks: 3
- am-ceph2 (10.20.14.69)
  Services: mds, mgr, mon, osd
  Disks: 3
- am-ceph3 (10.20.14.70)
  Services: mds, mgr, mon, osd
  Disks: 3

ceph -s
---output
  cluster:
    id:     a7bdc86e-5cce-4697-96cc-c4b29a5a50e2
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum am-ceph1,am-ceph2,am-ceph3 (age 28h)
    mgr: am-ceph1(active, since 18h), standbys: am-ceph2, am-ceph3
    osd: 9 osds: 9 up (since 26h), 9 in (since 28h)
    rgw: 1 daemon active (1 hosts, 1 zones)

  data:
    pools:   12 pools, 305 pgs
    objects: 4.56k objects, 23 GiB
    usage:   67 GiB used, 113 GiB / 180 GiB avail
    pgs:     305 active+clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;create-radosgw-access-user&quot;&gt;Create RadosGW access user&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;microceph.radosgw-admin key create --uid=test --key-type=s3 --access-key fooAksesKunci --secret-key fooKunciRahasia

---output
{
    &quot;user_id&quot;: &quot;test&quot;,
    &quot;display_name&quot;: &quot;testuser&quot;,
    &quot;email&quot;: &quot;&quot;,
    &quot;suspended&quot;: 0,
    &quot;max_buckets&quot;: 1000,
    &quot;subusers&quot;: [],
    &quot;keys&quot;: [
        {
            &quot;user&quot;: &quot;test&quot;,
            &quot;access_key&quot;: &quot;fooAksesKunci&quot;,
            &quot;secret_key&quot;: &quot;fooKunciRahasia&quot;
        }
    ],
    &quot;swift_keys&quot;: [],
    &quot;caps&quot;: [],
    &quot;op_mask&quot;: &quot;read, write, delete&quot;,
    &quot;default_placement&quot;: &quot;&quot;,
    &quot;default_storage_class&quot;: &quot;&quot;,
    &quot;placement_tags&quot;: [],
    &quot;bucket_quota&quot;: {
        &quot;enabled&quot;: false,
        &quot;check_on_raw&quot;: false,
        &quot;max_size&quot;: -1,
        &quot;max_size_kb&quot;: 0,
        &quot;max_objects&quot;: -1
    },
    &quot;user_quota&quot;: {
        &quot;enabled&quot;: false,
        &quot;check_on_raw&quot;: false,
        &quot;max_size&quot;: -1,
        &quot;max_size_kb&quot;: 0,
        &quot;max_objects&quot;: -1
    },
    &quot;temp_url_keys&quot;: [],
    &quot;type&quot;: &quot;rgw&quot;,
    &quot;mfa_ids&quot;: []
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;install-awscli&quot;&gt;Install awscli&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install -y awscli
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;list-user-and-zone&quot;&gt;List user and zone&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;radosgw-admin user list
radosgw-admin zone list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;configure-aws-client-user&quot;&gt;Configure aws client user&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws configure --profile=test
---
AWS Access Key ID [None]: fooAksesKunci
AWS Secret Access Key [None]: fooKunciRahasia
Default region name [None]: default
Default output format [None]: json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;create-bucket&quot;&gt;Create bucket&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws --profile test --endpoint-url http://am-ceph1.internal.ammarun.id s3api create-bucket --bucket bucket0

aws --profile test --endpoint-url http://am-ceph1.internal.ammarun.id s3 ls
---output
2023-07-25 16:25:22 bucket0

radosgw-admin bucket list
--output
[
    &quot;bucket0&quot;
]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;create-sample-object-then-upload-to-bucket&quot;&gt;create sample object then upload to bucket&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;for a in {1..20}
do
  fallocate -l 100M isiember$a
  aws --profile test --endpoint-url http://am-ceph1.internal.ammarun.id s3 cp isiember$a s3://bucket0
done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;list-object-in-bucket&quot;&gt;List object in bucket&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws --profile test --endpoint-url http://am-ceph1.internal.ammarun.id s3 ls s3://bucket0
---output
2023-07-25 16:36:25  104857600 isiember1
2023-07-25 16:36:46  104857600 isiember10
2023-07-25 16:36:47  104857600 isiember11
2023-07-25 16:36:49  104857600 isiember12
2023-07-25 16:36:51  104857600 isiember13
2023-07-25 16:36:52  104857600 isiember14
2023-07-25 16:36:55  104857600 isiember15
2023-07-25 16:36:57  104857600 isiember16
2023-07-25 16:36:58  104857600 isiember17
2023-07-25 16:37:00  104857600 isiember18
2023-07-25 16:37:02  104857600 isiember19
2023-07-25 16:36:28  104857600 isiember2
2023-07-25 16:37:04  104857600 isiember20
2023-07-25 16:36:30  104857600 isiember3
2023-07-25 16:36:32  104857600 isiember4
2023-07-25 16:36:34  104857600 isiember5
2023-07-25 16:36:36  104857600 isiember6
2023-07-25 16:36:38  104857600 isiember7
2023-07-25 16:36:40  104857600 isiember8
2023-07-25 16:36:42  104857600 isiember9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="ceph" /><category term="openstack" /><category term="Jekyll" /><category term="update" /><summary type="html">Brief All native protocols on Microceph (RBD, CephFS and RGW) are supported, Once you have your Ceph Object Storage service up and running, you may administer the service with user management, access controls, quotas and usage tracking among other features.</summary></entry><entry><title type="html">[Ceph] Setup Ceph cluster with Microceph</title><link href="http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/setup-microceph-cluster/" rel="alternate" type="text/html" title="[Ceph] Setup Ceph cluster with Microceph" /><published>2023-07-24T00:00:00+07:00</published><updated>2023-07-24T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/setup-microceph-cluster</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/ceph/openstack/setup-microceph-cluster/">&lt;h2 id=&quot;brief&quot;&gt;Brief&lt;/h2&gt;
&lt;p&gt;MicroCeph is a lightweight way of deploying a Ceph cluster using just a few commands, resulting in reliable and resilient distributed storage. MicroCeph is aimed at small scale private-clouds.&lt;/p&gt;

&lt;p&gt;we’re here used ceph quincy version&lt;/p&gt;

&lt;p&gt;Check out MicroCeph’s documentation at https://canonical-microceph.readthedocs-hosted.com/en/latest/.&lt;/p&gt;

&lt;h2 id=&quot;nodes&quot;&gt;Nodes&lt;/h2&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- am-ceph1 (OSD Disk: vdb,vdc,vdd) 
- am-ceph2 (OSD Disk: vdb,vdc,vdd)
- am-ceph3 (OSD Disk: vdb,vdc,vdd)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;initial-setup&quot;&gt;Initial Setup&lt;/h2&gt;
&lt;p&gt;To get started install the MicroCeph snap with the following command on each node to be used in the cluster:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;snap install microceph --channel=quincy/stable &amp;amp;&amp;amp; snap refresh --hold microceph
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Connect the microceph snap to the hardware-observe and block-devices so disks on os will knew by snap package interface:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;snap connect microceph:hardware-observe
snap connect microceph:block-devices
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;then-bootstrap-init-the-cluster-from-the-first-node&quot;&gt;Then bootstrap init the cluster from the first node:&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh am-ceph1
microceph init
Please choose the address MicroCeph will be listening on [default=10.20.10.68]: 10.20.14.68
Would you like to create a new MicroCeph cluster? (yes/no) [default=no]: yes
Would you like to add additional machines to the cluster? [default=empty]: am-ceph2
eyJuYW1lIjoiYW0tY2VwaDIiLCJzZWNyZXQiOiJjNjhmODllMTE2MTIyMWFmNzQ3MTlhNzQ3MDYyY2RiYWEzZmFkYTdkNjhkMTljY2E1ZmE1MDI3NTkxM2QyZGI2IiwiZmluZ2VycHJpbnQiOiI4OGMzNzFhNDJlMGY3MDIxZTgyYThhM2RlZjJiZDQxMDFiODQwYmRhNGM3YWYwOTQ0NTBiZjc0OTMzM2QzMWVmIiwiam9pbl9hZGRyZXNzZXMiOlsiMTAuMjAuMTAuNjg6NzQ0MyJdfQ==
# move to am-ceph2
Would you like to add additional machines to the cluster? [default=empty]: am-ceph3
eyJuYW1lIjoiYW0tY2VwaDIiLCJzZWNyZXQiOiJjMjcyMTU2M2Y4YTVhYTRiOWJlYzM5MTMxZmJiMzY1ZWIzN2MyNzJiNzJhZmI2MTQ2NjBlN2M1ZGQ0Y2U0ZTc2IiwiZmluZ2VycHJpbnQiOiI4OGMzNzFhNDJlMGY3MDIxZTgyYThhM2RlZjJiZDQxMDFiODQwYmRhNGM3YWYwOTQ0NTBiZjc0OTMzM2QzMWVmIiwiam9pbl9hZGRyZXNzZXMiOlsiMTAuMjAuMTAuNzA6NzQ0MyIsIjEwLjIwLjEwLjY4Ojc0NDMiXX0
# move to am-ceph3
# skip enter path disk
Show local disks available, option to directly enter path ? [default=empty]: 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh am-ceph2
microceph init
Please choose the address MicroCeph will be listening on [default=10.20.10.69]: 10.20.14.69
Would you like to create a new MicroCeph cluster? (yes/no) [default=no]: no
Please enter your join token: eyJuYW1lIjoiYW0tY2VwaDIiLCJzZWNyZXQiOiJjNjhmODllMTE2MTIyMWFmNzQ3MTlhNzQ3MDYyY2RiYWEzZmFkYTdkNjhkMTljY2E1ZmE1MDI3NTkxM2QyZGI2IiwiZmluZ2VycHJpbnQiOiI4OGMzNzFhNDJlMGY3MDIxZTgyYThhM2RlZjJiZDQxMDFiODQwYmRhNGM3YWYwOTQ0NTBiZjc0OTMzM2QzMWVmIiwiam9pbl9hZGRyZXNzZXMiOlsiMTAuMjAuMTAuNjg6NzQ0MyJdfQ==
# skip enter path disk
Show local disks available, option to directly enter path ? [default=empty]: 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh am-ceph3
microceph init
Please choose the address MicroCeph will be listening on [default=10.20.10.70]: 10.20.14.70
Would you like to create a new MicroCeph cluster? (yes/no) [default=no]: no
Please enter your join token: eyJuYW1lIjoiYW0tY2VwaDIiLCJzZWNyZXQiOiJjMjcyMTU2M2Y4YTVhYTRiOWJlYzM5MTMxZmJiMzY1ZWIzN2MyNzJiNzJhZmI2MTQ2NjBlN2M1ZGQ0Y2U0ZTc2IiwiZmluZ2VycHJpbnQiOiI4OGMzNzFhNDJlMGY3MDIxZTgyYThhM2RlZjJiZDQxMDFiODQwYmRhNGM3YWYwOTQ0NTBiZjc0OTMzM2QzMWVmIiwiam9pbl9hZGRyZXNzZXMiOlsiMTAuMjAuMTAuNzA6NzQ0MyIsIjEwLjIwLjEwLjY4Ojc0NDMiXX0
# skip enter path disk
Show local disks available, option to directly enter path ? [default=empty]: 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check the cluster status with the following command:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;microceph.ceph status
or
ceph -s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;adding-osds&quot;&gt;Adding OSDs&lt;/h2&gt;

&lt;h3 id=&quot;exec-on-all-node-am-ceph1-am-ceph2-am-ceph3&quot;&gt;Exec on all node (am-ceph1, am-ceph2, am-ceph3)&lt;/h3&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;microceph disk add /dev/vdb --wipe
microceph disk add /dev/vdc --wipe
microceph disk add /dev/vdd --wipe
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check the cluster status with the following command:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# microceph.ceph status
or
# ceph -s

  cluster:
    id:     a7bdc86e-5cce-4697-96cc-c4b29a5a50e2
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum am-ceph1,am-ceph2,am-ceph3 (age 9m)
    mgr: am-ceph1(active, since 9m), standbys: am-ceph2, am-ceph3
    osd: 9 osds: 9 up (since 9m), 9 in (since 9m)

  data:
    pools:   1 pools, 1 pgs
    objects: 0 objects, 15 GiB
    usage:   1 GiB used, 180 GiB / 180 GiB avail
    pgs:     1 active+clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;operational-ceph-block-storage&quot;&gt;Operational Ceph Block Storage&lt;/h2&gt;
&lt;h3 id=&quot;create-block-device-image&quot;&gt;Create block device image&lt;/h3&gt;
&lt;h4 id=&quot;create-pool&quot;&gt;Create pool&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ceph osd pool create pool-test1 8 
rbd pool init pool-test1
rbd create pool-test1/block0 --size 1028
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;check-block-rbd-that-are-contained-in-pool-test1&quot;&gt;check block rbd that are contained in pool-test1&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rbd list pool-test1
rbd info pool-test1/block0

rbd image 'block0':
        size 1.0 GiB in 257 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: 3fd3bcd87005b
        block_name_prefix: rbd_data.3fd3bcd87005b
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
        op_features:
        flags:
        create_timestamp: Mon Jul 24 22:32:13 2023
        access_timestamp: Mon Jul 24 22:32:13 2023
        modify_timestamp: Mon Jul 24 22:32:13 2023
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;maping-image-to-block-device&quot;&gt;Maping image to block device&lt;/h4&gt;
&lt;h5 id=&quot;ceph-mon-filled-by-node-mon-on-am-ceph1&quot;&gt;ceph-mon filled by node-mon on am-ceph1&lt;/h5&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rbd map pool-test1/block0 -k /etc/ceph/ceph.client.admin.keyring
rbd showmapped

id  pool        namespace  image   snap  device
0   pool-test1             block0  -     /dev/rbd0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;format-filesystem&quot;&gt;Format filesystem&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkfs.xfs /dev/rbd0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;mount-block-device&quot;&gt;Mount block device&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir /mnt/block0
mount /dev/rbd0 /mnt/block0
df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G     0  7.9G   0% /dev
tmpfs           1.6G  1.3M  1.6G   1% /run
/dev/vda1        39G  2.6G   37G   7% /
---
/dev/rbd0      1018M   40M  979M   4% /mnt/block0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="ceph" /><category term="openstack" /><category term="Jekyll" /><category term="update" /><summary type="html">Brief MicroCeph is a lightweight way of deploying a Ceph cluster using just a few commands, resulting in reliable and resilient distributed storage. MicroCeph is aimed at small scale private-clouds.</summary></entry><entry><title type="html">[Proxmox] Preview Setup Cluster In Proxmox</title><link href="http://ammarun.my.id/ngoprek/server/cloud/proxmox/instance/proxmox-setup/" rel="alternate" type="text/html" title="[Proxmox] Preview Setup Cluster In Proxmox" /><published>2023-05-18T00:00:00+07:00</published><updated>2023-05-18T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/proxmox/instance/proxmox-setup</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/proxmox/instance/proxmox-setup/">&lt;h2 id=&quot;nodes&quot;&gt;Nodes&lt;/h2&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- pve-proxmox-1
- pve-proxmox-2
- pve-proxmox-3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;prerequites&quot;&gt;Prerequites&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Each node (pve-proxmox-1, pve-proxmox-2, and pve-proxmox-3) has proxmox VE installed&lt;/li&gt;
  &lt;li&gt;Each node can be accessed by its GUI&lt;/li&gt;
  &lt;li&gt;Each node can be connected to each other&lt;/li&gt;
  &lt;li&gt;Each node has chrony installed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;setup&quot;&gt;Setup&lt;/h2&gt;
&lt;h3 id=&quot;via-dashboard&quot;&gt;Via Dashboard&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Login to one of the proxmox dashboards (pve-proxmox-1)&lt;/li&gt;
  &lt;li&gt;Click Datacenter Section -&amp;gt; Cluster -&amp;gt; Create Cluster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/vr4yQXXDSCxJmsPf-image-1658119426171.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/vr4yQXXDSCxJmsPf-image-1658119426171.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Enter the cluster name (cluster-prox) and select the network (172.168.1.101) to be used, and click Create&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/NKlvwUMnozyeWWwB-image-1658119442809.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/NKlvwUMnozyeWWwB-image-1658119442809.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;On Cluster Information, click Join Information, then click Copy Information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/9naqYK6rRJUCi4ds-image-1658119458550.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/9naqYK6rRJUCi4ds-image-1658119458550.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Login to other node proxmox dashboard (pve-proxmox-2 and pve-proxmox-3)&lt;/li&gt;
  &lt;li&gt;Click Datacenter Section -&amp;gt; Cluster -&amp;gt; Join Cluster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/v6sYnWWomeaiCG4j-image-1658119467399.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/v6sYnWWomeaiCG4j-image-1658119467399.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Paste the encoded cluster information that was copied earlier, then enter the password from the Proxmox node, click Join&lt;/li&gt;
  &lt;li&gt;Wait until the joining cluster process is complete&lt;/li&gt;
  &lt;li&gt;Verify, Enter one of the Proxmox node dashboards, Click the Datacenter Section -&amp;gt; Cluster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/7TnQ8TLCJhEFgpxD-image-1658119476933.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/7TnQ8TLCJhEFgpxD-image-1658119476933.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;with-command-line&quot;&gt;With Command-Line&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Create cluster
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pvecm create cluster-prox
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Cek Status
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pvecm status
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;add another nodes to cluster
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# login to server another nodes
pvecm add {ip-address-node-new}
pvecm add 172.168.1.101
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Verify
```
root@pve-proxmox-1:~# pvecm status
Cluster information
——————-
Name:             cluster-prox
Config Version:   3
Transport:        knet
Secure auth:      on&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;quorum-information&quot;&gt;Quorum information&lt;/h2&gt;
&lt;p&gt;Date:             Sat Jul 16 09:16:29 2022
Quorum provider:  corosync_votequorum
Nodes:            3
Node ID:          0x00000001
Ring ID:          1.47
Quorate:          Yes&lt;/p&gt;

&lt;h2 id=&quot;votequorum-information&quot;&gt;Votequorum information&lt;/h2&gt;
&lt;p&gt;Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2&lt;br /&gt;
Flags:            Quorate&lt;/p&gt;

&lt;h2 id=&quot;membership-information&quot;&gt;Membership information&lt;/h2&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Nodeid      Votes Name 0x00000001          1 172.168.1.101 (local) 0x00000002          1 172.168.1.102 0x00000003          1 172.168.1.103 ```
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://book.btech.id/uploads/images/gallery/2022-07/tl9xtkwI4Sdy1gyn-image-1658119510943.png&quot;&gt;&lt;img src=&quot;https://book.btech.id/uploads/images/gallery/2022-07/scaled-1680-/tl9xtkwI4Sdy1gyn-image-1658119510943.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="proxmox" /><category term="instance" /><category term="Jekyll" /><category term="update" /><summary type="html">Nodes - pve-proxmox-1 - pve-proxmox-2 - pve-proxmox-3</summary></entry><entry><title type="html">[Openstack] Resize root partition in VM Openstack</title><link href="http://ammarun.my.id/ngoprek/server/cloud/openstack/instance/resize-root-partition-openstack-instance/" rel="alternate" type="text/html" title="[Openstack] Resize root partition in VM Openstack" /><published>2023-02-14T00:00:00+07:00</published><updated>2023-02-14T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/openstack/instance/resize-root-partition-openstack-instance</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/openstack/instance/resize-root-partition-openstack-instance/">&lt;h2 id=&quot;guide-resize-mounted-volume-in-vm-openstack&quot;&gt;Guide Resize Mounted Volume in VM Openstack&lt;/h2&gt;

&lt;p&gt;Eventually we need to resize volume root /dev/sda, which is the root partition; the problem is root partition cannot detach, so how we can resize the size of the root partition? Here’s your answer dude&lt;/p&gt;

&lt;h3 id=&quot;resize-from-openstack-side&quot;&gt;Resize From OpenStack Side&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;## set the status to available to a volume&lt;/span&gt;
openstack volume &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--state&lt;/span&gt; available &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;volume &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## resize the volume&lt;/span&gt;
openstack volume &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--size&lt;/span&gt; 40 &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;volume &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## check size and status again&lt;/span&gt;
openstack volume show &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;volume &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## set status to in-use again&lt;/span&gt;
openstack volume &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--state&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-use&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;volume &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;resize-volume-from-vm-side&quot;&gt;Resize Volume from VM Side&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;## Grow part (Contoh akan resize root partisi)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;growpart /dev/vda 1

&lt;span class=&quot;c&quot;&gt;## Check apakah sudah grow sesuai volume baru&lt;/span&gt;
lsblk

&lt;span class=&quot;c&quot;&gt;## Resize ‘/’ partition to fill all space&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;resize2fs /dev/vda1

&lt;span class=&quot;c&quot;&gt;## (option) If your filesystem is XFS, it can be grown while mounted using the xfs_growfs command:&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;xfs_growfs /

&lt;span class=&quot;c&quot;&gt;## Verify &lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;no space left on the block device&lt;/code&gt;, running command:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo mount -o size=10M,rw,nodev,nosuid -t tmpfs tmpfs /tmp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the process unmount &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo umount /tmp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;if-lvm-volume--&quot;&gt;IF LVM Volume  :&lt;/h4&gt;

&lt;h4 id=&quot;1-refresh-lvm-vg-lvm-from-lsblk&quot;&gt;1. Refresh LVM VG (LVM from lsblk)&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vgchange --refresh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;2-resize-pv&quot;&gt;2. Resize pv&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pvresize /dev/sdX
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;3-extend-lv&quot;&gt;3. Extend lv&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lvextend -l +100%FREE /dev/&amp;lt;vg_name&amp;gt;/&amp;lt;lv_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;4-mount-dev&quot;&gt;4. Mount /dev/&lt;vg_name&gt;/&lt;lv_name&gt;&lt;/lv_name&gt;&lt;/vg_name&gt;&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mount /dev/&amp;lt;vg_name&amp;gt;/&amp;lt;lv_name&amp;gt; /mnt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;5-filesystem-grow&quot;&gt;5. Filesystem grow&lt;/h4&gt;
&lt;h6 id=&quot;--jika-filesystem-xfs&quot;&gt;- Jika filesystem XFS&lt;/h6&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;xfs_growfs /dev/&amp;lt;vg_name&amp;gt;/&amp;lt;lv_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h6 id=&quot;--jika-filesystem------lanjutkan&quot;&gt;- Jika filesystem . . . .  Lanjutkan&lt;/h6&gt;
&lt;p&gt;```&lt;/p&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="openstack" /><category term="instance" /><category term="Jekyll" /><category term="update" /><summary type="html">Guide Resize Mounted Volume in VM Openstack</summary></entry><entry><title type="html">[Preview] DevOps With Gitlab CI/CD</title><link href="http://ammarun.my.id/ngoprek/server/cloud/docker/cicd/gitlab/devops/preview-gitlab-cicd/" rel="alternate" type="text/html" title="[Preview] DevOps With Gitlab CI/CD" /><published>2023-01-28T00:00:00+07:00</published><updated>2023-01-28T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/docker/cicd/gitlab/devops/preview-gitlab-cicd</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/docker/cicd/gitlab/devops/preview-gitlab-cicd/">&lt;h2 id=&quot;preview&quot;&gt;Preview&lt;/h2&gt;

&lt;h3 id=&quot;devops-pipeline&quot;&gt;DevOps pipeline&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/1gitlab.png&quot; alt=&quot;Dashboard1&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;stack-technology&quot;&gt;Stack Technology,&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Gitlab as CI/CD&lt;/li&gt;
  &lt;li&gt;Harbor&lt;/li&gt;
  &lt;li&gt;Kubernetes&lt;/li&gt;
  &lt;li&gt;Trivy Scan image&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cicd-staging-pipeline&quot;&gt;CI/CD Staging pipeline&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/2gitlab.png&quot; alt=&quot;Dashboard2&quot; /&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/3gitlab.png&quot; alt=&quot;Dashboard3&quot; /&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/4gitlab.png&quot; alt=&quot;Dashboard4&quot; /&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/5gitlab.png&quot; alt=&quot;Dashboard5&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;sample-pipeline-gitlab&quot;&gt;Sample pipeline gitlab&lt;/h3&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;scan&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;update-chart-and-code&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy-stg&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;create-mr&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;prod-approval&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy-prod&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;IMAGE&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;cx-harbor.lab.id/ammar/odoo-gitlab&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;APP_NAME_STG&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;odoo-gl-stg&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;REPO_BRANCH_STG&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;staging&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;APP_NAME&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;odoo-gl-prod&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;REPO_BRANCH&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;production&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;REPO_URL&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://go.lab.id/ammar/odoo-source.git&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;REPO_URL_2&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://go.lab.id/ammar/odoo-source&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;HELM_REPO&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;https://cx-harbor.lab.id/chartrepo/ammar&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker login $HARBOR_URL -u $HARBOR_USERNAME -p $HARBOR_PASSWORD&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker info&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm repo add ammar $HELM_REPO --force-update&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm repo list&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Build and Push Image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export TAG=$(git tag --list | sort -V | tail -n1)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cd odoo&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;Build Container Image&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker build -t $IMAGE:16-latest .&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker tag $IMAGE:16-latest $IMAGE:16-$TAG-rc&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker tag $IMAGE:16-latest $IMAGE:16-$TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker push $IMAGE:16-$TAG-rc&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker push $IMAGE:16-$TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker push $IMAGE:16-latest&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Scan Image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;scan&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export TAG=$(git tag --list | sort -V | tail -n1)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $TAG&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;$TAG image scanned using Harbor integrated Trivy Scanner&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;trivy image --no-progress $IMAGE:16-$TAG-rc&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# - trivy image --no-progress --exit-code 0 --severity HIGH,CRITICAL $IMAGE:16-$TAG-rc&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;sleep &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;Push Chart &amp;amp; Code&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;allow_failure&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;update-chart-and-code&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export TAG=$(git tag --list | sort -V | tail -n1)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export IMAGE_STG=cx-harbor.lab.id/ammar/odoo-gitlab:16-$TAG-rc&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export IMAGE_PROD=cx-harbor.lab.id/ammar/odoo-gitlab:16-$TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $TAG&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Git Preparation&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git config user.email &quot;ammar@lab.id&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git config user.name &quot;ammarun11&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git checkout staging&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git pull origin staging&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Update Helm Chart Version ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yq e -i '.version=strenv(TAG)' helm/odoo-gl/Chart.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yq e -i '.appVersion=strenv(TAG)' helm/odoo-gl/Chart.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cat helm/odoo-gl/Chart.yaml&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Update Staging Values ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yq e -i '.container.image=strenv(IMAGE_STG)' helm/odoo-gl/values.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cat helm/odoo-gl/values.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yq e -i '.container.image=strenv(IMAGE_STG)' helm/odoo-gl/values-stg.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cat helm/odoo-gl/values-stg.yaml&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Update Production Values ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yq e -i '.container.image=strenv(IMAGE_PROD)' helm/odoo-gl/values-prod.yaml&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cat helm/odoo-gl/values-prod.yaml&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Update Environment Variable ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo VERSION=$TAG &amp;gt; helm/version.env&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Push Chart to Harbor ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm repo add ammar $HELM_REPO --force-update&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm cm-push --username $HARBOR_USERNAME --password $HARBOR_PASSWORD helm/odoo-gl/ ammar&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm repo update&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# --- Push Code Back to Staging Branch ---&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git add .&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git status&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git commit -m &quot;Update Helm Version to $TAG&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git push -o ci.skip &quot;https://ammarun11:${ACCESS_TOKEN}@go.lab.id/ammar/odoo-source.git&quot; $REPO_BRANCH_STG&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Deploy Staging&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy-stg&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export TAG=$(git tag --list | sort -V | tail -n1)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export EXIST_STG=$(helm list -n odoo-gl-stg | tail -n +2 | wc -l)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $EXIST_STG&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git checkout staging&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git pull origin staging&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;Deploying Staging Application...&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;if [ &quot;$EXIST_STG&quot; == &quot;0&quot; ]; then helm install $APP_NAME_STG ammar/odoo-gl --version $TAG --values helm/odoo-gl/values-stg.yaml --wait --namespace $APP_NAME_STG; else helm upgrade $APP_NAME_STG ammar/odoo-gl --version $TAG --values helm/odoo-gl/values-stg.yaml --wait --namespace $APP_NAME_STG; fi&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm list -n $APP_NAME_STG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kubectl get all -n $APP_NAME_STG&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Create MR&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploy&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Staging&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;GIT_STRATEGY&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;none&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;create-mr&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./merge-request.sh&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Approval Release&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;prod-approval&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$REPO_URL&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;curl -s -X POST https://api.telegram.org/bot$TELE_TOKEN/sendMessage -d chat_id=$TELE_CHAT_ID -d parse_mode=markdown -d text=&quot;Dear Team *ammar*, Please Approve Deployment of * $APP_NAME * on Branch *production*. Please goes to $REPO_URL_2/-/environments to *Accept.*&quot;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;Deploy Production&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Approval&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Release&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy-prod&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; 
    &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;when&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;manual&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;allow_failure&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export TAG=$(git tag --list | sort -V | tail -n1)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $TAG&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;export EXIST_PROD=$(helm list -n odoo-gl-prod | tail -n +2 | wc -l)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $EXIST_PROD&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;Deploying Production Application...&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;if [ &quot;$EXIST_PROD&quot; == &quot;0&quot; ]; then helm install $APP_NAME ammar/odoo-gl --version $TAG --values helm/odoo-gl/values-prod.yaml --wait --namespace $APP_NAME; else helm upgrade $APP_NAME ammar/odoo-gl --version $TAG --values helm/odoo-gl/values-prod.yaml --wait --namespace $APP_NAME; fi&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;helm list -n $APP_NAME&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kubectl get all -n $APP_NAME&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="docker" /><category term="cicd" /><category term="gitlab" /><category term="devops" /><category term="Jekyll" /><category term="update" /><summary type="html">Preview</summary></entry><entry><title type="html">[Preview] Monitoring k8s with Grafana+Prometheus+Loki</title><link href="http://ammarun.my.id/ngoprek/server/cloud/docker/kubernetes/monitoring/grafana/prometheus/loki/devops/preview-kubernetes-monitoring/" rel="alternate" type="text/html" title="[Preview] Monitoring k8s with Grafana+Prometheus+Loki" /><published>2023-01-28T00:00:00+07:00</published><updated>2023-01-28T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/docker/kubernetes/monitoring/grafana/prometheus/loki/devops/preview-kubernetes-monitoring</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/docker/kubernetes/monitoring/grafana/prometheus/loki/devops/preview-kubernetes-monitoring/">&lt;h2 id=&quot;preview&quot;&gt;Preview&lt;/h2&gt;

&lt;p&gt;i used kube-prometheus stack&lt;/p&gt;

&lt;p&gt;https://github.com/prometheus-operator/kube-prometheus&lt;/p&gt;

&lt;h3 id=&quot;grafana-dashboards&quot;&gt;Grafana Dashboards&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/1grafana.png&quot; alt=&quot;Dashboard1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/5grafana.png&quot; alt=&quot;Dashboard2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/6grafana.png&quot; alt=&quot;Dashboard3&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;prometheus-targets&quot;&gt;prometheus Targets&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/2grafana.png&quot; alt=&quot;Dashboard4&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;loki&quot;&gt;Loki&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/3grafana.png&quot; alt=&quot;Dashboard5&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/4grafana.png&quot; alt=&quot;Dashboard6&quot; /&gt;&lt;/p&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="docker" /><category term="kubernetes" /><category term="monitoring" /><category term="grafana" /><category term="prometheus" /><category term="loki" /><category term="devops" /><category term="Jekyll" /><category term="update" /><summary type="html">Preview</summary></entry><entry><title type="html">[Preview] Setup Docker instance for use with MAGEWELL CLOUD</title><link href="http://ammarun.my.id/ngoprek/server/cloud/docker/magewall/preview-magewall-cloud-on-docker/" rel="alternate" type="text/html" title="[Preview] Setup Docker instance for use with MAGEWELL CLOUD" /><published>2023-01-15T00:00:00+07:00</published><updated>2023-01-15T00:00:00+07:00</updated><id>http://ammarun.my.id/ngoprek/server/cloud/docker/magewall/preview-magewall-cloud-on-docker</id><content type="html" xml:base="http://ammarun.my.id/ngoprek/server/cloud/docker/magewall/preview-magewall-cloud-on-docker/">&lt;h2 id=&quot;preview&quot;&gt;Preview&lt;/h2&gt;

&lt;h3 id=&quot;docker-setup-and-os&quot;&gt;Docker Setup and OS&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/2magewall.png&quot; alt=&quot;Dashboard1&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;dashboard-magewall-cloud&quot;&gt;Dashboard Magewall-cloud&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/ammarun11/ammarun11.github.io/master/static/img/_posts/1magewall.png&quot; alt=&quot;Dashboard2&quot; /&gt;&lt;/p&gt;</content><author><name>&gt;_</name></author><category term="ngoprek" /><category term="server" /><category term="cloud" /><category term="docker" /><category term="magewall" /><category term="Jekyll" /><category term="update" /><summary type="html">Preview</summary></entry></feed>